InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TxtExpUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __TxtExpUtils_H__
25 #define __TxtExpUtils_H__
26 
27 
28 // Interface includes
29 #include "ITxtExpFileWriter.h"
30 #include "IIntData.h"
31 
32 
33 
36 //extern IIntData* fEncoding;
37 
38 
39 // some useful macros
40 
41 #ifndef GETHIBYTE
42 #define GETHIBYTE(w) ((uchar)(((uint16)(w) >> 8) & 0xFF))
43 #endif
44 
45 #ifndef GETLOBYTE
46 #define GETLOBYTE(w) ((uchar)(w) & 0xFF)
47 #endif
48 
49 #ifndef MAKEBIGENDIANWORD
50 #define MAKEBIGENDIANWORD(hb, lb) ((uint16) ( ((uchar)(lb)) + ( ((uint16)((uchar)(hb))) << 8) ) )
51 #endif
52 
53 #ifndef SWAPWORD
54 #define SWAPWORD(s) MAKEBIGENDIANWORD(GETLOBYTE(s), GETHIBYTE(s))
55 #endif
56 
57 
66 {
67 public:
73 
81  static IIntData* GetEncodingIntData(bool16 bRelease = kFalse);
82 
83 
94  enum Modifier
95  {
96  None,
97  Dakuten,
98  Handakuten
99  };
100 
103  static const int32 kHankakuColumn;
104 
107  static const int32 kZenkakuColumn;
108 
111  static const int32 kNumKatakana;
112 
115  static const int32 kKatakanaNotFound;
116 
117 
127  static textchar HankakuToZenkaku(const textchar tc,
128  const TxtExpUtils::Modifier modifier = TxtExpUtils::None);
129 
140  static textchar ZenkakuToHankaku(const textchar tc,
141  TxtExpUtils::Modifier& modifier);
142 
143 private:
147  static const textchar k_fKatakanaLookup[][2];
148 
156  static int32 FindKatakanaIndex(const textchar uc, const int32 lookAtWhichColumn);
157 
158 };
159 #endif //#ifndef __TxtExpUtils_H__
160 
161