LibreOffice Module dtrans (master)  1
Fetc.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_DTOBJ_FETC_HXX
21 #define INCLUDED_DTRANS_SOURCE_WIN32_DTOBJ_FETC_HXX
22 
23 #include <sal/types.h>
24 
25 #if !defined WIN32_LEAN_AND_MEAN
26 # define WIN32_LEAN_AND_MEAN
27 #endif
28 #include <windows.h>
29 #include <objidl.h>
30 
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 ***********************************************************************/
38 
40 {
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 );
46 
47  ~CFormatEtc( );
48 
49  CFormatEtc& operator=( const CFormatEtc& theOther );
50  operator FORMATETC*( );
51  operator FORMATETC( );
52 
53  void getFORMATETC( LPFORMATETC lpFormatEtc );
54 
55  CLIPFORMAT getClipformat( ) const;
56  DWORD getTymed( ) const;
57  void getTargetDevice( DVTARGETDEVICE** ptd ) const;
58  DWORD getDvAspect( ) const;
59  LONG getLindex( ) const;
60 
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 );
66 
67 private:
68  FORMATETC m_FormatEtc;
69 
70  friend bool operator==( const CFormatEtc& lhs, const CFormatEtc& rhs );
71  friend bool operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs );
72 };
73 
74 bool operator==( const CFormatEtc& lhs, const CFormatEtc& rhs );
75 bool operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs );
76 
77 #endif
78 
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void getFORMATETC(LPFORMATETC lpFormatEtc)
Definition: Fetc.cxx:89
lindex
void getTargetDevice(DVTARGETDEVICE **ptd) const
Definition: Fetc.cxx:107
FORMATETC m_FormatEtc
Definition: Fetc.hxx:68
LONG
CLIPFORMAT getClipformat() const
Definition: Fetc.cxx:97
void setTargetDevice(DVTARGETDEVICE *ptd)
Definition: Fetc.cxx:140
CFormatEtc & operator=(const CFormatEtc &theOther)
Definition: Fetc.cxx:63
void setDvAspect(DWORD dwAspect)
Definition: Fetc.cxx:146
void setClipformat(CLIPFORMAT cf)
Definition: Fetc.cxx:128
bool operator!=(const CFormatEtc &lhs, const CFormatEtc &rhs)
Definition: Fetc.cxx:161
friend bool operator!=(const CFormatEtc &lhs, const CFormatEtc &rhs)
Definition: Fetc.cxx:161
~CFormatEtc()
Definition: Fetc.cxx:40
bool operator==(const CFormatEtc &lhs, const CFormatEtc &rhs)
Definition: Fetc.cxx:156
CFormatEtc()
Definition: Fetc.cxx:24
LONG getLindex() const
Definition: Fetc.cxx:123
friend bool operator==(const CFormatEtc &lhs, const CFormatEtc &rhs)
Definition: Fetc.cxx:156
void setLindex(LONG lindex)
Definition: Fetc.cxx:151
DWORD getTymed() const
Definition: Fetc.cxx:102
DWORD getDvAspect() const
Definition: Fetc.cxx:118
void setTymed(DWORD tymed)
Definition: Fetc.cxx:133