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 #ifndef _REPORT_RPTUICLIP_HXX 29 #define _REPORT_RPTUICLIP_HXX 30 31 #include <svtools/transfer.hxx> 32 #include <com/sun/star/beans/NamedValue.hpp> 33 34 namespace rptui 35 { 36 //============================================================================ 37 // OReportExchange 38 //============================================================================ 39 /** \class OReportExchange 40 * \brief defines a clipboard fromat for copying selection elements. 41 * \ingroup reportdesign_source_ui_report 42 * 43 * 44 */ 45 class OReportExchange : public TransferableHelper 46 { 47 public: 48 typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > TSectionElements; 49 50 /** Constructs a new exchange object with section elements 51 * 52 * \param _rCopyElements the elements to copy. Each section is one entry. The value must be a sequence of elements. 53 * \return 54 */ 55 OReportExchange( const TSectionElements& _rCopyElements); 56 57 /** checks whether or not a descriptor can be extracted from the data flavor vector given 58 * 59 * \param _rFlavors 60 available flavors 61 * \return 62 */ 63 static sal_Bool canExtract(const DataFlavorExVector& _rFlavors); 64 65 /** extract the section elements 66 * 67 * \param _rData the clipboard data 68 * \return the copied elements 69 */ 70 static TSectionElements extractCopies(const TransferableDataHelper& _rData); 71 72 /** returns the format id. 73 * 74 * \return the registered format id 75 */ 76 static sal_uInt32 getDescriptorFormatId(); 77 78 protected: 79 // TransferableHelper overridables 80 virtual void AddSupportedFormats(); 81 virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); 82 private: 83 TSectionElements m_aCopyElements; 84 }; 85 } 86 #endif // _REPORT_RPTUICLIP_HXX 87