1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVX_SOURCE_INC_TABWIN_HXX
20 #define INCLUDED_SVX_SOURCE_INC_TABWIN_HXX
22 #include <svtools/treelistbox.hxx>
23 #include <vcl/floatwin.hxx>
24 #include <sfx2/basedlgs.hxx>
25 #include <sfx2/childwin.hxx>
26 #include <sfx2/ctrlitem.hxx>
27 #include <com/sun/star/form/XForm.hpp>
29 #include <comphelper/propmultiplex.hxx>
30 #include <svtools/transfer.hxx>
31 #include <connectivity/dbtools.hxx>
35 class FmFieldWinListBox
38 VclPtr
<FmFieldWin
> pTabWin
;
41 // virtual void Command( const CommandEvent& rEvt );
44 FmFieldWinListBox( FmFieldWin
* pParent
);
45 virtual ~FmFieldWinListBox();
46 virtual void dispose() SAL_OVERRIDE
;
48 sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
) SAL_OVERRIDE
;
49 sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
) SAL_OVERRIDE
;
53 virtual void StartDrag( sal_Int8 nAction
, const Point
& rPosPixel
) SAL_OVERRIDE
;
56 virtual bool DoubleClickHdl() SAL_OVERRIDE
;
58 using SvTreeListBox::ExecuteDrop
;
71 class FmFieldWin
:public SfxFloatingWindow
72 ,public SfxControllerItem
73 ,public ::comphelper::OPropertyChangeListener
75 ::osl::Mutex m_aMutex
;
76 VclPtr
<FmFieldWinListBox
> pListBox
;
77 FmFieldWinData
* pData
;
78 ::dbtools::SharedConnection
80 OUString m_aDatabaseName
,
82 sal_Int32 m_nObjectType
;
84 ::comphelper::OPropertyChangeMultiplexer
* m_pChangeListener
;
87 FmFieldWin(SfxBindings
*pBindings
,
88 SfxChildWindow
*pMgr
, vcl::Window
* pParent
);
90 virtual ~FmFieldWin();
91 virtual void dispose() SAL_OVERRIDE
;
92 virtual void Resize() SAL_OVERRIDE
;
93 virtual bool Close() SAL_OVERRIDE
;
94 virtual void GetFocus() SAL_OVERRIDE
;
95 virtual bool PreNotify( NotifyEvent
& _rNEvt
) SAL_OVERRIDE
;
96 virtual void StateChanged(sal_uInt16 nSID
, SfxItemState eState
,
97 const SfxPoolItem
* pState
) SAL_OVERRIDE
;
99 FmFieldWinData
* GetData() const {return pData
;}
101 void UpdateContent(FmFormShell
*);
102 void UpdateContent(const ::com::sun::star::uno::Reference
< ::com::sun::star::form::XForm
> &);
103 void FillInfo( SfxChildWinInfo
& rInfo
) const SAL_OVERRIDE
;
105 const OUString
& GetDatabaseName() const { return m_aDatabaseName
; }
106 ::dbtools::SharedConnection
GetConnection() const { return m_aConnection
; }
107 const OUString
& GetObjectName() const { return m_aObjectName
; }
108 sal_Int32
GetObjectType() const { return m_nObjectType
; }
110 bool createSelectionControls( );
114 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent
& evt
) throw( ::com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
117 inline SfxBindings
& GetBindings() { return SfxControllerItem::GetBindings(); }
118 inline const SfxBindings
& GetBindings() const { return SfxControllerItem::GetBindings(); }
120 using SfxFloatingWindow::StateChanged
;
124 class FmFieldWinMgr
: public SfxChildWindow
127 FmFieldWinMgr(vcl::Window
*pParent
, sal_uInt16 nId
,
128 SfxBindings
*pBindings
, SfxChildWinInfo
*pInfo
);
129 SFX_DECL_CHILDWINDOW(FmFieldWinMgr
);
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */