update dev300-m58
[ooovba.git] / svx / source / inc / tabwin.hxx
blobf4a4ecb0b0a983923026c349abb0432ecd50b2e5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tabwin.hxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_TABWIN_HXX
31 #define _SVX_TABWIN_HXX
33 #include <svtools/svtreebx.hxx>
34 #include <vcl/floatwin.hxx>
35 #include <sfx2/basedlgs.hxx>
36 #include <sfx2/childwin.hxx>
37 #include <sfx2/ctrlitem.hxx>
38 #include <com/sun/star/form/XForm.hpp>
40 //#ifndef _SVX_FMTOOLS_HXX
41 //#include "fmtools.hxx"
42 //#endif
43 #include <comphelper/propmultiplex.hxx>
44 #include <svtools/transfer.hxx>
45 #include "svx/dbtoolsclient.hxx"
47 //==================================================================
48 class FmFieldWin;
49 class SAL_DLLPRIVATE FmFieldWinListBox
50 :public SvTreeListBox
52 FmFieldWin* pTabWin;
54 protected:
55 // virtual void Command( const CommandEvent& rEvt );
57 public:
58 FmFieldWinListBox( FmFieldWin* pParent );
59 virtual ~FmFieldWinListBox();
61 sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
62 sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
64 protected:
65 // DragSourceHelper
66 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
68 // SvLBox
69 virtual BOOL DoubleClickHdl();
71 using SvLBox::ExecuteDrop;
74 //========================================================================
75 class FmFormShell;
76 class SAL_DLLPRIVATE FmFieldWinData
78 public:
79 FmFieldWinData();
80 ~FmFieldWinData();
83 //========================================================================
84 class SAL_DLLPRIVATE FmFieldWin :public SfxFloatingWindow
85 ,public SfxControllerItem
86 ,public ::comphelper::OPropertyChangeListener
87 ,public ::svxform::OStaticDataAccessTools
89 ::osl::Mutex m_aMutex;
90 FmFieldWinListBox* pListBox;
91 FmFieldWinData* pData;
92 ::svxform::SharedConnection
93 m_aConnection;
94 ::rtl::OUString m_aDatabaseName,
95 m_aObjectName;
96 sal_Int32 m_nObjectType;
98 ::comphelper::OPropertyChangeMultiplexer* m_pChangeListener;
100 public:
101 FmFieldWin(SfxBindings *pBindings,
102 SfxChildWindow *pMgr, Window* pParent);
104 virtual ~FmFieldWin();
105 virtual void Resize();
106 virtual sal_Bool Close();
107 virtual void GetFocus();
108 virtual long PreNotify( NotifyEvent& _rNEvt );
109 virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
110 const SfxPoolItem* pState);
112 FmFieldWinData* GetData() const {return pData;}
114 void UpdateContent(FmFormShell*);
115 void UpdateContent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > &);
116 void FillInfo( SfxChildWinInfo& rInfo ) const;
118 const ::rtl::OUString& GetDatabaseName() const { return m_aDatabaseName; }
119 ::svxform::SharedConnection GetConnection() const { return m_aConnection; }
120 const ::rtl::OUString& GetObjectName() const { return m_aObjectName; }
121 sal_Int32 GetObjectType() const { return m_nObjectType; }
123 sal_Bool createSelectionControls( );
125 protected:
126 // FmXChangeListener
127 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException );
129 protected:
130 inline SfxBindings& GetBindings() { return SfxControllerItem::GetBindings(); }
131 inline const SfxBindings& GetBindings() const { return SfxControllerItem::GetBindings(); }
133 using SfxFloatingWindow::StateChanged;
136 //========================================================================
137 class SAL_DLLPRIVATE FmFieldWinMgr : public SfxChildWindow
139 public:
140 FmFieldWinMgr(Window *pParent, sal_uInt16 nId,
141 SfxBindings *pBindings, SfxChildWinInfo *pInfo);
142 SFX_DECL_CHILDWINDOW(FmFieldWinMgr);
146 #endif