xref: /aoo41x/main/dbaccess/source/ui/inc/brwctrlr.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _SBA_BWRCTRLR_HXX
29*cdf0e10cSrcweir #define _SBA_BWRCTRLR_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "genericcontroller.hxx"
32*cdf0e10cSrcweir #include "moduledbu.hxx"
33*cdf0e10cSrcweir #include "brwview.hxx"
34*cdf0e10cSrcweir #include "sbagrid.hxx"
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir /** === begin UNO includes === **/
37*cdf0e10cSrcweir #include <com/sun/star/form/XLoadable.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/container/XContainerListener.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/sdb/XSQLErrorListener.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/sdbc/XRowSet.hpp>
41*cdf0e10cSrcweir #include <com/sun/star/form/XResetListener.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/form/XDatabaseParameterListener.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/form/XConfirmDeleteListener.hpp>
44*cdf0e10cSrcweir #include <com/sun/star/form/XFormComponent.hpp>
45*cdf0e10cSrcweir #include <com/sun/star/awt/XFocusListener.hpp>
46*cdf0e10cSrcweir #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
47*cdf0e10cSrcweir #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
48*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyChangeListener.hpp>
49*cdf0e10cSrcweir #include <com/sun/star/frame/XModule.hpp>
50*cdf0e10cSrcweir /** === end UNO includes === **/
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir #include <vcl/timer.hxx>
53*cdf0e10cSrcweir #include <svtools/transfer.hxx>
54*cdf0e10cSrcweir #include <osl/mutex.hxx>
55*cdf0e10cSrcweir #include <vos/thread.hxx>
56*cdf0e10cSrcweir #include <cppuhelper/implbase9.hxx>
57*cdf0e10cSrcweir #include <svtools/cliplistener.hxx>
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir class ResMgr;
60*cdf0e10cSrcweir struct FmFoundRecordInformation;
61*cdf0e10cSrcweir struct FmSearchContext;
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir namespace dbtools
64*cdf0e10cSrcweir {
65*cdf0e10cSrcweir     class SQLExceptionInfo;
66*cdf0e10cSrcweir }
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir namespace dbaui
69*cdf0e10cSrcweir {
70*cdf0e10cSrcweir 	// =========================================================================
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir     typedef ::cppu::ImplInheritanceHelper9  <   OGenericUnoController
73*cdf0e10cSrcweir                                             ,   ::com::sun::star::sdb::XSQLErrorListener
74*cdf0e10cSrcweir                                             ,   ::com::sun::star::form::XDatabaseParameterListener
75*cdf0e10cSrcweir                                             ,   ::com::sun::star::form::XConfirmDeleteListener
76*cdf0e10cSrcweir                                             ,   ::com::sun::star::form::XLoadListener
77*cdf0e10cSrcweir                                             ,   ::com::sun::star::form::XResetListener
78*cdf0e10cSrcweir                                             ,   ::com::sun::star::awt::XFocusListener
79*cdf0e10cSrcweir                                             ,   ::com::sun::star::container::XContainerListener
80*cdf0e10cSrcweir                                             ,   ::com::sun::star::beans::XPropertyChangeListener
81*cdf0e10cSrcweir                                             ,	::com::sun::star::frame::XModule
82*cdf0e10cSrcweir                                             >   SbaXDataBrowserController_Base;
83*cdf0e10cSrcweir 
84*cdf0e10cSrcweir 	class SbaXDataBrowserController :public SbaXDataBrowserController_Base
85*cdf0e10cSrcweir 					                ,public SbaGridListener
86*cdf0e10cSrcweir 	{
87*cdf0e10cSrcweir 	// ==========
88*cdf0e10cSrcweir 	// attributes
89*cdf0e10cSrcweir 	private:
90*cdf0e10cSrcweir 		// for implementing the XFormController
91*cdf0e10cSrcweir 		class FormControllerImpl;
92*cdf0e10cSrcweir 		friend class FormControllerImpl;
93*cdf0e10cSrcweir         OModuleClient                                                            m_aModuleClient;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > 			m_xRowSet;		// our rowset
96*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier >	m_xColumnsSupplier; // queried from the rowset member
97*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >			m_xLoadable;		// queried from the rowset member as well
98*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > 		m_xGridModel;	// the model of our grid
99*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > 	m_xFormatter;	// a number formatter working with the connection's NumberFormatsSupplier
100*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >			m_xFormControllerImpl;
101*cdf0e10cSrcweir 		mutable ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >
102*cdf0e10cSrcweir                                                                                         m_xParser;		// for sorting 'n filtering
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir         sal_Int32               m_nRowSetPrivileges;    // cached Privileges property of m_xRowSet
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir 		AutoTimer				m_aInvalidateClipboard;				// for testing the state of the CUT/COPY/PASTE-slots
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir 		TransferableDataHelper	m_aSystemClipboard;		// content of the clipboard
109*cdf0e10cSrcweir 		TransferableClipboardListener*
110*cdf0e10cSrcweir 								m_pClipbordNotifier;	// notifier for changes in the clipboard
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir 		::osl::Mutex			m_aAsyncLoadSafety;		// for multi-thread access to our members
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 		OAsyncronousLink		m_aAsyncGetCellFocus;
115*cdf0e10cSrcweir         OAsyncronousLink        m_aAsyncDisplayError;
116*cdf0e10cSrcweir         ::dbtools::SQLExceptionInfo m_aCurrentError;
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 		String					m_sStateSaveRecord;
119*cdf0e10cSrcweir 		String					m_sStateUndoRecord;
120*cdf0e10cSrcweir         ::rtl::OUString         m_sModuleIdentifier;
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 		// members for asynchronous load operations
123*cdf0e10cSrcweir 		FormControllerImpl*		m_pFormControllerImpl;	// implementing the XFormController
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir 		sal_uLong					m_nPendingLoadFinished;			// the event used to tell ourself that the load is finished
126*cdf0e10cSrcweir 		sal_uInt16				m_nFormActionNestingLevel;		// see enter-/leaveFormAction
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir 		sal_Bool				m_bLoadCanceled : 1;			// the load was canceled somehow
129*cdf0e10cSrcweir 		sal_Bool				m_bClosingKillOpen : 1;			// are we killing the load thread because we are to be suspended ?
130*cdf0e10cSrcweir         bool                    m_bCannotSelectUnfiltered : 1;  // recieved an DATA_CANNOT_SELECT_UNFILTERED error
131*cdf0e10cSrcweir 
132*cdf0e10cSrcweir 	protected:
133*cdf0e10cSrcweir 		class FormErrorHelper
134*cdf0e10cSrcweir 		{
135*cdf0e10cSrcweir 			SbaXDataBrowserController*	m_pOwner;
136*cdf0e10cSrcweir 		public:
137*cdf0e10cSrcweir 			FormErrorHelper(SbaXDataBrowserController* pOwner) : m_pOwner(pOwner) { m_pOwner->enterFormAction(); }
138*cdf0e10cSrcweir 			virtual ~FormErrorHelper() { m_pOwner->leaveFormAction(); }
139*cdf0e10cSrcweir 		};
140*cdf0e10cSrcweir 		friend class FormErrorHelper;
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir 	// ================
143*cdf0e10cSrcweir 	// attribute access
144*cdf0e10cSrcweir 	protected:
145*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > 			getRowSet()			const	{ return m_xRowSet; }
146*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XColumnsSupplier >	getColumnsSupplier()const	{ return m_xColumnsSupplier; }
147*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >			getLoadable()		const	{ return m_xLoadable; }
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > 		getFormComponent()	const	{ return m_xGridModel; }
150*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > 		getControlModel()	const	{ return ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > (m_xGridModel, ::com::sun::star::uno::UNO_QUERY); }
151*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > 	getNumberFormatter()const	{ return m_xFormatter; }
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir 		sal_Bool	isValid() const			{ return m_xRowSet.is() && m_xGridModel.is(); }
154*cdf0e10cSrcweir 		sal_Bool	isValidCursor() const;	// checks the ::com::sun::star::data::XDatabaseCursor-interface of m_xRowSet
155*cdf0e10cSrcweir 		sal_Bool	isLoaded() const;
156*cdf0e10cSrcweir 		sal_Bool	loadingCancelled() const { return m_bLoadCanceled; }
157*cdf0e10cSrcweir         void        onStartLoading( const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >& _rxLoadable );
158*cdf0e10cSrcweir 		void		setLoadingCancelled()	{ m_bLoadCanceled = sal_True; }
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir 		const TransferableDataHelper&
161*cdf0e10cSrcweir 			getViewClipboard() const { return m_aSystemClipboard; }
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir 	public:
164*cdf0e10cSrcweir 		SbaXDataBrowserController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM);
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 		UnoDataBrowserView* getBrowserView() const { return static_cast< UnoDataBrowserView*>(getView()); }
167*cdf0e10cSrcweir 		// late construction
168*cdf0e10cSrcweir 		virtual sal_Bool Construct(Window* pParent);
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir 		// UNO
171*cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Any	SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir 		// XTypeProvider
174*cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
175*cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir 		// ::com::sun::star::lang::XEventListener
178*cdf0e10cSrcweir 		virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir 		// ::com::sun::star::util::XModifyListener
181*cdf0e10cSrcweir 		virtual void SAL_CALL modified(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir 		// ::com::sun::star::container::XContainerListener
184*cdf0e10cSrcweir 		virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
185*cdf0e10cSrcweir 		virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
186*cdf0e10cSrcweir 		virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir 		// XPropertyChangeListener
189*cdf0e10cSrcweir 		virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir         // XModule
192*cdf0e10cSrcweir         virtual void SAL_CALL setIdentifier( const ::rtl::OUString& Identifier ) throw (::com::sun::star::uno::RuntimeException);
193*cdf0e10cSrcweir         virtual ::rtl::OUString SAL_CALL getIdentifier(  ) throw (::com::sun::star::uno::RuntimeException);
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir 		// ::com::sun::star::awt::XFocusListener
196*cdf0e10cSrcweir 		virtual void SAL_CALL focusGained(const ::com::sun::star::awt::FocusEvent& e) throw( ::com::sun::star::uno::RuntimeException );
197*cdf0e10cSrcweir 		virtual void SAL_CALL focusLost(const ::com::sun::star::awt::FocusEvent& e) throw( ::com::sun::star::uno::RuntimeException );
198*cdf0e10cSrcweir 
199*cdf0e10cSrcweir 		// ::com::sun::star::frame::XController
200*cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException );
201*cdf0e10cSrcweir 
202*cdf0e10cSrcweir 		// ::com::sun::star::lang::XComponent
203*cdf0e10cSrcweir 		virtual void		SAL_CALL disposing();
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir 		// ::com::sun::star::frame::XFrameActionListener
206*cdf0e10cSrcweir 		virtual void		SAL_CALL frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException );
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir 		// ::com::sun::star::sdb::XSQLErrorListener
209*cdf0e10cSrcweir 		virtual void		SAL_CALL errorOccured(const ::com::sun::star::sdb::SQLErrorEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException );
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir 		// ::com::sun::star::form::XDatabaseParameterListener
212*cdf0e10cSrcweir 		virtual sal_Bool	SAL_CALL approveParameter(const ::com::sun::star::form::DatabaseParameterEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException );
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir 		// ::com::sun::star::form::XConfirmDeleteListener
215*cdf0e10cSrcweir 		virtual sal_Bool	SAL_CALL confirmDelete(const ::com::sun::star::sdb::RowChangeEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException );
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir 		// ::com::sun::star::form::XLoadListener
218*cdf0e10cSrcweir 		virtual void SAL_CALL loaded(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
219*cdf0e10cSrcweir 		virtual void SAL_CALL unloading(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
220*cdf0e10cSrcweir 		virtual void SAL_CALL unloaded(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
221*cdf0e10cSrcweir 		virtual void SAL_CALL reloading(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
222*cdf0e10cSrcweir 		virtual void SAL_CALL reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException );
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir 		// ::com::sun::star::form::XResetListener
225*cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL approveReset(const ::com::sun::star::lang::EventObject& rEvent) throw( ::com::sun::star::uno::RuntimeException );
226*cdf0e10cSrcweir 		virtual void SAL_CALL resetted(const ::com::sun::star::lang::EventObject& rEvent) throw( ::com::sun::star::uno::RuntimeException );
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir 		// SbaGridListener
229*cdf0e10cSrcweir 		virtual void RowChanged();
230*cdf0e10cSrcweir 		virtual void ColumnChanged();
231*cdf0e10cSrcweir 		virtual void SelectionChanged();
232*cdf0e10cSrcweir 		virtual void CellActivated();
233*cdf0e10cSrcweir 		virtual void CellDeactivated();
234*cdf0e10cSrcweir 		virtual void BeforeDrop();
235*cdf0e10cSrcweir 		virtual void AfterDrop();
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir     public:
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir 	protected:
240*cdf0e10cSrcweir 		virtual ~SbaXDataBrowserController();
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir         // all the features which should be handled by this class
243*cdf0e10cSrcweir 		virtual void			describeSupportedFeatures();
244*cdf0e10cSrcweir 		// state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot.
245*cdf0e10cSrcweir 		virtual FeatureState	GetState(sal_uInt16 nId) const;
246*cdf0e10cSrcweir 		// execute a feature
247*cdf0e10cSrcweir 		virtual void			Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs);
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir 		virtual void    startFrameListening( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame );
250*cdf0e10cSrcweir 		virtual void    stopFrameListening( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame );
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >  CreateForm();
253*cdf0e10cSrcweir 			// our default implementation simply instantiates a stardiv.one.form.component.Form service
254*cdf0e10cSrcweir 			// (probably this needs not to be overloaded, but you may return anything you want as long as it
255*cdf0e10cSrcweir 			// supports the ::com::sun::star::form::DatabaseForm service. For instance you may want to create an adapter here which
256*cdf0e10cSrcweir 			// is synchronized with a foreign ::com::sun::star::form::DatabaseForm you got elsewhere)
257*cdf0e10cSrcweir 		virtual sal_Bool InitializeForm(
258*cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ) = 0;
259*cdf0e10cSrcweir 			// called immediately after a successfull CreateForm
260*cdf0e10cSrcweir 			// do any initialization (data source etc.) here. the form should be fully functional after that.
261*cdf0e10cSrcweir 			// return sal_False if you didn't succeed (don't throw exceptions, they won't be caught)
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir 		virtual sal_Bool InitializeGridModel(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > & xGrid);
264*cdf0e10cSrcweir 
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent >  CreateGridModel();
267*cdf0e10cSrcweir 			// our default implementation simply instantiates a stardiv.one.form.component.Grid service
268*cdf0e10cSrcweir 			// you most probably don't want to override this behaviuor
269*cdf0e10cSrcweir 
270*cdf0e10cSrcweir 		// the default implementation of disposing distributes the events to the following disposingXXX functions
271*cdf0e10cSrcweir 		virtual void disposingGridControl(const ::com::sun::star::lang::EventObject& Source);	// calls removeControlListeners
272*cdf0e10cSrcweir 		virtual void disposingGridModel(const ::com::sun::star::lang::EventObject& Source);		// calls removeModelListeners
273*cdf0e10cSrcweir 		virtual void disposingFormModel(const ::com::sun::star::lang::EventObject& Source);
274*cdf0e10cSrcweir 		virtual void disposingColumnModel(const ::com::sun::star::lang::EventObject& Source);
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir 		// want to be a listener to the grid control ? use this !
277*cdf0e10cSrcweir 		virtual void addControlListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > & _xGridControl);
278*cdf0e10cSrcweir 		virtual void removeControlListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > & _xGridControl);
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 		// want to be a listener to the grid model ? use this !
281*cdf0e10cSrcweir 		virtual void addModelListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel);
282*cdf0e10cSrcweir 		virtual void removeModelListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel);
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir 		// want to be a listener grid columns ? use this !
285*cdf0e10cSrcweir 		virtual void AddColumnListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xCol);
286*cdf0e10cSrcweir 		virtual void RemoveColumnListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xCol);
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir 			// call after "major changes" (e.g. the completion of the async load).
290*cdf0e10cSrcweir 			// invalidates all toolbox slots and all supported features.
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir 		virtual sal_Bool LoadForm();
293*cdf0e10cSrcweir 			// load the form
294*cdf0e10cSrcweir 			// the default implementation does an direct load or starts a load thread, depending on the multithread capabilities
295*cdf0e10cSrcweir 			// of the data source.
296*cdf0e10cSrcweir 			// the default implementation also calls LoadFinished after a syncronous load, so be sure to do the same if you override
297*cdf0e10cSrcweir 			// this metod and don't call the base class' method
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir 		virtual void LoadFinished(sal_Bool bWasSynch);
300*cdf0e10cSrcweir 			// called if the loading (the _complete_ loading process) is done (no matter if synchron or asynchron).
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir 		virtual void criticalFail();
303*cdf0e10cSrcweir 			// called whenever a reload operation on the rowset failed
304*cdf0e10cSrcweir 			// (a "operation" is not only a simple reload: If the user sets a filter, an reloading the form
305*cdf0e10cSrcweir 			// after setting this filter fails, the filter is reset and the form is reloaded, again. Only the
306*cdf0e10cSrcweir 			// whole process (_both_ XLoadable::reload calls _together_) form the "reload operation"
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir 		// --------------------
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir 			// empty the frame where our view resides
311*cdf0e10cSrcweir 		virtual sal_Bool CommitCurrent();
312*cdf0e10cSrcweir 			// commit the current column (i.e. cell)
313*cdf0e10cSrcweir 		virtual sal_Bool SaveModified(sal_Bool bAskFor = sal_True);
314*cdf0e10cSrcweir 			// save the modified record
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 	getBoundField(sal_uInt16 nViewPos = (sal_uInt16)-1) const;
317*cdf0e10cSrcweir 			// a PropertySet corresponding to the cursor field a column is bound to
318*cdf0e10cSrcweir 			// if nViewPos is (sal_uInt16)-1 (the default) then the field for the current column will be retrieved
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir 		void enterFormAction();
321*cdf0e10cSrcweir 		void leaveFormAction();
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir 		// init the formatter if form changes
324*cdf0e10cSrcweir 		void initFormatter();
325*cdf0e10cSrcweir 
326*cdf0e10cSrcweir 		/// loads or reloads the form
327*cdf0e10cSrcweir 		virtual sal_Bool reloadForm(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >& _rxLoadable);
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir 		virtual sal_Bool    preReloadForm(){ return sal_False; }
330*cdf0e10cSrcweir 		virtual void        postReloadForm(){}
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >
333*cdf0e10cSrcweir                             createParser_nothrow();
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir 	private:
336*cdf0e10cSrcweir 		void setCurrentModified( sal_Bool _bSet );
337*cdf0e10cSrcweir 
338*cdf0e10cSrcweir 		// execute the filter or sort slot
339*cdf0e10cSrcweir 		void ExecuteFilterSortCrit(sal_Bool bFilter);
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir 		// execute the search slot
342*cdf0e10cSrcweir 		void		ExecuteSearch();
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir         void        initializeParser() const; // changes the mutable member m_xParser
345*cdf0e10cSrcweir 		void		applyParserFilter(const ::rtl::OUString& _rOldFilter, sal_Bool _bOldFilterApplied,const ::rtl::OUString& _sOldHaving,const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >& _xParser);
346*cdf0e10cSrcweir 		void		applyParserOrder(const ::rtl::OUString& _rOldOrder,const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer >& _xParser);
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir 		sal_Int16   getCurrentColumnPosition();
349*cdf0e10cSrcweir 		void		setCurrentColumnPosition( sal_Int16 _nPos );
350*cdf0e10cSrcweir 		void		addColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel);
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir         void        impl_checkForCannotSelectUnfiltered( const ::dbtools::SQLExceptionInfo& _rError );
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 		// time to check the CUT/COPY/PASTE-slot-states
355*cdf0e10cSrcweir 		DECL_LINK( OnInvalidateClipboard, AutoTimer* );
356*cdf0e10cSrcweir 		DECL_LINK( OnClipboardChanged, void* );
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir 		// search callbacks
359*cdf0e10cSrcweir 		DECL_LINK(OnSearchContextRequest, FmSearchContext*);
360*cdf0e10cSrcweir 		DECL_LINK(OnFoundData, FmFoundRecordInformation*);
361*cdf0e10cSrcweir 		DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation*);
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir 		DECL_LINK(OnAsyncGetCellFocus, void*);
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir         DECL_LINK( OnAsyncDisplayError, void* );
366*cdf0e10cSrcweir 	};
367*cdf0e10cSrcweir }
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir #endif // _SBA_BWRCTRLR_HXX
370*cdf0e10cSrcweir 
371