intl/unicharutil/public/nsIUGenCategory.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:35bf307714b3
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 #ifndef nsIUGenCategory_h__
6 #define nsIUGenCategory_h__
7
8
9 #include "nsISupports.h"
10 #include "nscore.h"
11
12 // {671fea05-fcee-4b1c-82a3-6eb03eda8ddc}
13 #define NS_IUGENCATEGORY_IID \
14 { 0x671fea05, 0xfcee, 0x4b1c, \
15 { 0x82, 0xa3, 0x6e, 0xb0, 0x3e, 0xda, 0x8d, 0xdc } }
16
17
18 class nsIUGenCategory : public nsISupports {
19
20 public:
21
22 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUGENCATEGORY_IID)
23
24 /**
25 * Read http://unicode.org/reports/tr44/#General_Category_Values
26 * for the detailed definition of the following categories
27 */
28 typedef enum {
29 kUndefined = 0,
30 kMark = 1, // Mn, Mc, and Me
31 kNumber = 2, // Nd, Nl, and No
32 kSeparator = 3, // Zs, Zl, and Zp
33 kOther = 4, // Cc, Cf, Cs, Co, and Cn
34 kLetter = 5, // Lu, Ll, Lt, Lm, and Lo
35 kPunctuation = 6, // Pc, Pd, Ps, Pe, Pi, Pf, and Po
36 kSymbol = 7 // Sm, Sc, Sk, and So
37 } nsUGenCategory;
38
39 /**
40 * Give a Unichar, return a nsUGenCategory
41 */
42 virtual nsUGenCategory Get(uint32_t aChar) = 0;
43 };
44
45 NS_DEFINE_STATIC_IID_ACCESSOR(nsIUGenCategory, NS_IUGENCATEGORY_IID)
46
47 #endif /* nsIUGenCategory_h__ */

mercurial