LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
58 
66 
71 
75 
133  sal_uInt32 Flags;
135 
148 
163  rtl_TextEncoding eTextEncoding, rtl_TextEncodingInfo* pEncInfo );
164 
177  sal_uInt8 nWinCharset );
178 
189  const sal_Char* pMimeCharset );
190 
201  const sal_Char* pUnixCharset );
202 
212  rtl_TextEncoding eTextEncoding );
213 
225  rtl_TextEncoding nEncoding );
226 
236  rtl_TextEncoding eTextEncoding );
237 
247  rtl_TextEncoding eTextEncoding );
248 
260 rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage);
261 
271 SAL_DLLPUBLIC sal_uInt32 SAL_CALL
273 
274 #ifdef __cplusplus
275 }
276 #endif
277 
278 #endif // INCLUDED_RTL_TENCINFO_H
279 
280 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
sal_uInt8 AverageCharSize
The average number of bytes needed to encode a character in the given encoding.
Definition: tencinfo.h:70
char sal_Char
A legacy synonym for char.
Definition: types.h:130
sal_uInt8 MinimumCharSize
The minimum number of bytes needed to encode any character in the given encoding. ...
Definition: tencinfo.h:57
SAL_DLLPUBLIC sal_Bool rtl_getTextEncodingInfo(rtl_TextEncoding eTextEncoding, rtl_TextEncodingInfo *pEncInfo)
Return information about a text encoding.
SAL_DLLPUBLIC char const * rtl_getMimeCharsetFromTextEncoding(rtl_TextEncoding nEncoding)
Map from a text encoding to a corresponding MIME charset name, if available (see http://www.iana.org/assignments/character-sets).
struct _rtl_TextEncodingInfo rtl_TextEncodingInfo
Information about a text encoding.
sal_uInt8 Reserved
An unused byte, for padding.
Definition: tencinfo.h:74
sal_uInt32 StructSize
The size (in bytes) of this structure.
Definition: tencinfo.h:49
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromUnixCharset(const sal_Char *pUnixCharset)
Map from a Unix charset to a text encoding.
unsigned char sal_Bool
Definition: types.h:48
unsigned char sal_uInt8
Definition: types.h:54
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...
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCharset(sal_uInt8 nWinCharset)
Map from a numeric Windows charset to a text encoding.
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage)
Map from a Windows code page to a text encoding.
sal_uInt8 MaximumCharSize
The maximum number of bytes needed to encode any character in the given encoding. ...
Definition: tencinfo.h:65
Information about a text encoding.
Definition: tencinfo.h:45
SAL_DLLPUBLIC sal_uInt8 rtl_getBestWindowsCharsetFromTextEncoding(rtl_TextEncoding eTextEncoding)
Map from a text encoding to the best matching numeric Windows charset.
sal_uInt16 rtl_TextEncoding
The various supported text encodings.
Definition: textenc.h:39
SAL_DLLPUBLIC const sal_Char * rtl_getBestUnixCharsetFromTextEncoding(rtl_TextEncoding eTextEncoding)
Map from a text encoding to the best matching Unix charset.
sal_uInt32 Flags
Any combination of the RTL_TEXTENCODING_INFO flags.
Definition: tencinfo.h:133
SAL_DLLPUBLIC sal_uInt32 rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding)
Map from a text encoding to a Windows code page.
SAL_DLLPUBLIC const sal_Char * rtl_getBestMimeCharsetFromTextEncoding(rtl_TextEncoding eTextEncoding)
Map from a text encoding to the best matching MIME charset.
SAL_DLLPUBLIC rtl_TextEncoding rtl_getTextEncodingFromMimeCharset(const sal_Char *pMimeCharset)
Map from a MIME charset to a text encoding.