chrome/src/nsChromeRegistryContent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/chrome/src/nsChromeRegistryContent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,89 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsChromeRegistryContent_h
    1.10 +#define nsChromeRegistryContent_h
    1.11 +
    1.12 +#include "nsChromeRegistry.h"
    1.13 +#include "nsClassHashtable.h"
    1.14 +
    1.15 +struct ChromePackage;
    1.16 +struct ResourceMapping;
    1.17 +struct OverrideMapping;
    1.18 +
    1.19 +class nsChromeRegistryContent : public nsChromeRegistry
    1.20 +{
    1.21 + public:
    1.22 +  nsChromeRegistryContent();
    1.23 +  
    1.24 +  void RegisterRemoteChrome(const InfallibleTArray<ChromePackage>& aPackages,
    1.25 +                            const InfallibleTArray<ResourceMapping>& aResources,
    1.26 +                            const InfallibleTArray<OverrideMapping>& aOverrides,
    1.27 +                            const nsACString& aLocale);
    1.28 +
    1.29 +  NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
    1.30 +                                  nsIUTF8StringEnumerator* *aResult) MOZ_OVERRIDE;
    1.31 +  NS_IMETHOD CheckForNewChrome() MOZ_OVERRIDE;
    1.32 +  NS_IMETHOD CheckForOSAccessibility() MOZ_OVERRIDE;
    1.33 +  NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
    1.34 +                     const char16_t* aData) MOZ_OVERRIDE;
    1.35 +  NS_IMETHOD IsLocaleRTL(const nsACString& package,
    1.36 +                         bool *aResult) MOZ_OVERRIDE;
    1.37 +  NS_IMETHOD GetSelectedLocale(const nsACString& aPackage,
    1.38 +                               nsACString& aLocale) MOZ_OVERRIDE;
    1.39 +  NS_IMETHOD GetStyleOverlays(nsIURI *aChromeURL,
    1.40 +                              nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
    1.41 +  NS_IMETHOD GetXULOverlays(nsIURI *aChromeURL,
    1.42 +                            nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
    1.43 +
    1.44 + private:
    1.45 +  struct PackageEntry
    1.46 +  {
    1.47 +    PackageEntry() : flags(0) { }
    1.48 +    ~PackageEntry() { }
    1.49 +
    1.50 +    nsCOMPtr<nsIURI> contentBaseURI;
    1.51 +    nsCOMPtr<nsIURI> localeBaseURI;
    1.52 +    nsCOMPtr<nsIURI> skinBaseURI;
    1.53 +    uint32_t         flags;
    1.54 +  };
    1.55 +  
    1.56 +  void RegisterPackage(const ChromePackage& aPackage);
    1.57 +  void RegisterResource(const ResourceMapping& aResource);
    1.58 +  void RegisterOverride(const OverrideMapping& aOverride);
    1.59 +
    1.60 +  nsresult UpdateSelectedLocale() MOZ_OVERRIDE;
    1.61 +  nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
    1.62 +                     const nsCString& aProvider,
    1.63 +                     const nsCString& aPath) MOZ_OVERRIDE;
    1.64 +  nsresult GetFlagsFromPackage(const nsCString& aPackage, uint32_t* aFlags) MOZ_OVERRIDE;
    1.65 +
    1.66 +  nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
    1.67 +  nsCString mLocale;
    1.68 +
    1.69 +  virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
    1.70 +                               char *const * argv, bool platform,
    1.71 +                               bool contentaccessible);
    1.72 +  virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
    1.73 +                              char *const * argv, bool platform,
    1.74 +                              bool contentaccessible);
    1.75 +  virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
    1.76 +                            char *const * argv, bool platform,
    1.77 +                            bool contentaccessible);
    1.78 +  virtual void ManifestOverlay(ManifestProcessingContext& cx, int lineno,
    1.79 +                               char *const * argv, bool platform,
    1.80 +                               bool contentaccessible);
    1.81 +  virtual void ManifestStyle(ManifestProcessingContext& cx, int lineno,
    1.82 +                             char *const * argv, bool platform,
    1.83 +                             bool contentaccessible);
    1.84 +  virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
    1.85 +                                char *const * argv, bool platform,
    1.86 +                                bool contentaccessible);
    1.87 +  virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
    1.88 +                                char *const * argv, bool platform,
    1.89 +                                bool contentaccessible);
    1.90 +};
    1.91 +
    1.92 +#endif // nsChromeRegistryContent_h

mercurial