diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /chrome/nsChromeRegistryContent.h | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'chrome/nsChromeRegistryContent.h')
-rw-r--r-- | chrome/nsChromeRegistryContent.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/chrome/nsChromeRegistryContent.h b/chrome/nsChromeRegistryContent.h new file mode 100644 index 0000000000..7d16eedc51 --- /dev/null +++ b/chrome/nsChromeRegistryContent.h @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef nsChromeRegistryContent_h +#define nsChromeRegistryContent_h + +#include "nsChromeRegistry.h" +#include "nsClassHashtable.h" + +struct ChromePackage; +struct SubstitutionMapping; +struct OverrideMapping; + +class nsChromeRegistryContent : public nsChromeRegistry { + public: + nsChromeRegistryContent(); + + void RegisterRemoteChrome(const nsTArray<ChromePackage>& aPackages, + const nsTArray<SubstitutionMapping>& aResources, + const nsTArray<OverrideMapping>& aOverrides, + const nsACString& aLocale, bool aReset); + + NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage, + nsIUTF8StringEnumerator** aResult) override; + NS_IMETHOD CheckForNewChrome() override; + NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic, + const char16_t* aData) override; + NS_IMETHOD IsLocaleRTL(const nsACString& package, bool* aResult) override; + + void RegisterPackage(const ChromePackage& aPackage); + void RegisterOverride(const OverrideMapping& aOverride); + void RegisterSubstitution(const SubstitutionMapping& aResource); + + private: + struct PackageEntry { + PackageEntry() : flags(0) {} + ~PackageEntry() {} + + nsCOMPtr<nsIURI> contentBaseURI; + nsCOMPtr<nsIURI> localeBaseURI; + nsCOMPtr<nsIURI> skinBaseURI; + uint32_t flags; + }; + + nsIURI* GetBaseURIFromPackage(const nsCString& aPackage, + const nsCString& aProvider, + const nsCString& aPath) override; + nsresult GetFlagsFromPackage(const nsCString& aPackage, + uint32_t* aFlags) override; + + nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash; + nsCString mLocale; + + virtual void ManifestContent(ManifestProcessingContext& cx, int lineno, + char* const* argv, int flags) override; + virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno, + char* const* argv, int flags) override; + virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno, + char* const* argv, int flags) override; + virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno, + char* const* argv, int flags) override; + virtual void ManifestResource(ManifestProcessingContext& cx, int lineno, + char* const* argv, int flags) override; +}; + +#endif // nsChromeRegistryContent_h |