1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/hyphenation/public/nsHyphenationManager.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; 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 nsHyphenationManager_h__ 1.10 +#define nsHyphenationManager_h__ 1.11 + 1.12 +#include "nsInterfaceHashtable.h" 1.13 +#include "nsRefPtrHashtable.h" 1.14 +#include "nsHashKeys.h" 1.15 +#include "nsIObserver.h" 1.16 +#include "mozilla/Omnijar.h" 1.17 + 1.18 +class nsHyphenator; 1.19 +class nsIAtom; 1.20 +class nsIURI; 1.21 + 1.22 +class nsHyphenationManager 1.23 +{ 1.24 +public: 1.25 + nsHyphenationManager(); 1.26 + 1.27 + already_AddRefed<nsHyphenator> GetHyphenator(nsIAtom *aLocale); 1.28 + 1.29 + static nsHyphenationManager *Instance(); 1.30 + 1.31 + static void Shutdown(); 1.32 + 1.33 +private: 1.34 + ~nsHyphenationManager(); 1.35 + 1.36 +protected: 1.37 + class MemoryPressureObserver MOZ_FINAL : public nsIObserver 1.38 + { 1.39 + public: 1.40 + NS_DECL_ISUPPORTS 1.41 + NS_DECL_NSIOBSERVER 1.42 + }; 1.43 + 1.44 + void LoadPatternList(); 1.45 + void LoadPatternListFromOmnijar(mozilla::Omnijar::Type aType); 1.46 + void LoadPatternListFromDir(nsIFile *aDir); 1.47 + void LoadAliases(); 1.48 + 1.49 + nsInterfaceHashtable<nsISupportsHashKey,nsIAtom> mHyphAliases; 1.50 + nsInterfaceHashtable<nsISupportsHashKey,nsIURI> mPatternFiles; 1.51 + nsRefPtrHashtable<nsISupportsHashKey,nsHyphenator> mHyphenators; 1.52 + 1.53 + static nsHyphenationManager *sInstance; 1.54 +}; 1.55 + 1.56 +#endif // nsHyphenationManager_h__