Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_SVX_SOURCE_INC_TABWIN_HXX
20 : #define INCLUDED_SVX_SOURCE_INC_TABWIN_HXX
21 :
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>
28 :
29 : #include <comphelper/propmultiplex.hxx>
30 : #include <svtools/transfer.hxx>
31 : #include "svx/dbtoolsclient.hxx"
32 :
33 :
34 : class FmFieldWin;
35 : class FmFieldWinListBox
36 : :public SvTreeListBox
37 : {
38 : FmFieldWin* pTabWin;
39 :
40 : protected:
41 : // virtual void Command( const CommandEvent& rEvt );
42 :
43 : public:
44 : FmFieldWinListBox( FmFieldWin* pParent );
45 : virtual ~FmFieldWinListBox();
46 :
47 : sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
48 : sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
49 :
50 : protected:
51 : // DragSourceHelper
52 : virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE;
53 :
54 : // SvTreeListBox
55 : virtual bool DoubleClickHdl() SAL_OVERRIDE;
56 :
57 : using SvTreeListBox::ExecuteDrop;
58 : };
59 :
60 :
61 : class FmFormShell;
62 : class FmFieldWinData
63 : {
64 : public:
65 : FmFieldWinData();
66 : ~FmFieldWinData();
67 : };
68 :
69 :
70 : class FmFieldWin :public SfxFloatingWindow
71 : ,public SfxControllerItem
72 : ,public ::comphelper::OPropertyChangeListener
73 : ,public ::svxform::OStaticDataAccessTools
74 : {
75 : ::osl::Mutex m_aMutex;
76 : FmFieldWinListBox* pListBox;
77 : FmFieldWinData* pData;
78 : ::svxform::SharedConnection
79 : m_aConnection;
80 : OUString m_aDatabaseName,
81 : m_aObjectName;
82 : sal_Int32 m_nObjectType;
83 :
84 : ::comphelper::OPropertyChangeMultiplexer* m_pChangeListener;
85 :
86 : public:
87 : FmFieldWin(SfxBindings *pBindings,
88 : SfxChildWindow *pMgr, vcl::Window* pParent);
89 :
90 : virtual ~FmFieldWin();
91 : virtual void Resize() SAL_OVERRIDE;
92 : virtual bool Close() SAL_OVERRIDE;
93 : virtual void GetFocus() SAL_OVERRIDE;
94 : virtual bool PreNotify( NotifyEvent& _rNEvt ) SAL_OVERRIDE;
95 : virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
96 : const SfxPoolItem* pState) SAL_OVERRIDE;
97 :
98 : FmFieldWinData* GetData() const {return pData;}
99 :
100 : void UpdateContent(FmFormShell*);
101 : void UpdateContent(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm > &);
102 : void FillInfo( SfxChildWinInfo& rInfo ) const SAL_OVERRIDE;
103 :
104 0 : const OUString& GetDatabaseName() const { return m_aDatabaseName; }
105 0 : ::svxform::SharedConnection GetConnection() const { return m_aConnection; }
106 0 : const OUString& GetObjectName() const { return m_aObjectName; }
107 0 : sal_Int32 GetObjectType() const { return m_nObjectType; }
108 :
109 : bool createSelectionControls( );
110 :
111 : protected:
112 : // FmXChangeListener
113 : virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
114 :
115 : protected:
116 0 : inline SfxBindings& GetBindings() { return SfxControllerItem::GetBindings(); }
117 : inline const SfxBindings& GetBindings() const { return SfxControllerItem::GetBindings(); }
118 :
119 : using SfxFloatingWindow::StateChanged;
120 : };
121 :
122 :
123 0 : class FmFieldWinMgr : public SfxChildWindow
124 : {
125 : public:
126 : FmFieldWinMgr(vcl::Window *pParent, sal_uInt16 nId,
127 : SfxBindings *pBindings, SfxChildWinInfo *pInfo);
128 : SFX_DECL_CHILDWINDOW(FmFieldWinMgr);
129 : };
130 :
131 :
132 : #endif
133 :
134 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|