michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsXBLPrototypeResources_h__ michael@0: #define nsXBLPrototypeResources_h__ michael@0: michael@0: #include "nsAutoPtr.h" michael@0: #include "nsICSSLoaderObserver.h" michael@0: #include "nsIStyleRuleProcessor.h" michael@0: michael@0: class nsIContent; michael@0: class nsIAtom; michael@0: class nsXBLResourceLoader; michael@0: class nsXBLPrototypeBinding; michael@0: class nsCSSStyleSheet; michael@0: michael@0: // *********************************************************************/ michael@0: // The XBLPrototypeResources class michael@0: michael@0: class nsXBLPrototypeResources michael@0: { michael@0: public: michael@0: nsXBLPrototypeResources(nsXBLPrototypeBinding* aBinding); michael@0: ~nsXBLPrototypeResources(); michael@0: michael@0: void LoadResources(bool* aResult); michael@0: void AddResource(nsIAtom* aResourceType, const nsAString& aSrc); michael@0: void AddResourceListener(nsIContent* aElement); michael@0: nsresult FlushSkinSheets(); michael@0: michael@0: nsresult Write(nsIObjectOutputStream* aStream); michael@0: michael@0: void Traverse(nsCycleCollectionTraversalCallback &cb) const; michael@0: michael@0: void ClearLoader(); michael@0: michael@0: typedef nsTArray > sheet_array_type; michael@0: michael@0: private: michael@0: // A loader object. Exists only long enough to load resources, and then it dies. michael@0: nsRefPtr mLoader; michael@0: michael@0: public: michael@0: // A list of loaded stylesheets for this binding. michael@0: sheet_array_type mStyleSheetList; michael@0: michael@0: // The list of stylesheets converted to a rule processor. michael@0: nsCOMPtr mRuleProcessor; michael@0: }; michael@0: michael@0: #endif michael@0: