xref: /aoo42x/main/dtrans/source/win32/dtobj/Fetc.hxx (revision f5484c28)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _FETC_HXX_
25 #define _FETC_HXX_
26 
27 //------------------------------------------------------------------------
28 // includes
29 //------------------------------------------------------------------------
30 
31 #include <sal/types.h>
32 
33 #if defined _MSC_VER
34 #pragma warning(push,1)
35 #endif
36 #include <windows.h>
37 #if defined _MSC_VER
38 #pragma warning(pop)
39 #endif
40 
41 /**********************************************************************
42  stl container elements must fulfill the following requirements:
43  1. they need a copy ctor and assignment operator(?)
44  2. they must be compareable
45  because the FORMATETC structure has a pointer to a TARGETDEVICE
46  structure we need a simple wrapper class to fulfill these needs
47 ***********************************************************************/
48 
49 class CFormatEtc
50 {
51 public:
52 	CFormatEtc( );
53 	CFormatEtc( const FORMATETC& aFormatEtc );
54 	CFormatEtc( CLIPFORMAT cf, DWORD tymed = TYMED_HGLOBAL, DVTARGETDEVICE* ptd = NULL, DWORD dwAspect = DVASPECT_CONTENT, LONG lindex = -1 );
55 	CFormatEtc( const CFormatEtc& theOther );
56 
57 	~CFormatEtc( );
58 
59 	CFormatEtc& operator=( const CFormatEtc& theOther );
60 	operator FORMATETC*( );
61 	operator FORMATETC( );
62 
63 	void getFORMATETC( LPFORMATETC lpFormatEtc );
64 
65 	CLIPFORMAT getClipformat( ) const;
66 	DWORD      getTymed( ) const;
67 	void       getTargetDevice( DVTARGETDEVICE** ptd ) const;
68 	DWORD      getDvAspect( ) const;
69 	LONG       getLindex( ) const;
70 
71 	void setClipformat( CLIPFORMAT cf );
72 	void setTymed( DWORD tymed );
73 	void setTargetDevice( DVTARGETDEVICE* ptd );
74 	void setDvAspect( DWORD dwAspect );
75 	void setLindex( LONG lindex );
76 
77 private:
78 	FORMATETC m_FormatEtc;
79 
80 	friend sal_Int32 operator==( const CFormatEtc& lhs, const CFormatEtc& rhs );
81 	friend sal_Int32 operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs );
82 };
83 
84 sal_Int32 operator==( const CFormatEtc& lhs, const CFormatEtc& rhs );
85 sal_Int32 operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs );
86 
87 
88 #endif
89