Bumping gaia.json for 1 gaia revision(s) a=gaia-bump
[gecko.git] / chrome / nsChromeRegistryContent.h
blob9320806d7b1b7ff5bec7a7abcbdab9c5d879be8e
1 /* -*- Mode: C++; tab-width: 8; 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/. */
6 #ifndef nsChromeRegistryContent_h
7 #define nsChromeRegistryContent_h
9 #include "nsChromeRegistry.h"
10 #include "nsClassHashtable.h"
12 struct ChromePackage;
13 struct ResourceMapping;
14 struct OverrideMapping;
16 class nsChromeRegistryContent : public nsChromeRegistry
18 public:
19 nsChromeRegistryContent();
21 void RegisterRemoteChrome(const InfallibleTArray<ChromePackage>& aPackages,
22 const InfallibleTArray<ResourceMapping>& aResources,
23 const InfallibleTArray<OverrideMapping>& aOverrides,
24 const nsACString& aLocale,
25 bool aReset);
27 NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
28 nsIUTF8StringEnumerator* *aResult) MOZ_OVERRIDE;
29 NS_IMETHOD CheckForNewChrome() MOZ_OVERRIDE;
30 NS_IMETHOD CheckForOSAccessibility() MOZ_OVERRIDE;
31 NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
32 const char16_t* aData) MOZ_OVERRIDE;
33 NS_IMETHOD IsLocaleRTL(const nsACString& package,
34 bool *aResult) MOZ_OVERRIDE;
35 NS_IMETHOD GetSelectedLocale(const nsACString& aPackage,
36 nsACString& aLocale) MOZ_OVERRIDE;
37 NS_IMETHOD GetStyleOverlays(nsIURI *aChromeURL,
38 nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
39 NS_IMETHOD GetXULOverlays(nsIURI *aChromeURL,
40 nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
42 void RegisterPackage(const ChromePackage& aPackage);
43 void RegisterOverride(const OverrideMapping& aOverride);
44 void RegisterResource(const ResourceMapping& aResource);
46 private:
47 struct PackageEntry
49 PackageEntry() : flags(0) { }
50 ~PackageEntry() { }
52 nsCOMPtr<nsIURI> contentBaseURI;
53 nsCOMPtr<nsIURI> localeBaseURI;
54 nsCOMPtr<nsIURI> skinBaseURI;
55 uint32_t flags;
58 nsresult UpdateSelectedLocale() MOZ_OVERRIDE;
59 nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
60 const nsCString& aProvider,
61 const nsCString& aPath) MOZ_OVERRIDE;
62 nsresult GetFlagsFromPackage(const nsCString& aPackage, uint32_t* aFlags) MOZ_OVERRIDE;
64 nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
65 nsCString mLocale;
67 virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
68 char *const * argv, bool platform,
69 bool contentaccessible);
70 virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
71 char *const * argv, bool platform,
72 bool contentaccessible);
73 virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
74 char *const * argv, bool platform,
75 bool contentaccessible);
76 virtual void ManifestOverlay(ManifestProcessingContext& cx, int lineno,
77 char *const * argv, bool platform,
78 bool contentaccessible);
79 virtual void ManifestStyle(ManifestProcessingContext& cx, int lineno,
80 char *const * argv, bool platform,
81 bool contentaccessible);
82 virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
83 char *const * argv, bool platform,
84 bool contentaccessible);
85 virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
86 char *const * argv, bool platform,
87 bool contentaccessible);
90 #endif // nsChromeRegistryContent_h