1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 25 #ifndef _IMPLHELPER_HXX_ 26 #define _IMPLHELPER_HXX_ 27 28 //------------------------------------------------------------------------ 29 // includes 30 //------------------------------------------------------------------------ 31 32 #include <sal/types.h> 33 #include <rtl/ustring.hxx> 34 35 #if defined _MSC_VER 36 #pragma warning(push,1) 37 #endif 38 #include <windows.h> 39 #if defined _MSC_VER 40 #pragma warning(pop) 41 #endif 42 43 //------------------------------------------------------------------------ 44 // deklarations 45 //------------------------------------------------------------------------ 46 47 // target device and formatetc helper 48 void SAL_CALL DeleteTargetDevice(DVTARGETDEVICE* ptd); 49 sal_Bool SAL_CALL CopyFormatEtc(LPFORMATETC petcDest, LPFORMATETC petcSrc); 50 sal_Int32 SAL_CALL CompareFormatEtc( const FORMATETC* pFetcLeft, const FORMATETC* pFetcRight); 51 sal_Bool SAL_CALL CompareTargetDevice(DVTARGETDEVICE* ptdLeft, DVTARGETDEVICE* ptdRight); 52 DVTARGETDEVICE* SAL_CALL CopyTargetDevice(DVTARGETDEVICE* ptdSrc); 53 54 // some codepage helper functions 55 56 //-------------------------------------------------- 57 // returns a windows codepage appropriate to the 58 // given mime charset parameter value 59 //-------------------------------------------------- 60 61 sal_uInt32 SAL_CALL getWinCPFromMimeCharset( 62 const rtl::OUString& charset ); 63 64 //-------------------------------------------------- 65 // returns a windows codepage appropriate to the 66 // given locale and locale type 67 //-------------------------------------------------- 68 69 rtl::OUString SAL_CALL getWinCPFromLocaleId( 70 LCID lcid, LCTYPE lctype ); 71 72 //-------------------------------------------------- 73 // returns a mime charset parameter value appropriate 74 // to the given codepage, optional a prefix can be 75 // given, e.g. "windows-" or "cp" 76 //-------------------------------------------------- 77 78 rtl::OUString SAL_CALL getMimeCharsetFromWinCP( 79 sal_uInt32 cp, const rtl::OUString& aPrefix ); 80 81 //-------------------------------------------------- 82 // returns a mime charset parameter value appropriate 83 // to the given locale id and locale type, optional a 84 // prefix can be given, e.g. "windows-" or "cp" 85 //-------------------------------------------------- 86 87 rtl::OUString SAL_CALL getMimeCharsetFromLocaleId( 88 LCID lcid, LCTYPE lctype, const rtl::OUString& aPrefix ); 89 90 //----------------------------------------------------- 91 // returns true, if a given codepage is an oem codepage 92 //----------------------------------------------------- 93 94 sal_Bool SAL_CALL IsOEMCP( sal_uInt32 codepage ); 95 96 //-------------------------------------------------- 97 // converts a codepage into a string representation 98 //-------------------------------------------------- 99 100 rtl::OUString SAL_CALL cptostr( sal_uInt32 codepage ); 101 102 #endif 103