Backed out 2 changesets (bug 903746) for causing non-unified build bustages on nsIPri...
[gecko.git] / intl / hyphenation / glue / nsHyphenationManager.h
blob5b1d0f9adbbb2d29d3c9ddd34d668be257e9cdee
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 nsHyphenationManager_h__
7 #define nsHyphenationManager_h__
9 #include "base/shared_memory.h"
10 #include "mozilla/Omnijar.h"
11 #include "nsHashKeys.h"
12 #include "nsAtomHashKeys.h"
13 #include "nsInterfaceHashtable.h"
14 #include "nsIObserver.h"
15 #include "nsRefPtrHashtable.h"
16 class nsHyphenator;
17 class nsAtom;
18 class nsIURI;
20 class nsHyphenationManager : public nsIObserver {
21 public:
22 NS_DECL_ISUPPORTS
23 NS_DECL_NSIOBSERVER
25 nsHyphenationManager();
27 already_AddRefed<nsHyphenator> GetHyphenator(nsAtom* aLocale);
29 void ShareHyphDictToProcess(nsIURI* aURI, base::ProcessId aPid,
30 base::SharedMemoryHandle* aOutHandle,
31 uint32_t* aOutSize);
33 static nsHyphenationManager* Instance();
35 static void Shutdown();
37 size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
39 private:
40 virtual ~nsHyphenationManager();
42 protected:
43 void LoadPatternList();
44 void LoadPatternListFromOmnijar(mozilla::Omnijar::Type aType);
45 void LoadPatternListFromDir(nsIFile* aDir);
46 void LoadAliases();
48 nsRefPtrHashtable<nsAtomHashKey, nsAtom> mHyphAliases;
49 nsInterfaceHashtable<nsAtomHashKey, nsIURI> mPatternFiles;
50 nsRefPtrHashtable<nsAtomHashKey, nsHyphenator> mHyphenators;
52 static nsHyphenationManager* sInstance;
55 #endif // nsHyphenationManager_h__