Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / dtrans / source / win32 / dtobj / Fetc.hxx
blob5ec3e4b9459e17529326bf186b5747406818d327
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 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_DTOBJ_FETC_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_DTOBJ_FETC_HXX
23 #include <sal/types.h>
25 #if !defined WIN32_LEAN_AND_MEAN
26 # define WIN32_LEAN_AND_MEAN
27 #endif
28 #include <windows.h>
29 #include <objidl.h>
31 /**********************************************************************
32 stl container elements must fulfill the following requirements:
33 1. they need a copy ctor and assignment operator(?)
34 2. they must be comparable
35 because the FORMATETC structure has a pointer to a TARGETDEVICE
36 structure we need a simple wrapper class to fulfill these needs
37 ***********************************************************************/
39 class CFormatEtc
41 public:
42 CFormatEtc( );
43 explicit CFormatEtc( const FORMATETC& aFormatEtc );
44 CFormatEtc( CLIPFORMAT cf, DWORD tymed = TYMED_HGLOBAL, DVTARGETDEVICE* ptd = nullptr, DWORD dwAspect = DVASPECT_CONTENT, LONG lindex = -1 );
45 CFormatEtc( const CFormatEtc& theOther );
47 ~CFormatEtc( );
49 CFormatEtc& operator=( const CFormatEtc& theOther );
50 operator FORMATETC*( );
51 operator FORMATETC( );
53 void getFORMATETC( LPFORMATETC lpFormatEtc );
55 CLIPFORMAT getClipformat( ) const;
56 DWORD getTymed( ) const;
57 void getTargetDevice( DVTARGETDEVICE** ptd ) const;
58 DWORD getDvAspect( ) const;
59 LONG getLindex( ) const;
61 void setClipformat( CLIPFORMAT cf );
62 void setTymed( DWORD tymed );
63 void setTargetDevice( DVTARGETDEVICE* ptd );
64 void setDvAspect( DWORD dwAspect );
65 void setLindex( LONG lindex );
67 private:
68 FORMATETC m_FormatEtc;
70 friend bool operator==( const CFormatEtc& lhs, const CFormatEtc& rhs );
71 friend bool operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs );
74 bool operator==( const CFormatEtc& lhs, const CFormatEtc& rhs );
75 bool operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs );
77 #endif
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */