|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef mozEnglishWordUtils_h__ |
|
7 #define mozEnglishWordUtils_h__ |
|
8 |
|
9 #include "nsCOMPtr.h" |
|
10 #include "mozISpellI18NUtil.h" |
|
11 #include "nsIUnicodeEncoder.h" |
|
12 #include "nsIUnicodeDecoder.h" |
|
13 #include "nsString.h" |
|
14 |
|
15 #include "mozITXTToHTMLConv.h" |
|
16 #include "nsCycleCollectionParticipant.h" |
|
17 |
|
18 class mozEnglishWordUtils : public mozISpellI18NUtil |
|
19 { |
|
20 public: |
|
21 NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
|
22 NS_DECL_MOZISPELLI18NUTIL |
|
23 NS_DECL_CYCLE_COLLECTION_CLASS(mozEnglishWordUtils) |
|
24 |
|
25 mozEnglishWordUtils(); |
|
26 virtual ~mozEnglishWordUtils(); |
|
27 /* additional members */ |
|
28 enum myspCapitalization{ |
|
29 NoCap,InitCap,AllCap,HuhCap |
|
30 }; |
|
31 |
|
32 protected: |
|
33 mozEnglishWordUtils::myspCapitalization captype(const nsString &word); |
|
34 bool ucIsAlpha(char16_t aChar); |
|
35 |
|
36 nsString mLanguage; |
|
37 nsString mCharset; |
|
38 nsCOMPtr<mozITXTToHTMLConv> mURLDetector; // used to detect urls so the spell checker can skip them. |
|
39 }; |
|
40 |
|
41 #endif |