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 mozSpellChecker_h__ |
michael@0 | 7 | #define mozSpellChecker_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsCOMPtr.h" |
michael@0 | 10 | #include "nsCOMArray.h" |
michael@0 | 11 | #include "nsISpellChecker.h" |
michael@0 | 12 | #include "nsString.h" |
michael@0 | 13 | #include "nsITextServicesDocument.h" |
michael@0 | 14 | #include "mozIPersonalDictionary.h" |
michael@0 | 15 | #include "mozISpellCheckingEngine.h" |
michael@0 | 16 | #include "nsClassHashtable.h" |
michael@0 | 17 | #include "nsTArray.h" |
michael@0 | 18 | #include "mozISpellI18NUtil.h" |
michael@0 | 19 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 20 | |
michael@0 | 21 | class mozSpellChecker : public nsISpellChecker |
michael@0 | 22 | { |
michael@0 | 23 | public: |
michael@0 | 24 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 25 | NS_DECL_CYCLE_COLLECTION_CLASS(mozSpellChecker) |
michael@0 | 26 | |
michael@0 | 27 | mozSpellChecker(); |
michael@0 | 28 | virtual ~mozSpellChecker(); |
michael@0 | 29 | |
michael@0 | 30 | nsresult Init(); |
michael@0 | 31 | |
michael@0 | 32 | // nsISpellChecker |
michael@0 | 33 | NS_IMETHOD SetDocument(nsITextServicesDocument *aDoc, bool aFromStartofDoc); |
michael@0 | 34 | NS_IMETHOD NextMisspelledWord(nsAString &aWord, nsTArray<nsString> *aSuggestions); |
michael@0 | 35 | NS_IMETHOD CheckWord(const nsAString &aWord, bool *aIsMisspelled, nsTArray<nsString> *aSuggestions); |
michael@0 | 36 | NS_IMETHOD Replace(const nsAString &aOldWord, const nsAString &aNewWord, bool aAllOccurrences); |
michael@0 | 37 | NS_IMETHOD IgnoreAll(const nsAString &aWord); |
michael@0 | 38 | |
michael@0 | 39 | NS_IMETHOD AddWordToPersonalDictionary(const nsAString &aWord); |
michael@0 | 40 | NS_IMETHOD RemoveWordFromPersonalDictionary(const nsAString &aWord); |
michael@0 | 41 | NS_IMETHOD GetPersonalDictionary(nsTArray<nsString> *aWordList); |
michael@0 | 42 | |
michael@0 | 43 | NS_IMETHOD GetDictionaryList(nsTArray<nsString> *aDictionaryList); |
michael@0 | 44 | NS_IMETHOD GetCurrentDictionary(nsAString &aDictionary); |
michael@0 | 45 | NS_IMETHOD SetCurrentDictionary(const nsAString &aDictionary); |
michael@0 | 46 | NS_IMETHOD CheckCurrentDictionary(); |
michael@0 | 47 | |
michael@0 | 48 | protected: |
michael@0 | 49 | nsCOMPtr<mozISpellI18NUtil> mConverter; |
michael@0 | 50 | nsCOMPtr<nsITextServicesDocument> mTsDoc; |
michael@0 | 51 | nsCOMPtr<mozIPersonalDictionary> mPersonalDictionary; |
michael@0 | 52 | |
michael@0 | 53 | nsCOMPtr<mozISpellCheckingEngine> mSpellCheckingEngine; |
michael@0 | 54 | bool mFromStart; |
michael@0 | 55 | |
michael@0 | 56 | nsresult SetupDoc(int32_t *outBlockOffset); |
michael@0 | 57 | |
michael@0 | 58 | nsresult GetCurrentBlockIndex(nsITextServicesDocument *aDoc, int32_t *outBlockIndex); |
michael@0 | 59 | |
michael@0 | 60 | nsresult GetEngineList(nsCOMArray<mozISpellCheckingEngine> *aDictionaryList); |
michael@0 | 61 | }; |
michael@0 | 62 | #endif // mozSpellChecker_h__ |