1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 29 #ifndef _FETC_HXX_ 30 #define _FETC_HXX_ 31 32 //------------------------------------------------------------------------ 33 // includes 34 //------------------------------------------------------------------------ 35 36 #include <sal/types.h> 37 38 #if defined _MSC_VER 39 #pragma warning(push,1) 40 #endif 41 #include <windows.h> 42 #if defined _MSC_VER 43 #pragma warning(pop) 44 #endif 45 46 /********************************************************************** 47 stl container elements must fulfill the following requirements: 48 1. they need a copy ctor and assignement operator(?) 49 2. they must be compareable 50 because the FORMATETC structure has a pointer to a TARGETDEVICE 51 structure we need a simple wrapper class to fulfill these needs 52 ***********************************************************************/ 53 54 class CFormatEtc 55 { 56 public: 57 CFormatEtc( ); 58 CFormatEtc( const FORMATETC& aFormatEtc ); 59 CFormatEtc( CLIPFORMAT cf, DWORD tymed = TYMED_HGLOBAL, DVTARGETDEVICE* ptd = NULL, DWORD dwAspect = DVASPECT_CONTENT, LONG lindex = -1 ); 60 CFormatEtc( const CFormatEtc& theOther ); 61 62 ~CFormatEtc( ); 63 64 CFormatEtc& operator=( const CFormatEtc& theOther ); 65 operator FORMATETC*( ); 66 operator FORMATETC( ); 67 68 void getFORMATETC( LPFORMATETC lpFormatEtc ); 69 70 CLIPFORMAT getClipformat( ) const; 71 DWORD getTymed( ) const; 72 void getTargetDevice( DVTARGETDEVICE** ptd ) const; 73 DWORD getDvAspect( ) const; 74 LONG getLindex( ) const; 75 76 void setClipformat( CLIPFORMAT cf ); 77 void setTymed( DWORD tymed ); 78 void setTargetDevice( DVTARGETDEVICE* ptd ); 79 void setDvAspect( DWORD dwAspect ); 80 void setLindex( LONG lindex ); 81 82 private: 83 FORMATETC m_FormatEtc; 84 85 friend sal_Int32 operator==( const CFormatEtc& lhs, const CFormatEtc& rhs ); 86 friend sal_Int32 operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs ); 87 }; 88 89 sal_Int32 operator==( const CFormatEtc& lhs, const CFormatEtc& rhs ); 90 sal_Int32 operator!=( const CFormatEtc& lhs, const CFormatEtc& rhs ); 91 92 93 #endif 94