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