xref: /trunk/main/svx/source/inc/tabwin.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_TABWIN_HXX
24cdf0e10cSrcweir #define _SVX_TABWIN_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <svtools/svtreebx.hxx>
27cdf0e10cSrcweir #include <vcl/floatwin.hxx>
28cdf0e10cSrcweir #include <sfx2/basedlgs.hxx>
29cdf0e10cSrcweir #include <sfx2/childwin.hxx>
30cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx>
31cdf0e10cSrcweir #include <com/sun/star/form/XForm.hpp>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <comphelper/propmultiplex.hxx>
34cdf0e10cSrcweir #include <svtools/transfer.hxx>
35cdf0e10cSrcweir #include "svx/dbtoolsclient.hxx"
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //==================================================================
38cdf0e10cSrcweir class FmFieldWin;
39cdf0e10cSrcweir class SAL_DLLPRIVATE FmFieldWinListBox
40cdf0e10cSrcweir                     :public SvTreeListBox
41cdf0e10cSrcweir {
42cdf0e10cSrcweir     FmFieldWin* pTabWin;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir protected:
45cdf0e10cSrcweir //  virtual void Command( const CommandEvent& rEvt );
46cdf0e10cSrcweir 
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir     FmFieldWinListBox( FmFieldWin* pParent );
49cdf0e10cSrcweir     virtual ~FmFieldWinListBox();
50cdf0e10cSrcweir 
51cdf0e10cSrcweir     sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
52cdf0e10cSrcweir     sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
53cdf0e10cSrcweir 
54cdf0e10cSrcweir protected:
55cdf0e10cSrcweir     // DragSourceHelper
56cdf0e10cSrcweir     virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     // SvLBox
59cdf0e10cSrcweir     virtual sal_Bool DoubleClickHdl();
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     using SvLBox::ExecuteDrop;
62cdf0e10cSrcweir };
63cdf0e10cSrcweir 
64cdf0e10cSrcweir //========================================================================
65cdf0e10cSrcweir class FmFormShell;
66cdf0e10cSrcweir class SAL_DLLPRIVATE FmFieldWinData
67cdf0e10cSrcweir {
68cdf0e10cSrcweir public:
69cdf0e10cSrcweir     FmFieldWinData();
70cdf0e10cSrcweir     ~FmFieldWinData();
71cdf0e10cSrcweir };
72cdf0e10cSrcweir 
73cdf0e10cSrcweir //========================================================================
74cdf0e10cSrcweir class SAL_DLLPRIVATE FmFieldWin :public SfxFloatingWindow
75cdf0e10cSrcweir                     ,public SfxControllerItem
76cdf0e10cSrcweir                     ,public ::comphelper::OPropertyChangeListener
77cdf0e10cSrcweir                     ,public ::svxform::OStaticDataAccessTools
78cdf0e10cSrcweir {
79cdf0e10cSrcweir     ::osl::Mutex        m_aMutex;
80cdf0e10cSrcweir     FmFieldWinListBox* pListBox;
81cdf0e10cSrcweir     FmFieldWinData*    pData;
82cdf0e10cSrcweir     ::svxform::SharedConnection
83cdf0e10cSrcweir                        m_aConnection;
84cdf0e10cSrcweir     ::rtl::OUString    m_aDatabaseName,
85cdf0e10cSrcweir                        m_aObjectName;
86cdf0e10cSrcweir     sal_Int32          m_nObjectType;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     ::comphelper::OPropertyChangeMultiplexer*   m_pChangeListener;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir public:
91cdf0e10cSrcweir     FmFieldWin(SfxBindings *pBindings,
92cdf0e10cSrcweir                SfxChildWindow *pMgr, Window* pParent);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir     virtual ~FmFieldWin();
95cdf0e10cSrcweir     virtual void Resize();
96cdf0e10cSrcweir     virtual sal_Bool Close();
97cdf0e10cSrcweir     virtual void GetFocus();
98cdf0e10cSrcweir     virtual long PreNotify( NotifyEvent& _rNEvt );
99cdf0e10cSrcweir     virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
100cdf0e10cSrcweir                               const SfxPoolItem* pState);
101cdf0e10cSrcweir 
GetData() const102cdf0e10cSrcweir     FmFieldWinData* GetData()  const {return pData;}
103cdf0e10cSrcweir 
104cdf0e10cSrcweir     void UpdateContent(FmFormShell*);
105cdf0e10cSrcweir     void UpdateContent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > &);
106cdf0e10cSrcweir     void FillInfo( SfxChildWinInfo& rInfo ) const;
107cdf0e10cSrcweir 
GetDatabaseName() const108cdf0e10cSrcweir     const ::rtl::OUString&      GetDatabaseName() const { return m_aDatabaseName; }
GetConnection() const109cdf0e10cSrcweir     ::svxform::SharedConnection GetConnection() const { return m_aConnection; }
GetObjectName() const110cdf0e10cSrcweir     const ::rtl::OUString&      GetObjectName() const { return m_aObjectName; }
GetObjectType() const111cdf0e10cSrcweir     sal_Int32                   GetObjectType() const { return m_nObjectType; }
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     sal_Bool    createSelectionControls( );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir protected:
116cdf0e10cSrcweir     // FmXChangeListener
117cdf0e10cSrcweir     virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir protected:
GetBindings()120cdf0e10cSrcweir     inline          SfxBindings&    GetBindings()       { return SfxControllerItem::GetBindings(); }
GetBindings() const121cdf0e10cSrcweir     inline  const   SfxBindings&    GetBindings() const { return SfxControllerItem::GetBindings(); }
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     using SfxFloatingWindow::StateChanged;
124cdf0e10cSrcweir };
125cdf0e10cSrcweir 
126cdf0e10cSrcweir //========================================================================
127cdf0e10cSrcweir class SAL_DLLPRIVATE FmFieldWinMgr : public SfxChildWindow
128cdf0e10cSrcweir {
129cdf0e10cSrcweir public:
130cdf0e10cSrcweir     FmFieldWinMgr(Window *pParent, sal_uInt16 nId,
131cdf0e10cSrcweir         SfxBindings *pBindings, SfxChildWinInfo *pInfo);
132cdf0e10cSrcweir     SFX_DECL_CHILDWINDOW(FmFieldWinMgr);
133cdf0e10cSrcweir };
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 
136cdf0e10cSrcweir #endif
137