LibreOffice Module dtrans (master)  1
ImplHelper.hxx
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_DTRANS_SOURCE_WIN32_MISC_IMPLHELPER_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_MISC_IMPLHELPER_HXX
22 
23 #include <sal/types.h>
24 #include <rtl/ustring.hxx>
25 
26 #if !defined WIN32_LEAN_AND_MEAN
27 # define WIN32_LEAN_AND_MEAN
28 #endif
29 #include <windows.h>
30 #include <objidl.h>
31 
32 // target device and formatetc helper
33 void DeleteTargetDevice(DVTARGETDEVICE* ptd);
34 bool CopyFormatEtc(LPFORMATETC petcDest, LPFORMATETC petcSrc);
35 sal_Int32 CompareFormatEtc( const FORMATETC* pFetcLeft, const FORMATETC* pFetcRight);
36 bool CompareTargetDevice(DVTARGETDEVICE* ptdLeft, DVTARGETDEVICE const * ptdRight);
37 DVTARGETDEVICE* CopyTargetDevice(DVTARGETDEVICE* ptdSrc);
38 
39 // some codepage helper functions
40 
41 // returns a windows codepage appropriate to the
42 // given mime charset parameter value
43 
44 sal_uInt32 getWinCPFromMimeCharset(
45  const OUString& charset );
46 
47 // returns a windows codepage appropriate to the
48 // given locale and locale type
49 
50 OUString getWinCPFromLocaleId(
51  LCID lcid, LCTYPE lctype );
52 
53 // returns a mime charset parameter value appropriate
54 // to the given codepage, optional a prefix can be
55 // given, e.g. "windows-" or "cp"
56 
58  sal_uInt32 cp, const OUString& aPrefix );
59 
60 // returns a mime charset parameter value appropriate
61 // to the given locale id and locale type, optional a
62 // prefix can be given, e.g. "windows-" or "cp"
63 
65  LCID lcid, LCTYPE lctype, const OUString& aPrefix );
66 
67 // returns true, if a given codepage is an oem codepage
68 
69 bool IsOEMCP( sal_uInt32 codepage );
70 
71 // converts a codepage into a string representation
72 
73 OUString cptostr( sal_uInt32 codepage );
74 
75 #endif
76 
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsOEMCP(sal_uInt32 codepage)
Definition: ImplHelper.cxx:133
sal_uInt32 getWinCPFromMimeCharset(const OUString &charset)
Definition: ImplHelper.cxx:41
OUString getMimeCharsetFromWinCP(sal_uInt32 cp, const OUString &aPrefix)
Definition: ImplHelper.cxx:116
void DeleteTargetDevice(DVTARGETDEVICE *ptd)
Definition: ImplHelper.cxx:166
bool CopyFormatEtc(LPFORMATETC petcDest, LPFORMATETC petcSrc)
Definition: ImplHelper.cxx:235
bool CompareTargetDevice(DVTARGETDEVICE *ptdLeft, DVTARGETDEVICE const *ptdRight)
Definition: ImplHelper.cxx:323
DVTARGETDEVICE * CopyTargetDevice(DVTARGETDEVICE *ptdSrc)
Definition: ImplHelper.cxx:193
OUString cptostr(sal_uInt32 codepage)
Definition: ImplHelper.cxx:151
OUString getMimeCharsetFromLocaleId(LCID lcid, LCTYPE lctype, const OUString &aPrefix)
Definition: ImplHelper.cxx:125
OUString getWinCPFromLocaleId(LCID lcid, LCTYPE lctype)
Definition: ImplHelper.cxx:71
sal_Int32 CompareFormatEtc(const FORMATETC *pFetcLeft, const FORMATETC *pFetcRight)
Definition: ImplHelper.cxx:271