sync master with lastest vba changes
[ooovba.git] / reportdesign / source / ui / inc / AddField.hxx
blobc2ed88b3774022e87bad516c821983604b23c2ee
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: AddField.hxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 #ifndef RPTUI_ADDFIELDWINDOW_HXX
32 #define RPTUI_ADDFIELDWINDOW_HXX
34 #include <com/sun/star/frame/XDispatch.hpp>
35 #include <com/sun/star/container/XNameAccess.hpp>
36 #include <com/sun/star/sdbc/XConnection.hpp>
37 #include <com/sun/star/frame/XDispatch.hpp>
38 #include <svtools/transfer.hxx>
39 #include <com/sun/star/container/XNameAccess.hpp>
40 #include <com/sun/star/sdbc/XConnection.hpp>
41 #include <svtools/svtreebx.hxx>
42 #include <svtools/transfer.hxx>
43 #include <vcl/floatwin.hxx>
44 #include <comphelper/propmultiplex.hxx>
45 #include <comphelper/containermultiplexer.hxx>
46 #include <vcl/button.hxx>
48 #include <svx/dataaccessdescriptor.hxx>
49 #include "cppuhelper/basemutex.hxx"
50 #include <dbaccess/ToolBoxHelper.hxx>
51 #include <vcl/toolbox.hxx>
53 #include <rtl/ref.hxx>
55 namespace rptui
57 //==================================================================
58 class OAddFieldWindow;
59 class OAddFieldWindowListBox;
60 //========================================================================
61 class OAddFieldWindow :public FloatingWindow
62 , public ::cppu::BaseMutex
63 , public ::comphelper::OPropertyChangeListener
64 , public ::comphelper::OContainerListener
65 , public dbaui::OToolBoxHelper
67 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xHoldAlive;
68 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns;
69 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xRowSet;
71 ToolBox m_aActions;
73 ::std::auto_ptr<OAddFieldWindowListBox> m_pListBox;
75 PushButton m_aInsertButton;
76 Link m_aCreateLink;
77 ::rtl::OUString m_aCommandName;
78 ::rtl::OUString m_sFilter;
79 sal_Int32 m_nCommandType;
80 sal_Bool m_bEscapeProcessing;
81 ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pChangeListener;
82 ::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
84 DECL_LINK( OnDoubleClickHdl, void* );
85 DECL_LINK( OnSelectHdl, void* );
86 DECL_LINK( OnSortAction, ToolBox* );
88 OAddFieldWindow(const OAddFieldWindow&);
89 void operator =(const OAddFieldWindow&);
90 public:
91 OAddFieldWindow(Window* pParent
92 , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xRowSet);
94 virtual ~OAddFieldWindow();
95 virtual void Resize();
96 virtual void GetFocus();
97 virtual long PreNotify( NotifyEvent& _rNEvt );
99 inline const ::rtl::OUString& GetCommand() const { return m_aCommandName; }
100 inline sal_Int32 GetCommandType() const { return m_nCommandType; }
101 inline sal_Bool GetEscapeProcessing() const { return m_bEscapeProcessing; }
102 inline void SetCreateHdl(const Link& _aCreateLink) { m_aCreateLink = _aCreateLink; }
104 inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getColumns() const { return m_xColumns; }
105 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() const;
107 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getSelectedFieldDescriptors();
109 /** will be called when the id of the image list is needed.
110 @param _eBitmapSet
111 <svtools/imgdef.hxx>
112 @param _bHiContast
113 <TRUE/> when in high contrast mode.
115 virtual ImageList getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const;
117 /** will be called when the controls need to be resized.
119 virtual void resizeControls(const Size& _rDiff);
121 /// Updates the current field list
122 void Update();
124 /** fills the descriptor with the column name, column object, command and command type
126 * \param _pSelected the currently selected
127 * \param _rDescriptor the descriptor will be filled
129 void fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessDescriptor& _rDescriptor);
131 private:
132 // FmXChangeListener
133 virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException );
134 // OContainerListener
135 virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
136 virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
137 virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
139 //==============================================================================
140 } // rptui
141 //==============================================================================
142 #endif // RPTUI_ADDFIELDWINDOW_HXX