2013-03-01 05:41:30 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
2011-05-04 04:29:45 -07:00
|
|
|
|
|
|
|
#ifndef nsHyphenationManager_h__
|
|
|
|
#define nsHyphenationManager_h__
|
|
|
|
|
|
|
|
#include "nsInterfaceHashtable.h"
|
|
|
|
#include "nsRefPtrHashtable.h"
|
|
|
|
#include "nsHashKeys.h"
|
2013-03-01 05:40:10 -08:00
|
|
|
#include "nsIObserver.h"
|
2011-10-06 08:06:36 -07:00
|
|
|
#include "mozilla/Omnijar.h"
|
2011-05-04 04:29:45 -07:00
|
|
|
|
|
|
|
class nsHyphenator;
|
|
|
|
class nsIAtom;
|
2011-10-06 08:06:32 -07:00
|
|
|
class nsIURI;
|
2011-05-04 04:29:45 -07:00
|
|
|
|
|
|
|
class nsHyphenationManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsHyphenationManager();
|
|
|
|
|
|
|
|
already_AddRefed<nsHyphenator> GetHyphenator(nsIAtom *aLocale);
|
|
|
|
|
|
|
|
static nsHyphenationManager *Instance();
|
|
|
|
|
|
|
|
static void Shutdown();
|
|
|
|
|
|
|
|
private:
|
|
|
|
~nsHyphenationManager();
|
|
|
|
|
|
|
|
protected:
|
2013-03-01 05:40:10 -08:00
|
|
|
class MemoryPressureObserver MOZ_FINAL : public nsIObserver
|
|
|
|
{
|
2014-06-23 15:40:02 -07:00
|
|
|
~MemoryPressureObserver() {}
|
|
|
|
|
2013-03-01 05:40:10 -08:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
};
|
|
|
|
|
2011-05-04 04:29:45 -07:00
|
|
|
void LoadPatternList();
|
2011-10-06 08:06:36 -07:00
|
|
|
void LoadPatternListFromOmnijar(mozilla::Omnijar::Type aType);
|
2011-05-04 04:29:45 -07:00
|
|
|
void LoadPatternListFromDir(nsIFile *aDir);
|
|
|
|
void LoadAliases();
|
|
|
|
|
|
|
|
nsInterfaceHashtable<nsISupportsHashKey,nsIAtom> mHyphAliases;
|
2011-10-06 08:06:32 -07:00
|
|
|
nsInterfaceHashtable<nsISupportsHashKey,nsIURI> mPatternFiles;
|
2011-05-04 04:29:45 -07:00
|
|
|
nsRefPtrHashtable<nsISupportsHashKey,nsHyphenator> mHyphenators;
|
|
|
|
|
|
|
|
static nsHyphenationManager *sInstance;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsHyphenationManager_h__
|