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 25 #ifndef _FETC_HXX_ 26 #define _FETC_HXX_ 27 28 //------------------------------------------------------------------------ 29 // includes 30 //------------------------------------------------------------------------ 31 32 #include <sal/types.h> 33 34 #if defined _MSC_VER 35 #pragma warning(push,1) 36 #endif 37 #include <windows.h> 38 #if defined _MSC_VER 39 #pragma warning(pop) 40 #endif 41 42 /********************************************************************** 43 stl container elements must fulfill the following requirements: 44 1. they need a copy ctor and assignement operator(?) 45 2. they must be compareable 46 because the FORMATETC structure has a pointer to a TARGETDEVICE 47 structure we need a simple wrapper class to fulfill these needs 48 ***********************************************************************/ 49 50 class CFormatEtc 51 { 52 public: 53 CFormatEtc( ); 54 CFormatEtc( const FORMATETC& aFormatEtc ); 55 CFormatEtc( CLIPFORMAT cf, DWORD tymed = TYMED_HGLOBAL, DVTARGETDEVICE* ptd = NULL, DWORD dwAspect = DVASPECT_CONTENT, LONG lindex = -1 ); 56 CFormatEtc( const CFormatEtc& theOther ); 57 58 ~CFormatEtc( ); 59 60 CFormatEtc& operator=( const CFormatEtc& theOther ); 61 operator FORMATETC*( ); 62 operator FORMATETC( ); 63 64 void getFORMATETC( LPFORMATETC lpFormatEtc ); 65 66 CLIPFORMAT getClipformat( ) const; 67 DWORD getTymed( ) const; 68 void getTargetDevice( DVTARGETDEVICE** ptd ) const; 69 DWORD getDvAspect( ) const; 70 LONG getLindex( ) const; 71 72 void setClipformat( CLIPFORMAT cf ); 73 void setTymed( DWORD tymed ); 74 void setTargetDevice( DVTARGETDEVICE* ptd ); 75 void setDvAspect( DWORD dwAspect ); 76 void setLindex( LONG lindex ); 77 78 private: 79 FORMATETC m_FormatEtc; 80 81 friend sal_Int32 operator==( const CFormatEtc& lhs, const CFormatEtc& rhs ); 82 friend sal_Int32 operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs ); 83 }; 84 85 sal_Int32 operator==( const CFormatEtc& lhs, const CFormatEtc& rhs ); 86 sal_Int32 operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs ); 87 88 89 #endif 90