1*9ee13d13SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9ee13d13SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9ee13d13SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9ee13d13SAndrew Rist  * distributed with this work for additional information
6*9ee13d13SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9ee13d13SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9ee13d13SAndrew Rist  * "License"); you may not use this file except in compliance
9*9ee13d13SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9ee13d13SAndrew Rist  *
11*9ee13d13SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9ee13d13SAndrew Rist  *
13*9ee13d13SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9ee13d13SAndrew Rist  * software distributed under the License is distributed on an
15*9ee13d13SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9ee13d13SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9ee13d13SAndrew Rist  * specific language governing permissions and limitations
18*9ee13d13SAndrew Rist  * under the License.
19*9ee13d13SAndrew Rist  *
20*9ee13d13SAndrew Rist  *************************************************************/
21*9ee13d13SAndrew Rist 
22*9ee13d13SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _REPORT_RPTUICLIP_HXX
25cdf0e10cSrcweir #define _REPORT_RPTUICLIP_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svtools/transfer.hxx>
28cdf0e10cSrcweir #include <com/sun/star/beans/NamedValue.hpp>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace rptui
31cdf0e10cSrcweir {
32cdf0e10cSrcweir //============================================================================
33cdf0e10cSrcweir // OReportExchange
34cdf0e10cSrcweir //============================================================================
35cdf0e10cSrcweir /** \class OReportExchange
36cdf0e10cSrcweir  * \brief defines a clipboard fromat for copying selection elements.
37cdf0e10cSrcweir  * \ingroup reportdesign_source_ui_report
38cdf0e10cSrcweir  *
39cdf0e10cSrcweir  *
40cdf0e10cSrcweir  */
41cdf0e10cSrcweir class OReportExchange : public TransferableHelper
42cdf0e10cSrcweir {
43cdf0e10cSrcweir public:
44cdf0e10cSrcweir     typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > TSectionElements;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     /** Constructs a new exchange object with section elements
47cdf0e10cSrcweir     *
48cdf0e10cSrcweir     * \param _rCopyElements the elements to copy. Each section is one entry. The value must be a sequence of elements.
49cdf0e10cSrcweir     * \return
50cdf0e10cSrcweir     */
51cdf0e10cSrcweir     OReportExchange( const TSectionElements& _rCopyElements);
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     /** checks whether or not a descriptor can be extracted from the data flavor vector given
54cdf0e10cSrcweir     *
55cdf0e10cSrcweir     * \param _rFlavors
56cdf0e10cSrcweir             available flavors
57cdf0e10cSrcweir     * \return
58cdf0e10cSrcweir     */
59cdf0e10cSrcweir 	static sal_Bool         canExtract(const DataFlavorExVector& _rFlavors);
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     /** extract the section elements
62cdf0e10cSrcweir     *
63cdf0e10cSrcweir     * \param _rData the clipboard data
64cdf0e10cSrcweir     * \return the copied elements
65cdf0e10cSrcweir     */
66cdf0e10cSrcweir     static TSectionElements extractCopies(const TransferableDataHelper& _rData);
67cdf0e10cSrcweir 
68cdf0e10cSrcweir     /** returns the format id.
69cdf0e10cSrcweir     *
70cdf0e10cSrcweir     * \return the registered format id
71cdf0e10cSrcweir     */
72cdf0e10cSrcweir     static sal_uInt32	    getDescriptorFormatId();
73cdf0e10cSrcweir 
74cdf0e10cSrcweir protected:
75cdf0e10cSrcweir 	// TransferableHelper overridables
76cdf0e10cSrcweir 	virtual void		AddSupportedFormats();
77cdf0e10cSrcweir 	virtual sal_Bool	GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
78cdf0e10cSrcweir private:
79cdf0e10cSrcweir     TSectionElements	m_aCopyElements;
80cdf0e10cSrcweir };
81cdf0e10cSrcweir }
82cdf0e10cSrcweir #endif // _REPORT_RPTUICLIP_HXX
83