Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsEditorSpellCheck_h___ |
michael@0 | 7 | #define nsEditorSpellCheck_h___ |
michael@0 | 8 | |
michael@0 | 9 | |
michael@0 | 10 | #include "nsCOMPtr.h" // for nsCOMPtr |
michael@0 | 11 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 12 | #include "nsIEditorSpellCheck.h" // for NS_DECL_NSIEDITORSPELLCHECK, etc |
michael@0 | 13 | #include "nsISupportsImpl.h" |
michael@0 | 14 | #include "nsString.h" // for nsString |
michael@0 | 15 | #include "nsTArray.h" // for nsTArray |
michael@0 | 16 | #include "nscore.h" // for nsresult |
michael@0 | 17 | |
michael@0 | 18 | class nsIEditor; |
michael@0 | 19 | class nsISpellChecker; |
michael@0 | 20 | class nsITextServicesFilter; |
michael@0 | 21 | |
michael@0 | 22 | #define NS_EDITORSPELLCHECK_CID \ |
michael@0 | 23 | { /* {75656ad9-bd13-4c5d-939a-ec6351eea0cc} */ \ |
michael@0 | 24 | 0x75656ad9, 0xbd13, 0x4c5d, \ |
michael@0 | 25 | { 0x93, 0x9a, 0xec, 0x63, 0x51, 0xee, 0xa0, 0xcc }\ |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | class DictionaryFetcher; |
michael@0 | 29 | |
michael@0 | 30 | class nsEditorSpellCheck : public nsIEditorSpellCheck |
michael@0 | 31 | { |
michael@0 | 32 | friend class DictionaryFetcher; |
michael@0 | 33 | |
michael@0 | 34 | public: |
michael@0 | 35 | nsEditorSpellCheck(); |
michael@0 | 36 | virtual ~nsEditorSpellCheck(); |
michael@0 | 37 | |
michael@0 | 38 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 39 | NS_DECL_CYCLE_COLLECTION_CLASS(nsEditorSpellCheck) |
michael@0 | 40 | |
michael@0 | 41 | /* Declare all methods in the nsIEditorSpellCheck interface */ |
michael@0 | 42 | NS_DECL_NSIEDITORSPELLCHECK |
michael@0 | 43 | |
michael@0 | 44 | protected: |
michael@0 | 45 | nsCOMPtr<nsISpellChecker> mSpellChecker; |
michael@0 | 46 | |
michael@0 | 47 | nsTArray<nsString> mSuggestedWordList; |
michael@0 | 48 | int32_t mSuggestedWordIndex; |
michael@0 | 49 | |
michael@0 | 50 | // these are the words in the current personal dictionary, |
michael@0 | 51 | // GetPersonalDictionary must be called to load them. |
michael@0 | 52 | nsTArray<nsString> mDictionaryList; |
michael@0 | 53 | int32_t mDictionaryIndex; |
michael@0 | 54 | |
michael@0 | 55 | nsresult DeleteSuggestedWordList(); |
michael@0 | 56 | |
michael@0 | 57 | nsCOMPtr<nsITextServicesFilter> mTxtSrvFilter; |
michael@0 | 58 | nsCOMPtr<nsIEditor> mEditor; |
michael@0 | 59 | |
michael@0 | 60 | nsString mPreferredLang; |
michael@0 | 61 | |
michael@0 | 62 | uint32_t mDictionaryFetcherGroup; |
michael@0 | 63 | |
michael@0 | 64 | bool mUpdateDictionaryRunning; |
michael@0 | 65 | |
michael@0 | 66 | nsresult DictionaryFetched(DictionaryFetcher* aFetchState); |
michael@0 | 67 | |
michael@0 | 68 | public: |
michael@0 | 69 | void BeginUpdateDictionary() { mUpdateDictionaryRunning = true ;} |
michael@0 | 70 | void EndUpdateDictionary() { mUpdateDictionaryRunning = false ;} |
michael@0 | 71 | }; |
michael@0 | 72 | |
michael@0 | 73 | #endif // nsEditorSpellCheck_h___ |
michael@0 | 74 | |
michael@0 | 75 |