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 nsEditorSpellCheck_h___ michael@0: #define nsEditorSpellCheck_h___ michael@0: michael@0: michael@0: #include "nsCOMPtr.h" // for nsCOMPtr michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsIEditorSpellCheck.h" // for NS_DECL_NSIEDITORSPELLCHECK, etc michael@0: #include "nsISupportsImpl.h" michael@0: #include "nsString.h" // for nsString michael@0: #include "nsTArray.h" // for nsTArray michael@0: #include "nscore.h" // for nsresult michael@0: michael@0: class nsIEditor; michael@0: class nsISpellChecker; michael@0: class nsITextServicesFilter; michael@0: michael@0: #define NS_EDITORSPELLCHECK_CID \ michael@0: { /* {75656ad9-bd13-4c5d-939a-ec6351eea0cc} */ \ michael@0: 0x75656ad9, 0xbd13, 0x4c5d, \ michael@0: { 0x93, 0x9a, 0xec, 0x63, 0x51, 0xee, 0xa0, 0xcc }\ michael@0: } michael@0: michael@0: class DictionaryFetcher; michael@0: michael@0: class nsEditorSpellCheck : public nsIEditorSpellCheck michael@0: { michael@0: friend class DictionaryFetcher; michael@0: michael@0: public: michael@0: nsEditorSpellCheck(); michael@0: virtual ~nsEditorSpellCheck(); michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_CLASS(nsEditorSpellCheck) michael@0: michael@0: /* Declare all methods in the nsIEditorSpellCheck interface */ michael@0: NS_DECL_NSIEDITORSPELLCHECK michael@0: michael@0: protected: michael@0: nsCOMPtr mSpellChecker; michael@0: michael@0: nsTArray mSuggestedWordList; michael@0: int32_t mSuggestedWordIndex; michael@0: michael@0: // these are the words in the current personal dictionary, michael@0: // GetPersonalDictionary must be called to load them. michael@0: nsTArray mDictionaryList; michael@0: int32_t mDictionaryIndex; michael@0: michael@0: nsresult DeleteSuggestedWordList(); michael@0: michael@0: nsCOMPtr mTxtSrvFilter; michael@0: nsCOMPtr mEditor; michael@0: michael@0: nsString mPreferredLang; michael@0: michael@0: uint32_t mDictionaryFetcherGroup; michael@0: michael@0: bool mUpdateDictionaryRunning; michael@0: michael@0: nsresult DictionaryFetched(DictionaryFetcher* aFetchState); michael@0: michael@0: public: michael@0: void BeginUpdateDictionary() { mUpdateDictionaryRunning = true ;} michael@0: void EndUpdateDictionary() { mUpdateDictionaryRunning = false ;} michael@0: }; michael@0: michael@0: #endif // nsEditorSpellCheck_h___ michael@0: michael@0: