Back to index

lightning-sunbird  0.9+nobinonly
nsIXULPrototypeCache.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Ben Goodger <ben@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 /*
00040 
00041 
00042 
00043  */
00044 
00045 #ifndef nsIXULPrototypeCache_h__
00046 #define nsIXULPrototypeCache_h__
00047 
00048 #include "nsISupports.h"
00049 class nsICSSStyleSheet;
00050 class nsIURI;
00051 class nsIXULPrototypeDocument;
00052 class nsIXULDocument;
00053 class nsCString;
00054 class nsIDocument;
00055 class nsIXBLDocumentInfo;
00056 class nsIFastLoadService;
00057 
00058 // {3A0A0FC1-8349-11d3-BE47-00104BDE6048}
00059 #define NS_XULPROTOTYPECACHE_CID \
00060 { 0x3a0a0fc1, 0x8349, 0x11d3, { 0xbe, 0x47, 0x0, 0x10, 0x4b, 0xde, 0x60, 0x48 } }
00061 
00062 // {CD196299-18E9-4642-AD43-666315C4D241}
00063 #define NS_IXULPROTOTYPECACHE_IID \
00064 { 0xcd196299, 0x18e9, 0x4642, { 0xad, 0x43, 0x66, 0x63, 0x15, 0xc4, 0xd2, 0x41 } };
00065 
00066 
00067 class nsIXULPrototypeCache : public nsISupports
00068 {
00069 public:
00070     NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXULPROTOTYPECACHE_IID);
00071 
00072     NS_IMETHOD GetPrototype(nsIURI* aURI, nsIXULPrototypeDocument** _result) = 0;
00073     NS_IMETHOD PutPrototype(nsIXULPrototypeDocument* aDocument) = 0;
00074     NS_IMETHOD FlushPrototypes() = 0;
00075 
00076     NS_IMETHOD GetStyleSheet(nsIURI* aURI, nsICSSStyleSheet** _result) = 0;
00077     NS_IMETHOD PutStyleSheet(nsICSSStyleSheet* aStyleSheet) = 0;
00078     NS_IMETHOD FlushStyleSheets() = 0;
00079 
00080     NS_IMETHOD GetScript(nsIURI* aURI, void** aScriptObject) = 0;
00081     NS_IMETHOD PutScript(nsIURI* aURI, void* aScriptObject) = 0;
00082     NS_IMETHOD FlushScripts() = 0;
00083 
00084     NS_IMETHOD GetXBLDocumentInfo(nsIURI* aURL, nsIXBLDocumentInfo** aResult) = 0;
00085     NS_IMETHOD PutXBLDocumentInfo(nsIXBLDocumentInfo* aDocument) = 0;
00086 
00087     NS_IMETHOD FlushXBLInformation() = 0;
00088 
00093     NS_IMETHOD Flush() = 0;
00094 
00098     NS_IMETHOD GetEnabled(PRBool* aIsEnabled) = 0;
00099 
00103     NS_IMETHOD AbortFastLoads() = 0;
00104 
00108     NS_IMETHOD GetFastLoadService(nsIFastLoadService** aResult) = 0;
00109 
00113     NS_IMETHOD RemoveFromFastLoadSet(nsIURI* aDocumentURI) = 0;
00114 
00118     NS_IMETHOD WritePrototype(nsIXULPrototypeDocument* aDocument) = 0;
00119 };
00120 
00121 
00122 NS_IMETHODIMP
00123 NS_NewXULPrototypeCache(nsISupports* aOuter, REFNSIID aIID, void** aResult);
00124 
00125 
00126 const char XUL_FASTLOAD_FILE_BASENAME[] = "XUL";
00127 
00128 // Increase the subtractor when changing version, say when changing the
00129 // (opaque to XPCOM FastLoad code) format of XUL-specific XDR serializations.
00130 // See also JSXDR_BYTECODE_VERSION in jsxdrapi.h, which tracks incompatible JS
00131 // bytecode version changes.
00132 #define XUL_FASTLOAD_FILE_VERSION       (0xfeedbeef - 21)
00133 
00134 #define XUL_SERIALIZATION_BUFFER_SIZE   (64 * 1024)
00135 #define XUL_DESERIALIZATION_BUFFER_SIZE (8 * 1024)
00136 
00137 
00138 #endif // nsIXULPrototypeCache_h__