1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 29 #ifndef _IMPLHELPER_HXX_ 30 #define _IMPLHELPER_HXX_ 31 32 //------------------------------------------------------------------------ 33 // includes 34 //------------------------------------------------------------------------ 35 36 #include <sal/types.h> 37 #include <rtl/ustring.hxx> 38 39 #if defined _MSC_VER 40 #pragma warning(push,1) 41 #endif 42 #include <windows.h> 43 #if defined _MSC_VER 44 #pragma warning(pop) 45 #endif 46 47 //------------------------------------------------------------------------ 48 // deklarations 49 //------------------------------------------------------------------------ 50 51 // target device and formatetc helper 52 void SAL_CALL DeleteTargetDevice(DVTARGETDEVICE* ptd); 53 sal_Bool SAL_CALL CopyFormatEtc(LPFORMATETC petcDest, LPFORMATETC petcSrc); 54 sal_Int32 SAL_CALL CompareFormatEtc( const FORMATETC* pFetcLeft, const FORMATETC* pFetcRight); 55 sal_Bool SAL_CALL CompareTargetDevice(DVTARGETDEVICE* ptdLeft, DVTARGETDEVICE* ptdRight); 56 DVTARGETDEVICE* SAL_CALL CopyTargetDevice(DVTARGETDEVICE* ptdSrc); 57 58 // some codepage helper functions 59 60 //-------------------------------------------------- 61 // returns a windows codepage appropriate to the 62 // given mime charset parameter value 63 //-------------------------------------------------- 64 65 sal_uInt32 SAL_CALL getWinCPFromMimeCharset( 66 const rtl::OUString& charset ); 67 68 //-------------------------------------------------- 69 // returns a windows codepage appropriate to the 70 // given locale and locale type 71 //-------------------------------------------------- 72 73 rtl::OUString SAL_CALL getWinCPFromLocaleId( 74 LCID lcid, LCTYPE lctype ); 75 76 //-------------------------------------------------- 77 // returns a mime charset parameter value appropriate 78 // to the given codepage, optional a prefix can be 79 // given, e.g. "windows-" or "cp" 80 //-------------------------------------------------- 81 82 rtl::OUString SAL_CALL getMimeCharsetFromWinCP( 83 sal_uInt32 cp, const rtl::OUString& aPrefix ); 84 85 //-------------------------------------------------- 86 // returns a mime charset parameter value appropriate 87 // to the given locale id and locale type, optional a 88 // prefix can be given, e.g. "windows-" or "cp" 89 //-------------------------------------------------- 90 91 rtl::OUString SAL_CALL getMimeCharsetFromLocaleId( 92 LCID lcid, LCTYPE lctype, const rtl::OUString& aPrefix ); 93 94 //----------------------------------------------------- 95 // returns true, if a given codepage is an oem codepage 96 //----------------------------------------------------- 97 98 sal_Bool SAL_CALL IsOEMCP( sal_uInt32 codepage ); 99 100 //-------------------------------------------------- 101 // converts a codepage into a string representation 102 //-------------------------------------------------- 103 104 rtl::OUString SAL_CALL cptostr( sal_uInt32 codepage ); 105 106 #endif 107