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