michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozPersonalDictionary_h__ michael@0: #define mozPersonalDictionary_h__ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: #include "mozIPersonalDictionary.h" michael@0: #include "nsIUnicodeEncoder.h" michael@0: #include "nsIObserver.h" michael@0: #include "nsWeakReference.h" michael@0: #include "nsTHashtable.h" michael@0: #include "nsCRT.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsHashKeys.h" michael@0: michael@0: #define MOZ_PERSONALDICTIONARY_CONTRACTID "@mozilla.org/spellchecker/personaldictionary;1" michael@0: #define MOZ_PERSONALDICTIONARY_CID \ michael@0: { /* 7EF52EAF-B7E1-462B-87E2-5D1DBACA9048 */ \ michael@0: 0X7EF52EAF, 0XB7E1, 0X462B, \ michael@0: { 0X87, 0XE2, 0X5D, 0X1D, 0XBA, 0XCA, 0X90, 0X48 } } michael@0: michael@0: class mozPersonalDictionary : public mozIPersonalDictionary, michael@0: public nsIObserver, michael@0: public nsSupportsWeakReference michael@0: { michael@0: public: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_MOZIPERSONALDICTIONARY michael@0: NS_DECL_NSIOBSERVER michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(mozPersonalDictionary, mozIPersonalDictionary) michael@0: michael@0: mozPersonalDictionary(); michael@0: virtual ~mozPersonalDictionary(); michael@0: michael@0: nsresult Init(); michael@0: michael@0: protected: michael@0: bool mDirty; /* has the dictionary been modified */ michael@0: nsTHashtable mDictionaryTable; michael@0: nsTHashtable mIgnoreTable; michael@0: nsCOMPtr mEncoder; /*Encoder to use to compare with spellchecker word */ michael@0: }; michael@0: michael@0: #endif