2010-03-11 05:33:00 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2010-03-11 05:33:00 +00:00
|
|
|
|
|
|
|
#ifndef nsChromeRegistryContent_h
|
|
|
|
#define nsChromeRegistryContent_h
|
|
|
|
|
|
|
|
#include "nsChromeRegistry.h"
|
|
|
|
#include "nsClassHashtable.h"
|
|
|
|
|
|
|
|
struct ChromePackage;
|
|
|
|
struct ResourceMapping;
|
|
|
|
struct OverrideMapping;
|
|
|
|
|
|
|
|
class nsChromeRegistryContent : public nsChromeRegistry
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsChromeRegistryContent();
|
2014-07-25 20:17:36 +00:00
|
|
|
|
2012-11-29 16:14:13 +00:00
|
|
|
void RegisterRemoteChrome(const InfallibleTArray<ChromePackage>& aPackages,
|
|
|
|
const InfallibleTArray<ResourceMapping>& aResources,
|
|
|
|
const InfallibleTArray<OverrideMapping>& aOverrides,
|
2014-07-25 20:17:36 +00:00
|
|
|
const nsACString& aLocale,
|
|
|
|
bool aReset);
|
2010-03-11 05:33:00 +00:00
|
|
|
|
2012-07-06 18:15:45 +00:00
|
|
|
NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
|
|
|
|
nsIUTF8StringEnumerator* *aResult) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD CheckForNewChrome() MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD CheckForOSAccessibility() MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
|
2014-01-04 15:02:17 +00:00
|
|
|
const char16_t* aData) MOZ_OVERRIDE;
|
2012-07-06 18:15:45 +00:00
|
|
|
NS_IMETHOD IsLocaleRTL(const nsACString& package,
|
|
|
|
bool *aResult) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetSelectedLocale(const nsACString& aPackage,
|
|
|
|
nsACString& aLocale) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetStyleOverlays(nsIURI *aChromeURL,
|
|
|
|
nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD GetXULOverlays(nsIURI *aChromeURL,
|
|
|
|
nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
|
2010-03-11 05:33:00 +00:00
|
|
|
|
2014-07-25 20:17:36 +00:00
|
|
|
void RegisterPackage(const ChromePackage& aPackage);
|
|
|
|
void RegisterOverride(const OverrideMapping& aOverride);
|
|
|
|
void RegisterResource(const ResourceMapping& aResource);
|
|
|
|
|
2010-03-11 05:33:00 +00:00
|
|
|
private:
|
|
|
|
struct PackageEntry
|
|
|
|
{
|
|
|
|
PackageEntry() : flags(0) { }
|
|
|
|
~PackageEntry() { }
|
|
|
|
|
|
|
|
nsCOMPtr<nsIURI> contentBaseURI;
|
|
|
|
nsCOMPtr<nsIURI> localeBaseURI;
|
|
|
|
nsCOMPtr<nsIURI> skinBaseURI;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t flags;
|
2010-03-11 05:33:00 +00:00
|
|
|
};
|
|
|
|
|
2012-07-06 18:15:45 +00:00
|
|
|
nsresult UpdateSelectedLocale() MOZ_OVERRIDE;
|
|
|
|
nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
|
|
|
|
const nsCString& aProvider,
|
|
|
|
const nsCString& aPath) MOZ_OVERRIDE;
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetFlagsFromPackage(const nsCString& aPackage, uint32_t* aFlags) MOZ_OVERRIDE;
|
2010-03-11 05:33:00 +00:00
|
|
|
|
|
|
|
nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
|
2011-01-11 21:34:31 +00:00
|
|
|
nsCString mLocale;
|
2010-07-01 15:55:57 +00:00
|
|
|
|
|
|
|
virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
|
|
|
|
char *const * argv, bool platform,
|
2015-01-08 15:16:15 +00:00
|
|
|
bool contentaccessible) MOZ_OVERRIDE;
|
2010-07-01 15:55:57 +00:00
|
|
|
virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
|
|
|
|
char *const * argv, bool platform,
|
2015-01-08 15:16:15 +00:00
|
|
|
bool contentaccessible) MOZ_OVERRIDE;
|
2010-07-01 15:55:57 +00:00
|
|
|
virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
|
|
|
|
char *const * argv, bool platform,
|
2015-01-08 15:16:15 +00:00
|
|
|
bool contentaccessible) MOZ_OVERRIDE;
|
2010-07-01 15:55:57 +00:00
|
|
|
virtual void ManifestOverlay(ManifestProcessingContext& cx, int lineno,
|
|
|
|
char *const * argv, bool platform,
|
2015-01-08 15:16:15 +00:00
|
|
|
bool contentaccessible) MOZ_OVERRIDE;
|
2010-07-01 15:55:57 +00:00
|
|
|
virtual void ManifestStyle(ManifestProcessingContext& cx, int lineno,
|
|
|
|
char *const * argv, bool platform,
|
2015-01-08 15:16:15 +00:00
|
|
|
bool contentaccessible) MOZ_OVERRIDE;
|
2010-07-01 15:55:57 +00:00
|
|
|
virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
|
|
|
|
char *const * argv, bool platform,
|
2015-01-08 15:16:15 +00:00
|
|
|
bool contentaccessible) MOZ_OVERRIDE;
|
2010-07-01 15:55:57 +00:00
|
|
|
virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
|
|
|
|
char *const * argv, bool platform,
|
2015-01-08 15:16:15 +00:00
|
|
|
bool contentaccessible) MOZ_OVERRIDE;
|
2010-03-11 05:33:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsChromeRegistryContent_h
|