|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef nsXBLPrototypeResources_h__ |
|
7 #define nsXBLPrototypeResources_h__ |
|
8 |
|
9 #include "nsAutoPtr.h" |
|
10 #include "nsICSSLoaderObserver.h" |
|
11 #include "nsIStyleRuleProcessor.h" |
|
12 |
|
13 class nsIContent; |
|
14 class nsIAtom; |
|
15 class nsXBLResourceLoader; |
|
16 class nsXBLPrototypeBinding; |
|
17 class nsCSSStyleSheet; |
|
18 |
|
19 // *********************************************************************/ |
|
20 // The XBLPrototypeResources class |
|
21 |
|
22 class nsXBLPrototypeResources |
|
23 { |
|
24 public: |
|
25 nsXBLPrototypeResources(nsXBLPrototypeBinding* aBinding); |
|
26 ~nsXBLPrototypeResources(); |
|
27 |
|
28 void LoadResources(bool* aResult); |
|
29 void AddResource(nsIAtom* aResourceType, const nsAString& aSrc); |
|
30 void AddResourceListener(nsIContent* aElement); |
|
31 nsresult FlushSkinSheets(); |
|
32 |
|
33 nsresult Write(nsIObjectOutputStream* aStream); |
|
34 |
|
35 void Traverse(nsCycleCollectionTraversalCallback &cb) const; |
|
36 |
|
37 void ClearLoader(); |
|
38 |
|
39 typedef nsTArray<nsRefPtr<nsCSSStyleSheet> > sheet_array_type; |
|
40 |
|
41 private: |
|
42 // A loader object. Exists only long enough to load resources, and then it dies. |
|
43 nsRefPtr<nsXBLResourceLoader> mLoader; |
|
44 |
|
45 public: |
|
46 // A list of loaded stylesheets for this binding. |
|
47 sheet_array_type mStyleSheetList; |
|
48 |
|
49 // The list of stylesheets converted to a rule processor. |
|
50 nsCOMPtr<nsIStyleRuleProcessor> mRuleProcessor; |
|
51 }; |
|
52 |
|
53 #endif |
|
54 |