2002-10-12 03:46:57 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2002-10-12 03:46:57 +04:00
|
|
|
|
|
|
|
#ifndef nsEditorSpellCheck_h___
|
|
|
|
#define nsEditorSpellCheck_h___
|
|
|
|
|
|
|
|
|
2012-07-13 10:33:42 +04:00
|
|
|
#include "nsCOMPtr.h" // for nsCOMPtr
|
2010-06-02 22:33:47 +04:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2012-07-13 10:33:42 +04:00
|
|
|
#include "nsIEditorSpellCheck.h" // for NS_DECL_NSIEDITORSPELLCHECK, etc
|
|
|
|
#include "nsISupportsImpl.h"
|
|
|
|
#include "nsString.h" // for nsString
|
|
|
|
#include "nsTArray.h" // for nsTArray
|
|
|
|
#include "nscore.h" // for nsresult
|
|
|
|
|
|
|
|
class nsIEditor;
|
|
|
|
class nsISpellChecker;
|
|
|
|
class nsITextServicesFilter;
|
2002-10-12 03:46:57 +04:00
|
|
|
|
|
|
|
#define NS_EDITORSPELLCHECK_CID \
|
|
|
|
{ /* {75656ad9-bd13-4c5d-939a-ec6351eea0cc} */ \
|
|
|
|
0x75656ad9, 0xbd13, 0x4c5d, \
|
|
|
|
{ 0x93, 0x9a, 0xec, 0x63, 0x51, 0xee, 0xa0, 0xcc }\
|
|
|
|
}
|
|
|
|
|
2013-06-06 04:07:54 +04:00
|
|
|
class DictionaryFetcher;
|
2011-08-23 23:03:33 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsEditorSpellCheck final : public nsIEditorSpellCheck
|
2002-10-12 03:46:57 +04:00
|
|
|
{
|
2013-06-06 04:07:54 +04:00
|
|
|
friend class DictionaryFetcher;
|
|
|
|
|
2002-10-12 03:46:57 +04:00
|
|
|
public:
|
|
|
|
nsEditorSpellCheck();
|
|
|
|
|
2010-06-02 22:33:47 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS(nsEditorSpellCheck)
|
2002-10-12 03:46:57 +04:00
|
|
|
|
|
|
|
/* Declare all methods in the nsIEditorSpellCheck interface */
|
|
|
|
NS_DECL_NSIEDITORSPELLCHECK
|
|
|
|
|
|
|
|
protected:
|
2014-06-24 02:40:02 +04:00
|
|
|
virtual ~nsEditorSpellCheck();
|
|
|
|
|
2002-10-12 03:46:57 +04:00
|
|
|
nsCOMPtr<nsISpellChecker> mSpellChecker;
|
|
|
|
|
2009-01-18 23:14:14 +03:00
|
|
|
nsTArray<nsString> mSuggestedWordList;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mSuggestedWordIndex;
|
2002-10-12 03:46:57 +04:00
|
|
|
|
2005-12-05 21:07:33 +03:00
|
|
|
// these are the words in the current personal dictionary,
|
|
|
|
// GetPersonalDictionary must be called to load them.
|
2009-01-18 23:14:14 +03:00
|
|
|
nsTArray<nsString> mDictionaryList;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mDictionaryIndex;
|
2002-10-12 03:46:57 +04:00
|
|
|
|
|
|
|
nsresult DeleteSuggestedWordList();
|
2002-12-10 18:03:04 +03:00
|
|
|
|
|
|
|
nsCOMPtr<nsITextServicesFilter> mTxtSrvFilter;
|
2011-08-23 23:03:33 +04:00
|
|
|
nsCOMPtr<nsIEditor> mEditor;
|
|
|
|
|
|
|
|
nsString mPreferredLang;
|
2011-08-15 21:54:03 +04:00
|
|
|
|
2013-06-06 04:07:54 +04:00
|
|
|
uint32_t mDictionaryFetcherGroup;
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mUpdateDictionaryRunning;
|
2011-08-15 21:54:03 +04:00
|
|
|
|
2013-06-06 04:07:54 +04:00
|
|
|
nsresult DictionaryFetched(DictionaryFetcher* aFetchState);
|
|
|
|
|
2011-08-15 21:54:03 +04:00
|
|
|
public:
|
2011-10-17 18:59:28 +04:00
|
|
|
void BeginUpdateDictionary() { mUpdateDictionaryRunning = true ;}
|
|
|
|
void EndUpdateDictionary() { mUpdateDictionaryRunning = false ;}
|
2002-10-12 03:46:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsEditorSpellCheck_h___
|
|
|
|
|
|
|
|
|