1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_MISC_IMPLHELPER_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_MISC_IMPLHELPER_HXX
23 #include <sal/types.h>
24 #include <rtl/ustring.hxx>
26 #if !defined WIN32_LEAN_AND_MEAN
27 # define WIN32_LEAN_AND_MEAN
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
);
39 // some codepage helper functions
41 // returns a windows codepage appropriate to the
42 // given mime charset parameter value
44 sal_uInt32
getWinCPFromMimeCharset(
45 const OUString
& charset
);
47 // returns a windows codepage appropriate to the
48 // given locale and locale type
50 OUString
getWinCPFromLocaleId(
51 LCID lcid
, LCTYPE lctype
);
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"
57 OUString
getMimeCharsetFromWinCP(
58 sal_uInt32 cp
, const OUString
& aPrefix
);
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"
64 OUString
getMimeCharsetFromLocaleId(
65 LCID lcid
, LCTYPE lctype
, const OUString
& aPrefix
);
67 // returns true, if a given codepage is an oem codepage
69 bool IsOEMCP( sal_uInt32 codepage
);
71 // converts a codepage into a string representation
73 OUString
cptostr( sal_uInt32 codepage
);
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */