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