LibreOffice: rtl/tencinfo.h Source File

LibreOffice LibreOffice 6.2 SDK C/C++ API Reference

tencinfo.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20 #ifndef INCLUDED_RTL_TENCINFO_H
21 #define INCLUDED_RTL_TENCINFO_H
22
23 #include "sal/config.h"
24
25 #include "rtl/textenc.h"
26 #include "sal/saldllapi.h"
27 #include "sal/types.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 // See rtl_TextEncodingInfo.Flags below for documentation on these values:
34 #define RTL_TEXTENCODING_INFO_CONTEXT ((sal_uInt32)0x00000001)
35 #define RTL_TEXTENCODING_INFO_ASCII ((sal_uInt32)0x00000002)
36 #define RTL_TEXTENCODING_INFO_UNICODE ((sal_uInt32)0x00000004)
37 #define RTL_TEXTENCODING_INFO_MULTIBYTE ((sal_uInt32)0x00000008)
38 #define RTL_TEXTENCODING_INFO_R2L ((sal_uInt32)0x00000010)
39 #define RTL_TEXTENCODING_INFO_7BIT ((sal_uInt32)0x00000020)
40 #define RTL_TEXTENCODING_INFO_SYMBOL ((sal_uInt32)0x00000040)
41 #define RTL_TEXTENCODING_INFO_MIME ((sal_uInt32)0x00000080)
42
45 typedef struct _rtl_TextEncodingInfo
46 {
49 sal_uInt32 StructSize;
50
57 sal_uInt8 MinimumCharSize;
58
65 sal_uInt8 MaximumCharSize;
66
70 sal_uInt8 AverageCharSize;
71
74 sal_uInt8 Reserved;
75
133 sal_uInt32 Flags;
134 } rtl_TextEncodingInfo;
135
147 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_isOctetTextEncoding(rtl_TextEncoding nEncoding);
148
162 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_getTextEncodingInfo(
163 rtl_TextEncoding eTextEncoding, rtl_TextEncodingInfo* pEncInfo );
164
176 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromWindowsCharset(
177 sal_uInt8 nWinCharset );
178
188 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMimeCharset(
189 const sal_Char* pMimeCharset );
190
200 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromUnixCharset(
201 const sal_Char* pUnixCharset );
202
211 SAL_DLLPUBLIC sal_uInt8 SAL_CALL rtl_getBestWindowsCharsetFromTextEncoding(
212 rtl_TextEncoding eTextEncoding );
213
224 SAL_DLLPUBLIC char const * SAL_CALL rtl_getMimeCharsetFromTextEncoding(
225 rtl_TextEncoding nEncoding );
226
235 SAL_DLLPUBLIC const sal_Char* SAL_CALL rtl_getBestMimeCharsetFromTextEncoding(
236 rtl_TextEncoding eTextEncoding );
237
246 SAL_DLLPUBLIC const sal_Char* SAL_CALL rtl_getBestUnixCharsetFromTextEncoding(
247 rtl_TextEncoding eTextEncoding );
248
259 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL
260 rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage);
261
271 SAL_DLLPUBLIC sal_uInt32 SAL_CALL
272 rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding);
273
274 #ifdef __cplusplus
275 }
276 #endif
277
278 #endif // INCLUDED_RTL_TENCINFO_H
279
280 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Char
char sal_Char
A legacy synonym for char.
Definition: types.h:120
rtl_getTextEncodingFromWindowsCharset
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCharset(sal_uInt8 nWinCharset)
Map from a numeric Windows charset to a text encoding.
rtl_getBestUnixCharsetFromTextEncoding
const SAL_DLLPUBLIC sal_Char * rtl_getBestUnixCharsetFromTextEncoding(rtl_TextEncoding eTextEncoding)
Map from a text encoding to the best matching Unix charset.
rtl_TextEncoding
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:33
_rtl_TextEncodingInfo::Reserved
sal_uInt8 Reserved
An unused byte, for padding.
Definition: tencinfo.h:74
_rtl_TextEncodingInfo::AverageCharSize
sal_uInt8 AverageCharSize
The average number of bytes needed to encode a character in the given encoding.
Definition: tencinfo.h:70
saldllapi.h
rtl_getWindowsCodePageFromTextEncoding
SAL_DLLPUBLIC sal_uInt32 rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding)
Map from a text encoding to a Windows code page.
rtl_getBestMimeCharsetFromTextEncoding
const SAL_DLLPUBLIC sal_Char * rtl_getBestMimeCharsetFromTextEncoding(rtl_TextEncoding eTextEncoding)
Map from a text encoding to the best matching MIME charset.
sal_uInt8
unsigned char sal_uInt8
Definition: types.h:44
sal_Bool
unsigned char sal_Bool
Definition: types.h:38
config.h
rtl_getTextEncodingFromUnixCharset
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromUnixCharset(const sal_Char *pUnixCharset)
Map from a Unix charset to a text encoding.
types.h
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
_rtl_TextEncodingInfo::MaximumCharSize
sal_uInt8 MaximumCharSize
The maximum number of bytes needed to encode any character in the given encoding.
Definition: tencinfo.h:65
rtl_getMimeCharsetFromTextEncoding
SAL_DLLPUBLIC const char * rtl_getMimeCharsetFromTextEncoding(rtl_TextEncoding nEncoding)
Map from a text encoding to a corresponding MIME charset name, if available (see http://www....
textenc.h
rtl_getBestWindowsCharsetFromTextEncoding
SAL_DLLPUBLIC sal_uInt8 rtl_getBestWindowsCharsetFromTextEncoding(rtl_TextEncoding eTextEncoding)
Map from a text encoding to the best matching numeric Windows charset.
_rtl_TextEncodingInfo::Flags
sal_uInt32 Flags
Any combination of the RTL_TEXTENCODING_INFO flags.
Definition: tencinfo.h:133
rtl_getTextEncodingFromMimeCharset
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromMimeCharset(const sal_Char *pMimeCharset)
Map from a MIME charset to a text encoding.
rtl_getTextEncodingFromWindowsCodePage
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage)
Map from a Windows code page to a text encoding.
rtl_TextEncodingInfo
struct _rtl_TextEncodingInfo rtl_TextEncodingInfo
Information about a text encoding.
rtl_getTextEncodingInfo
SAL_DLLPUBLIC sal_Bool rtl_getTextEncodingInfo(rtl_TextEncoding eTextEncoding, rtl_TextEncodingInfo *pEncInfo)
Return information about a text encoding.
_rtl_TextEncodingInfo::MinimumCharSize
sal_uInt8 MinimumCharSize
The minimum number of bytes needed to encode any character in the given encoding.
Definition: tencinfo.h:57
rtl_isOctetTextEncoding
SAL_DLLPUBLIC sal_Bool rtl_isOctetTextEncoding(rtl_TextEncoding nEncoding)
Determine whether a text encoding uses single octets as basic units of information (and can thus be u...
_rtl_TextEncodingInfo
Information about a text encoding.
Definition: tencinfo.h:45
_rtl_TextEncodingInfo::StructSize
sal_uInt32 StructSize
The size (in bytes) of this structure.
Definition: tencinfo.h:49