xref: /AOO41X/main/dbaccess/source/ui/inc/JoinExchange.hxx (revision 2e2212a7c22e96cf6f6fab0dd042c34a45a64bd6)
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 #ifndef DBAUI_JOINEXCHANGE_HXX
24 #define DBAUI_JOINEXCHANGE_HXX
25 
26 #ifndef DBAUI_DBEXCHANGE_HXX
27 #include "dbexchange.hxx"
28 #endif
29 #ifndef DBAUI_TABLEWINDOWLISTBOX_HXX
30 #include "TableWindowListBox.hxx"
31 #endif
32 
33 #ifndef _TRANSFER_HXX
34 #include <svtools/transfer.hxx>
35 #endif
36 #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
37 #include <com/sun/star/lang/XUnoTunnel.hpp>
38 #endif
39 #ifndef _CPPUHELPER_IMPLBASE1_HXX_
40 #include <cppuhelper/implbase1.hxx>
41 #endif
42 
43 namespace dbaui
44 {
45     //==================================================================
46     // OJoinExchObj :
47     // Zusaetzliche Daten fuer das Erzeugen von Joins in der JoinShell
48     //==================================================================
49 
50     typedef ::cppu::ImplHelper1< ::com::sun::star::lang::XUnoTunnel > OJoinExchObj_Base;
51     class OJoinExchObj
52                     :public TransferableHelper
53                     ,public OJoinExchObj_Base
54     {
55         static String           m_sJoinFormat;
56         sal_Bool                m_bFirstEntry;
57 
58     protected:
59         OJoinExchangeData           m_jxdSourceDescription;
60         IDragTransferableListener*  m_pDragListener;
61 
62         virtual ~OJoinExchObj();
63     public:
64         OJoinExchObj(const OJoinExchangeData& jxdSource,sal_Bool _bFirstEntry=sal_False);
65 
66 
67         // XInterface
68         virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
69         virtual void SAL_CALL acquire(  ) throw();
70         virtual void SAL_CALL release(  ) throw();
71 
72         // XUnoTunnel
73         virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& _rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
74 
75         void StartDrag( Window* pWindow, sal_Int8 nDragSourceActions, IDragTransferableListener* _pListener );
76 
77         static OJoinExchangeData    GetSourceDescription(const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _rxObject);
78         static sal_Bool             isFormatAvailable( const DataFlavorExVector& _rFormats ,SotFormatStringId _nSlotID=SOT_FORMATSTR_ID_SBA_JOIN);
79 
80     protected:
81         virtual void                AddSupportedFormats();
82         virtual sal_Bool            GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
83         virtual void                DragFinished( sal_Int8 nDropAction );
84 
85         static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
86 
87     private:
88         using TransferableHelper::StartDrag;
89     };
90 }
91 #endif // DBAUI_JOINEXCHANGE_HXX
92 
93 
94