Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / intl / strres / nsStringBundleService.h
bloba192cdff8ca8a1543bdf6952b02ff67086e0af93
1 /* -*- Mode: C++; tab-width: 2; 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 nsStringBundleService_h__
7 #define nsStringBundleService_h__
9 #include "nsCOMPtr.h"
10 #include "nsDataHashtable.h"
11 #include "nsHashKeys.h"
12 #include "nsIPersistentProperties2.h"
13 #include "nsIStringBundle.h"
14 #include "nsIObserver.h"
15 #include "nsWeakReference.h"
16 #include "nsIErrorService.h"
17 #include "nsIStringBundleOverride.h"
19 #include "mozilla/LinkedList.h"
21 struct bundleCacheEntry_t;
23 class nsStringBundleService : public nsIStringBundleService,
24 public nsIObserver,
25 public nsSupportsWeakReference
27 public:
28 nsStringBundleService();
30 nsresult Init();
32 NS_DECL_ISUPPORTS
33 NS_DECL_NSISTRINGBUNDLESERVICE
34 NS_DECL_NSIOBSERVER
36 private:
37 virtual ~nsStringBundleService();
39 nsresult getStringBundle(const char *aUrl, nsIStringBundle** aResult);
40 nsresult FormatWithBundle(nsIStringBundle* bundle, nsresult aStatus,
41 uint32_t argCount, char16_t** argArray,
42 char16_t* *result);
44 void flushBundleCache();
46 bundleCacheEntry_t *insertIntoCache(already_AddRefed<nsIStringBundle> aBundle,
47 nsCString &aHashKey);
49 nsDataHashtable<nsCStringHashKey, bundleCacheEntry_t*> mBundleMap;
50 mozilla::LinkedList<bundleCacheEntry_t> mBundleCache;
52 nsCOMPtr<nsIErrorService> mErrorService;
53 nsCOMPtr<nsIStringBundleOverride> mOverrideStrings;
56 #endif