00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 00002 /* 00003 * This file is part of the LibreOffice project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 * 00009 * This file incorporates work covered by the following license notice: 00010 * 00011 * Licensed to the Apache Software Foundation (ASF) under one or more 00012 * contributor license agreements. See the NOTICE file distributed 00013 * with this work for additional information regarding copyright 00014 * ownership. The ASF licenses this file to you under the Apache 00015 * License, Version 2.0 (the "License"); you may not use this file 00016 * except in compliance with the License. You may obtain a copy of 00017 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 00018 */ 00019 00020 #ifndef _RTL_TENCINFO_H 00021 #define _RTL_TENCINFO_H 00022 00023 #include "sal/config.h" 00024 00025 #include "rtl/textenc.h" 00026 #include "sal/saldllapi.h" 00027 #include "sal/types.h" 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 // See rtl_TextEncodingInfo.Flags below for documentation on these values: 00034 #define RTL_TEXTENCODING_INFO_CONTEXT ((sal_uInt32)0x00000001) 00035 #define RTL_TEXTENCODING_INFO_ASCII ((sal_uInt32)0x00000002) 00036 #define RTL_TEXTENCODING_INFO_UNICODE ((sal_uInt32)0x00000004) 00037 #define RTL_TEXTENCODING_INFO_MULTIBYTE ((sal_uInt32)0x00000008) 00038 #define RTL_TEXTENCODING_INFO_R2L ((sal_uInt32)0x00000010) 00039 #define RTL_TEXTENCODING_INFO_7BIT ((sal_uInt32)0x00000020) 00040 #define RTL_TEXTENCODING_INFO_SYMBOL ((sal_uInt32)0x00000040) 00041 #define RTL_TEXTENCODING_INFO_MIME ((sal_uInt32)0x00000080) 00042 00045 typedef struct _rtl_TextEncodingInfo 00046 { 00049 sal_uInt32 StructSize; 00050 00057 sal_uInt8 MinimumCharSize; 00058 00065 sal_uInt8 MaximumCharSize; 00066 00070 sal_uInt8 AverageCharSize; 00071 00074 sal_uInt8 Reserved; 00075 00133 sal_uInt32 Flags; 00134 } rtl_TextEncodingInfo; 00135 00147 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_isOctetTextEncoding(rtl_TextEncoding nEncoding); 00148 00162 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_getTextEncodingInfo( 00163 rtl_TextEncoding eTextEncoding, rtl_TextEncodingInfo* pEncInfo ); 00164 00174 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromWindowsCharset( 00175 sal_uInt8 nWinCharset ); 00176 00186 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMimeCharset( 00187 const sal_Char* pMimeCharset ); 00188 00198 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromUnixCharset( 00199 const sal_Char* pUnixCharset ); 00200 00209 SAL_DLLPUBLIC sal_uInt8 SAL_CALL rtl_getBestWindowsCharsetFromTextEncoding( 00210 rtl_TextEncoding eTextEncoding ); 00211 00222 SAL_DLLPUBLIC char const * SAL_CALL rtl_getMimeCharsetFromTextEncoding( 00223 rtl_TextEncoding nEncoding ); 00224 00233 SAL_DLLPUBLIC const sal_Char* SAL_CALL rtl_getBestMimeCharsetFromTextEncoding( 00234 rtl_TextEncoding eTextEncoding ); 00235 00244 SAL_DLLPUBLIC const sal_Char* SAL_CALL rtl_getBestUnixCharsetFromTextEncoding( 00245 rtl_TextEncoding eTextEncoding ); 00246 00257 SAL_DLLPUBLIC rtl_TextEncoding SAL_CALL 00258 rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage); 00259 00269 SAL_DLLPUBLIC sal_uInt32 SAL_CALL 00270 rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding); 00271 00272 #ifdef __cplusplus 00273 } 00274 #endif 00275 00276 #endif /* _RTL_TENCINFO_H */ 00277 00278 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */