xref: /AOO41X/main/svx/inc/svx/dbaobjectex.hxx (revision 3334a7e6acdae9820fa1a6f556bb10129a8de6b2)
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 SVX_DBAOBJECTEX_HXX
25 #define SVX_DBAOBJECTEX_HXX
26 
27 #include <svtools/transfer.hxx>
28 #include <comphelper/stl_types.hxx>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/sdbc/XConnection.hpp>
31 #include <com/sun/star/ucb/XContent.hpp>
32 #include <svx/dataaccessdescriptor.hxx>
33 #include <com/sun/star/uno/Sequence.hxx>
34 #include "svx/svxdllapi.h"
35 
36 //........................................................................
37 namespace svx
38 {
39 //........................................................................
40 
41     //====================================================================
42     //= OComponentTransferable
43     //====================================================================
44     class SVX_DLLPUBLIC OComponentTransferable : public TransferableHelper
45     {
46     protected:
47         ODataAccessDescriptor   m_aDescriptor;
48 
49     public:
50         /** construct the transferable
51         */
52         OComponentTransferable(
53             const ::rtl::OUString&  _rDatasourceOrLocation
54             ,const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent
55         );
56 
57         /** checks whether or not a component descriptor can be extracted from the data flavor vector given
58             @param _rFlavors
59                 available flavors
60         */
61         static sal_Bool canExtractComponentDescriptor(const DataFlavorExVector& _rFlavors,sal_Bool _bForm );
62 
63         /** extracts a component descriptor from the transferable given
64         */
65         static sal_Bool extractComponentDescriptor(
66             const TransferableDataHelper&   _rData
67             ,sal_Bool _bExtractForm
68             ,::rtl::OUString&               _rDatasourceOrLocation
69             ,::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent>& _xContent
70         );
71 
72         /** extracts a component descriptor from the transferable given
73         */
74         static ODataAccessDescriptor
75                         extractComponentDescriptor(const TransferableDataHelper& _rData);
76 
77     protected:
78         // TransferableHelper overridables
79         virtual void        AddSupportedFormats();
80         virtual sal_Bool    GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
81 
82         static sal_uInt32   getDescriptorFormatId(sal_Bool _bExtractForm);
83     };
84 
85 //........................................................................
86 }   // namespace svx
87 //........................................................................
88 
89 #endif // SVX_DBAOBJECTEX_HXX
90 
91