1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/xbl/nsXBLPrototypeResources.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsXBLPrototypeResources_h__ 1.10 +#define nsXBLPrototypeResources_h__ 1.11 + 1.12 +#include "nsAutoPtr.h" 1.13 +#include "nsICSSLoaderObserver.h" 1.14 +#include "nsIStyleRuleProcessor.h" 1.15 + 1.16 +class nsIContent; 1.17 +class nsIAtom; 1.18 +class nsXBLResourceLoader; 1.19 +class nsXBLPrototypeBinding; 1.20 +class nsCSSStyleSheet; 1.21 + 1.22 +// *********************************************************************/ 1.23 +// The XBLPrototypeResources class 1.24 + 1.25 +class nsXBLPrototypeResources 1.26 +{ 1.27 +public: 1.28 + nsXBLPrototypeResources(nsXBLPrototypeBinding* aBinding); 1.29 + ~nsXBLPrototypeResources(); 1.30 + 1.31 + void LoadResources(bool* aResult); 1.32 + void AddResource(nsIAtom* aResourceType, const nsAString& aSrc); 1.33 + void AddResourceListener(nsIContent* aElement); 1.34 + nsresult FlushSkinSheets(); 1.35 + 1.36 + nsresult Write(nsIObjectOutputStream* aStream); 1.37 + 1.38 + void Traverse(nsCycleCollectionTraversalCallback &cb) const; 1.39 + 1.40 + void ClearLoader(); 1.41 + 1.42 + typedef nsTArray<nsRefPtr<nsCSSStyleSheet> > sheet_array_type; 1.43 + 1.44 +private: 1.45 + // A loader object. Exists only long enough to load resources, and then it dies. 1.46 + nsRefPtr<nsXBLResourceLoader> mLoader; 1.47 + 1.48 +public: 1.49 + // A list of loaded stylesheets for this binding. 1.50 + sheet_array_type mStyleSheetList; 1.51 + 1.52 + // The list of stylesheets converted to a rule processor. 1.53 + nsCOMPtr<nsIStyleRuleProcessor> mRuleProcessor; 1.54 +}; 1.55 + 1.56 +#endif 1.57 +