InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CTUnicodeTranslator.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michiko Jessett
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 __CTUNICODETRANSLATOR__
25 #define __CTUNICODETRANSLATOR__
26 
27 #include "CTextEnum.h"
28 #include "BravoForwardDecl.h"
29 
30 class UnicodeTranslateFromTo;
31 
32 #ifdef MACINTOSH
33  // faking symbols not in Type1 fonts but used to be faked on the mac.
34 bool16 IsFakedOutSymbolUnicode(UTF32TextChar c);
35 bool16 IsFakedOutSymbolPlatform(char c);
36 #endif
37 
38 
43 {
44  public:
54  int32 CharToTextChar(const char* fromString, int32 fromStrLength, UTF16TextChar* toString, int32 toStrLength,
55  int32 writingscript = kDontKnowScript);
56 
66  int32 TextCharToChar(const UTF16TextChar* fromString, int32 fromStrCharCount, char* toString,
67  int32 toStrLength, int32 writingscript = kDontKnowScript);
68 
80  int32 TextCharToChar_Exact(const textchar* fromString, int32 fromStrCharCount, char* toString,
81  int32 toStrLength, bool16& stoppedFlag, int32& bytesTranslated, int32 writingscript = kDontKnowScript);
82 
83  static CTUnicodeTranslator* Instance();
84  static CTEncoding* GetUnicodeEncoding();
85  static void DeleteInstance();
86 
87  protected:
90  UnicodeTranslateFromTo* DetermineFontIndependentTranslator(int32 script);
91 
92 
93  private:
96 
97  int32 fToScript;
98  int32 fFromScript;
99 
100  // For GlyphIDToTextChar
101 
102  UnicodeTranslateFromTo* fFontIndependentNonRoman;
103  UnicodeTranslateFromTo* fFontIndependentRoman;
104 };
105 
106 
107 #endif