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 _SVX_TABWIN_HXX 24 #define _SVX_TABWIN_HXX 25 26 #include <svtools/svtreebx.hxx> 27 #include <vcl/floatwin.hxx> 28 #include <sfx2/basedlgs.hxx> 29 #include <sfx2/childwin.hxx> 30 #include <sfx2/ctrlitem.hxx> 31 #include <com/sun/star/form/XForm.hpp> 32 33 #include <comphelper/propmultiplex.hxx> 34 #include <svtools/transfer.hxx> 35 #include "svx/dbtoolsclient.hxx" 36 37 //================================================================== 38 class FmFieldWin; 39 class SAL_DLLPRIVATE FmFieldWinListBox 40 :public SvTreeListBox 41 { 42 FmFieldWin* pTabWin; 43 44 protected: 45 // virtual void Command( const CommandEvent& rEvt ); 46 47 public: 48 FmFieldWinListBox( FmFieldWin* pParent ); 49 virtual ~FmFieldWinListBox(); 50 51 sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); 52 sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); 53 54 protected: 55 // DragSourceHelper 56 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); 57 58 // SvLBox 59 virtual sal_Bool DoubleClickHdl(); 60 61 using SvLBox::ExecuteDrop; 62 }; 63 64 //======================================================================== 65 class FmFormShell; 66 class SAL_DLLPRIVATE FmFieldWinData 67 { 68 public: 69 FmFieldWinData(); 70 ~FmFieldWinData(); 71 }; 72 73 //======================================================================== 74 class SAL_DLLPRIVATE FmFieldWin :public SfxFloatingWindow 75 ,public SfxControllerItem 76 ,public ::comphelper::OPropertyChangeListener 77 ,public ::svxform::OStaticDataAccessTools 78 { 79 ::osl::Mutex m_aMutex; 80 FmFieldWinListBox* pListBox; 81 FmFieldWinData* pData; 82 ::svxform::SharedConnection 83 m_aConnection; 84 ::rtl::OUString m_aDatabaseName, 85 m_aObjectName; 86 sal_Int32 m_nObjectType; 87 88 ::comphelper::OPropertyChangeMultiplexer* m_pChangeListener; 89 90 public: 91 FmFieldWin(SfxBindings *pBindings, 92 SfxChildWindow *pMgr, Window* pParent); 93 94 virtual ~FmFieldWin(); 95 virtual void Resize(); 96 virtual sal_Bool Close(); 97 virtual void GetFocus(); 98 virtual long PreNotify( NotifyEvent& _rNEvt ); 99 virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, 100 const SfxPoolItem* pState); 101 GetData() const102 FmFieldWinData* GetData() const {return pData;} 103 104 void UpdateContent(FmFormShell*); 105 void UpdateContent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > &); 106 void FillInfo( SfxChildWinInfo& rInfo ) const; 107 GetDatabaseName() const108 const ::rtl::OUString& GetDatabaseName() const { return m_aDatabaseName; } GetConnection() const109 ::svxform::SharedConnection GetConnection() const { return m_aConnection; } GetObjectName() const110 const ::rtl::OUString& GetObjectName() const { return m_aObjectName; } GetObjectType() const111 sal_Int32 GetObjectType() const { return m_nObjectType; } 112 113 sal_Bool createSelectionControls( ); 114 115 protected: 116 // FmXChangeListener 117 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException ); 118 119 protected: GetBindings()120 inline SfxBindings& GetBindings() { return SfxControllerItem::GetBindings(); } GetBindings() const121 inline const SfxBindings& GetBindings() const { return SfxControllerItem::GetBindings(); } 122 123 using SfxFloatingWindow::StateChanged; 124 }; 125 126 //======================================================================== 127 class SAL_DLLPRIVATE FmFieldWinMgr : public SfxChildWindow 128 { 129 public: 130 FmFieldWinMgr(Window *pParent, sal_uInt16 nId, 131 SfxBindings *pBindings, SfxChildWinInfo *pInfo); 132 SFX_DECL_CHILDWINDOW(FmFieldWinMgr); 133 }; 134 135 136 #endif 137 138