intl/unicharutil/public/nsIUGenCategory.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/unicharutil/public/nsIUGenCategory.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +#ifndef nsIUGenCategory_h__
     1.9 +#define nsIUGenCategory_h__
    1.10 +
    1.11 +
    1.12 +#include "nsISupports.h"
    1.13 +#include "nscore.h"
    1.14 +
    1.15 +// {671fea05-fcee-4b1c-82a3-6eb03eda8ddc}
    1.16 +#define NS_IUGENCATEGORY_IID \
    1.17 +{ 0x671fea05, 0xfcee, 0x4b1c, \
    1.18 +    { 0x82, 0xa3, 0x6e, 0xb0, 0x3e, 0xda, 0x8d, 0xdc } }
    1.19 +
    1.20 +
    1.21 +class nsIUGenCategory : public nsISupports {
    1.22 +
    1.23 +public: 
    1.24 +
    1.25 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUGENCATEGORY_IID)
    1.26 +
    1.27 +   /**
    1.28 +    *  Read http://unicode.org/reports/tr44/#General_Category_Values
    1.29 +    *  for the detailed definition of the following categories
    1.30 +    */
    1.31 +   typedef enum {
    1.32 +     kUndefined    = 0,
    1.33 +     kMark         = 1, // Mn, Mc, and Me
    1.34 +     kNumber       = 2, // Nd, Nl, and No 
    1.35 +     kSeparator    = 3, // Zs, Zl, and Zp
    1.36 +     kOther        = 4, // Cc, Cf, Cs, Co, and Cn
    1.37 +     kLetter       = 5, // Lu, Ll, Lt, Lm, and Lo
    1.38 +     kPunctuation  = 6, // Pc, Pd, Ps, Pe, Pi, Pf, and Po
    1.39 +     kSymbol       = 7  // Sm, Sc, Sk, and So
    1.40 +   } nsUGenCategory;
    1.41 +
    1.42 +   /**
    1.43 +    * Give a Unichar, return a nsUGenCategory
    1.44 +    */
    1.45 +   virtual nsUGenCategory Get(uint32_t aChar) = 0;
    1.46 +};
    1.47 +
    1.48 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIUGenCategory, NS_IUGENCATEGORY_IID)
    1.49 +
    1.50 +#endif  /* nsIUGenCategory_h__ */

mercurial