1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
37 #ifndef nsIUGenDetailCategory_h__
38 #define nsIUGenDetailCategory_h__
41 #include "nsISupports.h"
44 // {E86B3372-BF89-11d2-B3AF-00805F8A6670}
45 #define NS_IUGENDETAILCATEGORY_IID \
46 { 0xe86b3372, 0xbf89, 0x11d2, \
47 { 0xb3, 0xaf, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } };
51 class nsIUGenDetailCategory
: public nsISupports
{
55 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUGENDETAILCATEGORY_IID
)
58 * Read ftp://ftp.unicode.org/Public/UNIDATA/ReadMe-Latest.txt
59 * section GENERAL CATEGORY
60 * for the detail defintation of the following categories
64 kUGDC_M
= (kUGenCategory_Mark
<< 4) | 0, // Mark- return only when kUGDC_DetailMark bit is clear
65 kUGDC_Mn
= (kUGenCategory_Mark
<< 4) | 1, // Mark, Non-Spacing - return only when kUGDC_DetailMark bit is set
66 kUGDC_Mc
= (kUGenCategory_Mark
<< 4) | 2, // Mark, Spacing Combining - return only when kUGDC_DetailMark bit is set
67 kUGDC_Me
= (kUGenCategory_Mark
<< 4) | 3, // Mark, Enclosing - return only when kUGDC_DetailMark bit is set
69 kUGDC_N
= (kUGenCategory_Number
<< 4) | 0, // Number- return only when kUGDC_DetailNumber bit is clear
70 kUGDC_Nd
= (kUGenCategory_Number
<< 4) | 1, // Number, Decimal Digit - return only when kUGDC_DetailNumber bit is set
71 kUGDC_Nl
= (kUGenCategory_Number
<< 4) | 2, // Number, Letter - return only when kUGDC_DetailNumber bit is set
72 kUGDC_No
= (kUGenCategory_Number
<< 4) | 3, // Number, Other - return only when kUGDC_DetailNumber bit is set
74 kUGDC_Z
= (kUGenCategory_Separator
<< 4) | 0, // Separator- return only when kUGDC_DetailSeparator bit is clear
75 kUGDC_Zs
= (kUGenCategory_Separator
<< 4) | 1, // Separator, Space - return only when kUGDC_DetailSeparator bit is set
76 kUGDC_Zl
= (kUGenCategory_Separator
<< 4) | 2, // Separator, Line - return only when kUGDC_DetailSeparator bit is set
77 kUGDC_Zp
= (kUGenCategory_Separator
<< 4) | 3, // Separator, Paragraph - return only when kUGDC_DetailSeparator bit is set
79 kUGDC_C
= (kUGenCategory_Other
<< 4) | 0, // Other- return only when kUGDC_DetailOther bit is clear
80 kUGDC_Cc
= (kUGenCategory_Other
<< 4) | 1, // Other, Control - return only when kUGDC_DetailOther bit is set
81 kUGDC_Cf
= (kUGenCategory_Other
<< 4) | 2, // Other, Format - return only when kUGDC_DetailOther bit is set
82 kUGDC_Cs
= (kUGenCategory_Other
<< 4) | 3, // Other, Surrogate - return only when kUGDC_DetailOther bit is set
83 kUGDC_Co
= (kUGenCategory_Other
<< 4) | 4, // Other, Private Use - return only when kUGDC_DetailOther bit is set
84 kUGDC_Cn
= (kUGenCategory_Other
<< 4) | 5, // Other, Not Assigned - return only when kUGDC_DetailOther bit is set
86 kUGDC_L
= (kUGenCategory_Letter
<< 4) | 0, // Letter- return only when kUGDC_DetailLetter bit is clear
87 kUGDC_Lu
= (kUGenCategory_Letter
<< 4) | 1, // Letter, Uppercase - return only when kUGDC_DetailLetter bit is set
88 kUGDC_Ll
= (kUGenCategory_Letter
<< 4) | 2, // Letter, Lowercase - return only when kUGDC_DetailLetter bit is set
89 kUGDC_Lt
= (kUGenCategory_Letter
<< 4) | 3, // Letter, Titlecase - return only when kUGDC_DetailLetter bit is set
90 kUGDC_Lm
= (kUGenCategory_Letter
<< 4) | 4, // Letter, Modifier - return only when kUGDC_DetailLetter bit is set
91 kUGDC_Lo
= (kUGenCategory_Letter
<< 4) | 5, // Letter, Other - return only when kUGDC_DetailLetter bit is set
93 kUGDC_P
= (kUGenCategory_Punctuation
<< 4) | 0, // Punctuation- return only when kUGDC_DetailPunctuation bit is clear
94 kUGDC_Pc
= (kUGenCategory_Punctuation
<< 4) | 1, // Punctuation, Connector - return only when kUGDC_DetailPunctuation bit is set
95 kUGDC_Pd
= (kUGenCategory_Punctuation
<< 4) | 2, // Punctuation, Dash - return only when kUGDC_DetailPunctuation bit is set
96 kUGDC_Ps
= (kUGenCategory_Punctuation
<< 4) | 3, // Punctuation, Open - return only when kUGDC_DetailPunctuation bit is set
97 kUGDC_Pe
= (kUGenCategory_Punctuation
<< 4) | 4, // Punctuation, Close - return only when kUGDC_DetailPunctuation bit is set
98 kUGDC_Pi
= (kUGenCategory_Punctuation
<< 4) | 5, // Punctuation, Initial quote - return only when kUGDC_DetailPunctuation bit is set
99 kUGDC_Pf
= (kUGenCategory_Punctuation
<< 4) | 6, // Punctuation, Final quote - return only when kUGDC_DetailPunctuation bit is set
100 kUGDC_Po
= (kUGenCategory_Punctuation
<< 4) | 7, // Punctuation, Other - return only when kUGDC_DetailPunctuation bit is set
102 kUGDC_S
= (kUGenCategory_Symbol
<< 4) | 0, // Symbol- return only when kUGDC_DetailSymbol bit is clear
103 kUGDC_Sm
= (kUGenCategory_Symbol
<< 4) | 1, // Symbol, Math - return only when kUGDC_DetailSymbol bit is set
104 kUGDC_Sc
= (kUGenCategory_Symbol
<< 4) | 2, // Symbol, Currency - return only when kUGDC_DetailSymbol bit is set
105 kUGDC_Sk
= (kUGenCategory_Symbol
<< 4) | 3, // Symbol, Modifier - return only when kUGDC_DetailSymbol bit is set
106 kUGDC_So
= (kUGenCategory_Symbol
<< 4) | 4, // Symbol, Other - return only when kUGDC_DetailSymbol bit is set
110 * Sometimes, we want the Get method only return detail in certain
111 * area. It help to ignore unnecessary detail to improve performance
114 kUGDC_DetailNone
= 0,
115 kUGDC_DetailMark
= ( 1 << 0),
116 kUGDC_DetailNumber
= ( 1 << 1),
117 kUGDC_DetailSeparator
= ( 1 << 2),
118 kUGDC_DetailOther
= ( 1 << 3),
119 kUGDC_DetailLetter
= ( 1 << 4),
120 kUGDC_DetailPunctuation
= ( 1 << 5),
121 kUGDC_DetailSymbol
= ( 1 << 6),
122 kUGDC_DetailNormative
= ( kUGDC_DetailMark
|
124 kUGDC_DetailSeparator
|
126 kUGDC_DetailInformative
= ( kUGDC_DetailLetter
|
127 kUGDC_DetailPunctuation
|
129 kUGDC_DetailAll
= ( kUGDC_DetailNormative
| kUGDC_Informative
);
133 * Give a Unichar, return a nsUGDC
135 NS_IMETHOD
Get( PRUnichar aChar
, nsUGDC_Detail aDetailSpec
, nsUGDC
* oResult
) = 0 ;
138 * Give a Unichar, and a nsUGenDetailCategory,
139 * return PR_TRUE if the Unichar is in that category,
140 * return PR_FALSE, otherwise
142 NS_IMETHOD
Is( PRUnichar aChar
, nsUGDC aDetailCategory
, PRBool
* oResult
) = 0;
145 NS_DEFINE_STATIC_IID_ACCESSOR(nsIUGenDetailCategory
,
146 NS_IUGENDETAILCATEGORY_IID
)
148 #endif /* nsIUGenDetailCategory_h__ */