My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textcvt.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org. If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 
29 #ifndef _RTL_TEXTCVT_H
30 #define _RTL_TEXTCVT_H
31 
32 #ifndef _SAL_TYPES_H
33 #include <sal/types.h>
34 #endif
35 #include <rtl/textenc.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /* Documentation about this file can be found at
42  <http://udk.openoffice.org/cpp/man/spec/textconversion.html>. */
43 
47 
51 
54 SAL_DLLPUBLIC rtl_TextToUnicodeConverter SAL_CALL rtl_createTextToUnicodeConverter( rtl_TextEncoding eTextEncoding );
55 
58 SAL_DLLPUBLIC void SAL_CALL rtl_destroyTextToUnicodeConverter( rtl_TextToUnicodeConverter hConverter );
59 
62 SAL_DLLPUBLIC rtl_TextToUnicodeContext SAL_CALL rtl_createTextToUnicodeContext( rtl_TextToUnicodeConverter hConverter );
63 
66 SAL_DLLPUBLIC void SAL_CALL rtl_destroyTextToUnicodeContext( rtl_TextToUnicodeConverter hConverter, rtl_TextToUnicodeContext hContext );
67 
70 SAL_DLLPUBLIC void SAL_CALL rtl_resetTextToUnicodeContext( rtl_TextToUnicodeConverter hConverter, rtl_TextToUnicodeContext hContext );
71 
72 #define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR ((sal_uInt32)0x0001)
73 #define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_IGNORE ((sal_uInt32)0x0002)
74 #define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE ((sal_uInt32)0x0003)
75 #define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT ((sal_uInt32)0x0004)
76 #define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR ((sal_uInt32)0x0010)
77 #define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_IGNORE ((sal_uInt32)0x0020)
78 #define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT ((sal_uInt32)0x0030)
79 #define RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR ((sal_uInt32)0x0100)
80 #define RTL_TEXTTOUNICODE_FLAGS_INVALID_IGNORE ((sal_uInt32)0x0200)
81 #define RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT ((sal_uInt32)0x0300)
82 #define RTL_TEXTTOUNICODE_FLAGS_FLUSH ((sal_uInt32)0x8000)
83 #define RTL_TEXTTOUNICODE_FLAGS_GLOBAL_SIGNATURE 0x10000
84  /* Accept any global document signatures (for example, in UTF-8, a leading
85  EF BB BF encoding the Byte Order Mark U+FEFF) */
86 
87 #define RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MASK ((sal_uInt32)0x000F)
88 #define RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_MASK ((sal_uInt32)0x00F0)
89 #define RTL_TEXTTOUNICODE_FLAGS_INVALID_MASK ((sal_uInt32)0x0F00)
90 
91 #define RTL_TEXTTOUNICODE_INFO_ERROR ((sal_uInt32)0x0001)
92 #define RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL ((sal_uInt32)0x0002)
93 #define RTL_TEXTTOUNICODE_INFO_DESTBUFFERTOSMALL ((sal_uInt32)0x0004)
94 #define RTL_TEXTTOUNICODE_INFO_UNDEFINED ((sal_uInt32)0x0008)
95 #define RTL_TEXTTOUNICODE_INFO_MBUNDEFINED ((sal_uInt32)0x0010)
96 #define RTL_TEXTTOUNICODE_INFO_INVALID ((sal_uInt32)0x0020)
97 
100 SAL_DLLPUBLIC sal_Size SAL_CALL rtl_convertTextToUnicode(
101  rtl_TextToUnicodeConverter hConverter,
102  rtl_TextToUnicodeContext hContext,
103  const sal_Char* pSrcBuf, sal_Size nSrcBytes,
104  sal_Unicode* pDestBuf, sal_Size nDestChars,
105  sal_uInt32 nFlags, sal_uInt32* pInfo,
106  sal_Size* pSrcCvtBytes );
107 
111 
115 
118 SAL_DLLPUBLIC rtl_UnicodeToTextConverter SAL_CALL rtl_createUnicodeToTextConverter( rtl_TextEncoding eTextEncoding );
119 
122 SAL_DLLPUBLIC void SAL_CALL rtl_destroyUnicodeToTextConverter( rtl_UnicodeToTextConverter hConverter );
123 
126 SAL_DLLPUBLIC rtl_UnicodeToTextContext SAL_CALL rtl_createUnicodeToTextContext( rtl_UnicodeToTextConverter hConverter );
127 
130 SAL_DLLPUBLIC void SAL_CALL rtl_destroyUnicodeToTextContext( rtl_UnicodeToTextConverter hConverter, rtl_UnicodeToTextContext hContext );
131 
134 SAL_DLLPUBLIC void SAL_CALL rtl_resetUnicodeToTextContext( rtl_UnicodeToTextConverter hConverter, rtl_UnicodeToTextContext hContext );
135 
136 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR ((sal_uInt32)0x0001)
137 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_IGNORE ((sal_uInt32)0x0002)
138 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_0 ((sal_uInt32)0x0003)
139 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_QUESTIONMARK ((sal_uInt32)0x0004)
140 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_UNDERLINE ((sal_uInt32)0x0005)
141 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT ((sal_uInt32)0x0006)
142 #define RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR ((sal_uInt32)0x0010)
143 #define RTL_UNICODETOTEXT_FLAGS_INVALID_IGNORE ((sal_uInt32)0x0020)
144 #define RTL_UNICODETOTEXT_FLAGS_INVALID_0 ((sal_uInt32)0x0030)
145 #define RTL_UNICODETOTEXT_FLAGS_INVALID_QUESTIONMARK ((sal_uInt32)0x0040)
146 #define RTL_UNICODETOTEXT_FLAGS_INVALID_UNDERLINE ((sal_uInt32)0x0050)
147 #define RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT ((sal_uInt32)0x0060)
148 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE ((sal_uInt32)0x0100)
149 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACESTR ((sal_uInt32)0x0200)
150 #define RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0 ((sal_uInt32)0x0400)
151 #define RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE ((sal_uInt32)0x0800)
152 #define RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE ((sal_uInt32)0x1000)
153 #define RTL_UNICODETOTEXT_FLAGS_PRIVATE_IGNORE ((sal_uInt32)0x2000)
154 #define RTL_UNICODETOTEXT_FLAGS_NOCOMPOSITE ((sal_uInt32)0x4000)
155 #define RTL_UNICODETOTEXT_FLAGS_FLUSH ((sal_uInt32)0x8000)
156 #define RTL_UNICODETOTEXT_FLAGS_GLOBAL_SIGNATURE 0x10000
157  /* Write any global document signatures (for example, in UTF-8, a leading
158  EF BB BF encoding the Byte Order Mark U+FEFF) */
159 
160 #define RTL_UNICODETOTEXT_FLAGS_UNDEFINED_MASK ((sal_uInt32)0x000F)
161 #define RTL_UNICODETOTEXT_FLAGS_INVALID_MASK ((sal_uInt32)0x00F0)
162 
163 #define RTL_UNICODETOTEXT_INFO_ERROR ((sal_uInt32)0x0001)
164 #define RTL_UNICODETOTEXT_INFO_SRCBUFFERTOSMALL ((sal_uInt32)0x0002)
165 #define RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL ((sal_uInt32)0x0004)
166 #define RTL_UNICODETOTEXT_INFO_UNDEFINED ((sal_uInt32)0x0008)
167 #define RTL_UNICODETOTEXT_INFO_INVALID ((sal_uInt32)0x0010)
168 
171 SAL_DLLPUBLIC sal_Size SAL_CALL rtl_convertUnicodeToText(
172  rtl_UnicodeToTextConverter hConverter,
173  rtl_UnicodeToTextContext hContext,
174  const sal_Unicode* pSrcBuf, sal_Size nSrcChars,
175  sal_Char* pDestBuf, sal_Size nDestBytes,
176  sal_uInt32 nFlags, sal_uInt32* pInfo,
177  sal_Size* pSrcCvtChars );
178 
179 #ifdef __cplusplus
180 }
181 #endif
182 
183 #endif /* _RTL_TEXTCVT_H */
184 
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */