Related: tdf#163126 fix failure to restart print job
[LibreOffice.git] / vcl / win / dtrans / ImplHelper.hxx
blobdf6731ec7a30dc98be13c93c475de788ef7066de
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <sal/config.h>
24 #include <string_view>
26 #include <sal/types.h>
27 #include <rtl/ustring.hxx>
29 #if !defined WIN32_LEAN_AND_MEAN
30 #define WIN32_LEAN_AND_MEAN
31 #endif
32 #include <windows.h>
33 #include <objidl.h>
35 // target device and formatetc helper
36 void DeleteTargetDevice(DVTARGETDEVICE* ptd);
37 bool CopyFormatEtc(LPFORMATETC petcDest, LPFORMATETC petcSrc);
38 sal_Int32 CompareFormatEtc(const FORMATETC* pFetcLeft, const FORMATETC* pFetcRight);
39 bool CompareTargetDevice(DVTARGETDEVICE* ptdLeft, DVTARGETDEVICE const* ptdRight);
40 DVTARGETDEVICE* CopyTargetDevice(DVTARGETDEVICE* ptdSrc);
42 // some codepage helper functions
44 // returns a windows codepage appropriate to the
45 // given mime charset parameter value
47 sal_uInt32 getWinCPFromMimeCharset(const OUString& charset);
49 // returns a windows codepage appropriate to the
50 // given locale and locale type
52 OUString getWinCPFromLocaleId(LCID lcid, LCTYPE lctype);
54 // returns a mime charset parameter value appropriate
55 // to the given codepage, optional a prefix can be
56 // given, e.g. "windows-" or "cp"
58 OUString getMimeCharsetFromWinCP(sal_uInt32 cp, std::u16string_view 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(LCID lcid, LCTYPE lctype, std::u16string_view aPrefix);
66 // returns true, if a given codepage is an oem codepage
68 bool IsOEMCP(sal_uInt32 codepage);
70 // converts a codepage into a string representation
72 OUString cptostr(sal_uInt32 codepage);
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */