Bug 1575399 [wpt PR 18572] - [LayoutNG] Give flex items their stretched size earlier...
[gecko.git] / chrome / nsChromeRegistryContent.h
blob444c96b62e934f4e5c6d590106320e1a7305d808
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 SubstitutionMapping;
14 struct OverrideMapping;
16 class nsChromeRegistryContent : public nsChromeRegistry {
17 public:
18 nsChromeRegistryContent();
20 void RegisterRemoteChrome(const nsTArray<ChromePackage>& aPackages,
21 const nsTArray<SubstitutionMapping>& aResources,
22 const nsTArray<OverrideMapping>& aOverrides,
23 const nsACString& aLocale, bool aReset);
25 NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
26 nsIUTF8StringEnumerator** aResult) override;
27 NS_IMETHOD CheckForNewChrome() override;
28 NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
29 const char16_t* aData) override;
30 NS_IMETHOD IsLocaleRTL(const nsACString& package, bool* aResult) override;
31 NS_IMETHOD GetSelectedLocale(const nsACString& aPackage, bool aAsBCP47,
32 nsACString& aLocale) override;
34 void RegisterPackage(const ChromePackage& aPackage);
35 void RegisterOverride(const OverrideMapping& aOverride);
36 void RegisterSubstitution(const SubstitutionMapping& aResource);
38 private:
39 struct PackageEntry {
40 PackageEntry() : flags(0) {}
41 ~PackageEntry() {}
43 nsCOMPtr<nsIURI> contentBaseURI;
44 nsCOMPtr<nsIURI> localeBaseURI;
45 nsCOMPtr<nsIURI> skinBaseURI;
46 uint32_t flags;
49 nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
50 const nsCString& aProvider,
51 const nsCString& aPath) override;
52 nsresult GetFlagsFromPackage(const nsCString& aPackage,
53 uint32_t* aFlags) override;
55 nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
56 nsCString mLocale;
58 virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
59 char* const* argv, int flags) override;
60 virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
61 char* const* argv, int flags) override;
62 virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
63 char* const* argv, int flags) override;
64 virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
65 char* const* argv, int flags) override;
66 virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
67 char* const* argv, int flags) override;
70 #endif // nsChromeRegistryContent_h