xref: /aoo42x/main/dbaccess/source/ui/inc/sbagrid.hxx (revision 07a3d7f1)
12e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
32e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
42e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
52e2212a7SAndrew Rist  * distributed with this work for additional information
62e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
72e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
82e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
92e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
102e2212a7SAndrew Rist  *
112e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
122e2212a7SAndrew Rist  *
132e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
142e2212a7SAndrew Rist  * software distributed under the License is distributed on an
152e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
172e2212a7SAndrew Rist  * specific language governing permissions and limitations
182e2212a7SAndrew Rist  * under the License.
192e2212a7SAndrew Rist  *
202e2212a7SAndrew Rist  *************************************************************/
212e2212a7SAndrew Rist 
222e2212a7SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SBA_GRID_HXX
25cdf0e10cSrcweir #define _SBA_GRID_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //	#include <sdb/tools.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef _SVX_FMGRIDCL_HXX
30cdf0e10cSrcweir #include <svx/fmgridcl.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #ifndef _SVX_FMGRIDIF_HXX
34cdf0e10cSrcweir #include <svx/fmgridif.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSER_HPP_
38cdf0e10cSrcweir #include <com/sun/star/sdb/XSQLQueryComposer.hpp>
39cdf0e10cSrcweir #endif
40cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
41cdf0e10cSrcweir #include <com/sun/star/frame/XDispatch.hpp>
42cdf0e10cSrcweir #endif
43cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_URL_HPP_
44cdf0e10cSrcweir #include <com/sun/star/util/URL.hpp>
45cdf0e10cSrcweir #endif
46cdf0e10cSrcweir #ifndef _COMPHELPER_UNO3_HXX_
47cdf0e10cSrcweir #include <comphelper/uno3.hxx>
48cdf0e10cSrcweir #endif
49cdf0e10cSrcweir #ifndef _COMPHELPER_STLTYPES_HXX_
50cdf0e10cSrcweir #include <comphelper/stl_types.hxx>
51cdf0e10cSrcweir #endif
52cdf0e10cSrcweir #ifndef _SBA_MULTIPLEX_HXX
53cdf0e10cSrcweir #include "sbamultiplex.hxx"
54cdf0e10cSrcweir #endif
55cdf0e10cSrcweir #ifndef _SVX_DATACCESSDESCRIPTOR_HXX_
56cdf0e10cSrcweir #include <svx/dataaccessdescriptor.hxx>
57cdf0e10cSrcweir #endif
58cdf0e10cSrcweir #include <queue>
59cdf0e10cSrcweir 
60cdf0e10cSrcweir class SvNumberFormatter;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir namespace dbaui
63cdf0e10cSrcweir {
64cdf0e10cSrcweir 	//------------------------------------------------------------------
65cdf0e10cSrcweir 	struct SbaURLCompare : public ::std::binary_function< ::com::sun::star::util::URL, ::com::sun::star::util::URL, bool>
66cdf0e10cSrcweir 	{
operator ()dbaui::SbaURLCompare67cdf0e10cSrcweir 		bool operator() (const ::com::sun::star::util::URL& x, const ::com::sun::star::util::URL& y) const {return x.Complete == y.Complete ? true : false;}
68cdf0e10cSrcweir 	};
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	struct SbaURLHash
71cdf0e10cSrcweir 	{
operator ()dbaui::SbaURLHash72cdf0e10cSrcweir 		sal_Int32 operator() (const ::com::sun::star::util::URL& x) const {return x.Complete.hashCode();}
73cdf0e10cSrcweir 	};
74cdf0e10cSrcweir 	//==================================================================
75cdf0e10cSrcweir 	// SbaXGridControl
76cdf0e10cSrcweir 	//==================================================================
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	//	class ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > ;
79cdf0e10cSrcweir 	FORWARD_DECLARE_INTERFACE(lang,XMultiServiceFactory)
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	class SbaXStatusMultiplexer;
82cdf0e10cSrcweir 	class SbaXGridControl
83cdf0e10cSrcweir 				:public FmXGridControl
84cdf0e10cSrcweir 				,public ::com::sun::star::frame::XDispatch
85cdf0e10cSrcweir 	{
86cdf0e10cSrcweir 		DECLARE_STL_MAP(::com::sun::star::util::URL, SbaXStatusMultiplexer*, SbaURLCompare,StatusMultiplexerArray);
87cdf0e10cSrcweir 		StatusMultiplexerArray		m_aStatusMultiplexer;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	public:
90cdf0e10cSrcweir 		SbaXGridControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
91cdf0e10cSrcweir 		virtual ~SbaXGridControl();
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 		// UNO
94cdf0e10cSrcweir 		DECLARE_UNO3_DEFAULTS(SbaXGridControl, FmXGridControl);
95cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Any	SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 		// XTypeProvider
98cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
99cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 		// ::com::sun::star::lang::XServiceInfo
102cdf0e10cSrcweir 		::rtl::OUString SAL_CALL getImplementationName() throw();
103cdf0e10cSrcweir 		virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw();
104cdf0e10cSrcweir 		// need by registration
105cdf0e10cSrcweir 		static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
106cdf0e10cSrcweir 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
107cdf0e10cSrcweir 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
108cdf0e10cSrcweir 				SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 		// ::com::sun::star::frame::XDispatch
111cdf0e10cSrcweir 		virtual void SAL_CALL dispatch(const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs) throw( ::com::sun::star::uno::RuntimeException );
112cdf0e10cSrcweir 		virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
113cdf0e10cSrcweir 		virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 		// ::com::sun::star::lang::XComponent
116cdf0e10cSrcweir 		virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 		virtual void SAL_CALL createPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > & rToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > & rParentPeer) throw( ::com::sun::star::uno::RuntimeException );
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	protected:
121cdf0e10cSrcweir 		virtual FmXGridPeer*	imp_CreatePeer(Window* pParent);
122cdf0e10cSrcweir 	};
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	//==================================================================
125cdf0e10cSrcweir 	// SbaXGridPeer
126cdf0e10cSrcweir 	//==================================================================
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	class SbaXGridPeer
129cdf0e10cSrcweir 				:public FmXGridPeer
130cdf0e10cSrcweir 				,public ::com::sun::star::frame::XDispatch
131cdf0e10cSrcweir 	{
132cdf0e10cSrcweir 		::cppu::OMultiTypeInterfaceContainerHelperVar< ::com::sun::star::util::URL,SbaURLHash , SbaURLCompare>	m_aStatusListeners;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	public:
135cdf0e10cSrcweir 		SbaXGridPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
136cdf0e10cSrcweir 		virtual ~SbaXGridPeer();
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 		// UNO
acquire()139cdf0e10cSrcweir 		virtual void SAL_CALL  acquire() throw() { FmXGridPeer::acquire(); }
release()140cdf0e10cSrcweir 		virtual void SAL_CALL release() throw() { FmXGridPeer::release(); }
141cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Any	SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 		static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
146cdf0e10cSrcweir 		sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 > & rId ) throw (::com::sun::star::uno::RuntimeException);
147cdf0e10cSrcweir 		static SbaXGridPeer* getImplementation(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rxIFace);
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 		// ::com::sun::star::frame::XDispatch
150cdf0e10cSrcweir 		virtual void SAL_CALL dispatch(const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs) throw( ::com::sun::star::uno::RuntimeException );
151cdf0e10cSrcweir 		virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
152cdf0e10cSrcweir 		virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
153cdf0e10cSrcweir 
154cdf0e10cSrcweir 		// ::com::sun::star::frame::XDispatchProvider
155cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >  SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( ::com::sun::star::uno::RuntimeException );
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 		// ::com::sun::star::lang::XComponent
158cdf0e10cSrcweir 		virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException );
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 	protected:
161cdf0e10cSrcweir 		virtual FmGridControl*	imp_CreateControl(Window* pParent, WinBits nStyle);
162cdf0e10cSrcweir #if defined(_MSC_VER) && (_MSC_VER >= 1310 )
163cdf0e10cSrcweir 		typedef ::com::sun::star::frame::XStatusListener xstlist_type;
164cdf0e10cSrcweir 		typedef ::com::sun::star::uno::Reference< xstlist_type > xlistener_type;
165cdf0e10cSrcweir 		void NotifyStatusChanged(const ::com::sun::star::util::URL& aUrl, const xlistener_type & xControl = xlistener_type() );
166cdf0e10cSrcweir #else
167cdf0e10cSrcweir 		void NotifyStatusChanged(const ::com::sun::star::util::URL& aUrl, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > ());
168cdf0e10cSrcweir #endif // # _MSC_VER>=1310
169cdf0e10cSrcweir 
170cdf0e10cSrcweir 	private:
171cdf0e10cSrcweir 		// for asny execution of XDispatch::dispatch
172cdf0e10cSrcweir 		struct DispatchArgs
173cdf0e10cSrcweir 		{
174cdf0e10cSrcweir 			::com::sun::star::util::URL													aURL;
175cdf0e10cSrcweir 			::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >	aArgs;
176cdf0e10cSrcweir 		};
177cdf0e10cSrcweir 		::std::queue< DispatchArgs >	m_aDispatchArgs;
178cdf0e10cSrcweir 		DECL_LINK( OnDispatchEvent, void* );
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 		// for dynamic states of our 4 dispatchable URLs
181cdf0e10cSrcweir 		enum DispatchType
182cdf0e10cSrcweir 		{
183cdf0e10cSrcweir 			dtBrowserAttribs,
184cdf0e10cSrcweir 			dtRowHeight,
185cdf0e10cSrcweir 			dtColumnAttribs,
186cdf0e10cSrcweir 			dtColumnWidth,
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 			dtUnknown
189cdf0e10cSrcweir 		};
190cdf0e10cSrcweir 		DispatchType classifyDispatchURL( const ::com::sun::star::util::URL& _rURL );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir 		DECLARE_STL_STDKEY_MAP( DispatchType, sal_Bool, MapDispatchToBool );
193cdf0e10cSrcweir 		MapDispatchToBool	m_aDispatchStates;
194cdf0e10cSrcweir 	};
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 	//==================================================================
197cdf0e10cSrcweir 	// SbaGridHeader
198cdf0e10cSrcweir 	//==================================================================
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	class SbaGridHeader
201cdf0e10cSrcweir 				:public FmGridHeader
202cdf0e10cSrcweir 				,public DragSourceHelper
203cdf0e10cSrcweir 	{
204cdf0e10cSrcweir 	public:
205cdf0e10cSrcweir 		SbaGridHeader(BrowseBox* pParent, WinBits nWinBits = WB_STDHEADERBAR | WB_DRAG);
206cdf0e10cSrcweir 
207cdf0e10cSrcweir 	protected:
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 		// FmGridHeader overridables
210cdf0e10cSrcweir 		virtual void	PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMenu);
211cdf0e10cSrcweir 		virtual	void	PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMenu& rMenu, sal_uInt16 nExecutionResult);
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 	private:
214cdf0e10cSrcweir 		// DragSourceHelper overridables
215cdf0e10cSrcweir 		virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel );
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 		// Window overridables
218cdf0e10cSrcweir 		virtual void MouseButtonDown( const MouseEvent& rMEvt );
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 		sal_Bool ImplStartColumnDrag(sal_Int8 _nAction, const Point& _rMousePos);
221cdf0e10cSrcweir 
222cdf0e10cSrcweir     private:
223cdf0e10cSrcweir         using FmGridHeader::StartDrag;
224cdf0e10cSrcweir 	};
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 	// =========================================================================
227cdf0e10cSrcweir 	// interfaces for communication between the vcl grid control and a controller
228cdf0e10cSrcweir 	// -------------------------------------------------------------------------
229cdf0e10cSrcweir 	class SbaGridListener
230cdf0e10cSrcweir 	{
231cdf0e10cSrcweir 	public:
232cdf0e10cSrcweir 		virtual void RowChanged()		= 0;
233cdf0e10cSrcweir 		virtual void ColumnChanged()	= 0;
234cdf0e10cSrcweir 		virtual void SelectionChanged()	= 0;
235cdf0e10cSrcweir 		virtual void CellActivated()	= 0;
236cdf0e10cSrcweir 		virtual void CellDeactivated()	= 0;
237cdf0e10cSrcweir 		virtual void BeforeDrop()		= 0;
238cdf0e10cSrcweir 		virtual void AfterDrop()		= 0;
239cdf0e10cSrcweir 	};
240cdf0e10cSrcweir 
241cdf0e10cSrcweir 	//==================================================================
242cdf0e10cSrcweir 	// SbaGridControl
243cdf0e10cSrcweir 	//==================================================================
244cdf0e10cSrcweir 	//------------------------------------------------------------------
245cdf0e10cSrcweir 	class UnoDataBrowserController;
246cdf0e10cSrcweir 	class SbaGridControl : public FmGridControl
247cdf0e10cSrcweir 	{
248cdf0e10cSrcweir 		friend class SbaGridHeader;
249cdf0e10cSrcweir 		friend class SbaXGridPeer;
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 	// Attributes
252cdf0e10cSrcweir 	protected:
253cdf0e10cSrcweir 		::svx::ODataAccessDescriptor	m_aDataDescriptor;
254cdf0e10cSrcweir 		SbaGridListener*	            m_pMasterListener;
255cdf0e10cSrcweir 
256cdf0e10cSrcweir 		sal_Int32			            m_nAsyncDropEvent;
257cdf0e10cSrcweir 
258cdf0e10cSrcweir 		sal_uInt16                          m_nCurrentActionColId;
259cdf0e10cSrcweir 			// ui actions (e.g. a context menu) may be performed on columns which aren't the current one
260cdf0e10cSrcweir 			// and aren't selected, so we have to track this column id
261cdf0e10cSrcweir 
262cdf0e10cSrcweir 		sal_Bool	                    m_bActivatingForDrop;
263cdf0e10cSrcweir 	// Attribute Access
264cdf0e10cSrcweir 	public:
GetCurrentActionColumn() const265cdf0e10cSrcweir 		sal_uInt16	GetCurrentActionColumn() const	{ return m_nCurrentActionColId; }
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	public:
268cdf0e10cSrcweir 		SbaGridControl(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >,Window* pParent, FmXGridPeer* _pPeer, WinBits nBits = WB_TABSTOP);
269cdf0e10cSrcweir 		virtual ~SbaGridControl();
270cdf0e10cSrcweir 
271cdf0e10cSrcweir 		virtual void Command( const CommandEvent& rCEvt );
272cdf0e10cSrcweir 		virtual void Select();
273cdf0e10cSrcweir 
SetMasterListener(SbaGridListener * pListener)274cdf0e10cSrcweir 		void SetMasterListener(SbaGridListener* pListener)	{ m_pMasterListener = pListener; }
275cdf0e10cSrcweir 
276cdf0e10cSrcweir 		virtual void ActivateCell(long nRow, sal_uInt16	nCol, sal_Bool bSetCellFocus = sal_True);
277cdf0e10cSrcweir 		virtual void DeactivateCell(sal_Bool bUpdate = sal_True);
ActivateCell()278cdf0e10cSrcweir 		void ActivateCell() { FmGridControl::ActivateCell(); }
279cdf0e10cSrcweir 
IsAllSelected() const280cdf0e10cSrcweir 		sal_Bool IsAllSelected() const { return (GetSelectRowCount() == GetRowCount()) && (GetRowCount() > 0); }
281cdf0e10cSrcweir 
GetHeaderBar() const282cdf0e10cSrcweir 		HeaderBar* GetHeaderBar() const { return FmGridControl::GetHeaderBar(); }
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 		/** return the description of the specified object.
285cdf0e10cSrcweir 			@param	eObjType
286cdf0e10cSrcweir 				The type to ask for
287cdf0e10cSrcweir 			@param	_nPosition
288*07a3d7f1SPedro Giffuni 				The position of a tablecell (index position), header bar  column/row cell
289cdf0e10cSrcweir 			@return
290cdf0e10cSrcweir 				The description of the specified object.
291cdf0e10cSrcweir 		*/
292cdf0e10cSrcweir 		virtual ::rtl::OUString GetAccessibleObjectDescription( ::svt::AccessibleBrowseBoxObjType eObjType,sal_Int32 _nPosition = -1) const;
293cdf0e10cSrcweir 
294cdf0e10cSrcweir 		virtual void DeleteSelectedRows();
295cdf0e10cSrcweir         /** copies the currently selected rows to the clipboard
296cdf0e10cSrcweir             @precond
297cdf0e10cSrcweir                 at least one row is selected
298cdf0e10cSrcweir         */
299cdf0e10cSrcweir         void CopySelectedRowsToClipboard();
300cdf0e10cSrcweir 
301cdf0e10cSrcweir 
302cdf0e10cSrcweir 	protected:
303cdf0e10cSrcweir 		// DragSourceHelper overridables
304cdf0e10cSrcweir 		virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel );
305cdf0e10cSrcweir 
306cdf0e10cSrcweir 		// BrowseBox overridables
307cdf0e10cSrcweir 		virtual void	CursorMoved();
308cdf0e10cSrcweir 		virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt );
309cdf0e10cSrcweir 		virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt );
310cdf0e10cSrcweir 		virtual void	MouseButtonDown( const BrowserMouseEvent& rMEvt);
311cdf0e10cSrcweir 
312cdf0e10cSrcweir 		// EditBrowseBox overridables
313cdf0e10cSrcweir 		virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent);
314cdf0e10cSrcweir 		virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol);
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 		// DbGridControl overridables
317cdf0e10cSrcweir 		virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu);
318cdf0e10cSrcweir 		virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu& rMenu, sal_uInt16 nExecutionResult);
319cdf0e10cSrcweir 
320cdf0e10cSrcweir         // DbGridControl overridables
321cdf0e10cSrcweir 	    virtual void onRowChange();
322cdf0e10cSrcweir         virtual void onColumnChange();
323cdf0e10cSrcweir 
324cdf0e10cSrcweir 		// my own overridables
325cdf0e10cSrcweir 		virtual void BeforeDrop();
326cdf0e10cSrcweir 		virtual void AfterDrop();
327cdf0e10cSrcweir 
328cdf0e10cSrcweir 		// get a fields property set from a model pos
329cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  getField(sal_uInt16 nModelPos);
330cdf0e10cSrcweir 
331cdf0e10cSrcweir 		// get my data source
332cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  getDataSource() const;
333cdf0e10cSrcweir 
334cdf0e10cSrcweir 		// drag events
335cdf0e10cSrcweir 		virtual void DoColumnDrag(sal_uInt16 nColumnPos);
336cdf0e10cSrcweir 		virtual void DoRowDrag(sal_Int16 nRowPos);
337cdf0e10cSrcweir 		virtual void DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos);
338cdf0e10cSrcweir 
339cdf0e10cSrcweir 		void SetBrowserAttrs();
340cdf0e10cSrcweir 		void SetColWidth(sal_uInt16 nColId);
341cdf0e10cSrcweir 		void SetRowHeight();
342cdf0e10cSrcweir 		void SetColAttrs(sal_uInt16 nColId);
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 		SvNumberFormatter* GetDatasourceFormatter();
345cdf0e10cSrcweir 
346cdf0e10cSrcweir 		DECL_LINK(AsynchDropEvent, void*);
347cdf0e10cSrcweir 
348cdf0e10cSrcweir 	private:
349cdf0e10cSrcweir 		sal_Bool	IsReadOnlyDB() const;
350cdf0e10cSrcweir         void implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag );
351cdf0e10cSrcweir 
352cdf0e10cSrcweir     private:
353cdf0e10cSrcweir         using FmGridControl::AcceptDrop;
354cdf0e10cSrcweir         using FmGridControl::ExecuteDrop;
355cdf0e10cSrcweir         using FmGridControl::MouseButtonDown;
356cdf0e10cSrcweir 	};
357cdf0e10cSrcweir }
358cdf0e10cSrcweir #endif // _SBA_GRID_HXX
359cdf0e10cSrcweir 
360