xref: /trunk/main/dbaccess/source/ui/inc/unodatbr.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SBA_UNODATBR_HXX_
29 #define _SBA_UNODATBR_HXX_
30 
31 #ifndef _SBA_BWRCTRLR_HXX
32 #include "brwctrlr.hxx"
33 #endif
34 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
35 #include <com/sun/star/sdbc/XConnection.hpp>
36 #endif
37 #ifndef _COMPHELPER_STLTYPES_HXX_
38 #include <comphelper/stl_types.hxx>
39 #endif
40 #ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
41 #include <com/sun/star/frame/XStatusListener.hpp>
42 #endif
43 #ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
44 #include <com/sun/star/frame/XDispatch.hpp>
45 #endif
46 #ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
47 #include <com/sun/star/container/XContainerListener.hpp>
48 #endif
49 #ifndef _COM_SUN_STAR_I18N_XCOLLATOR_HPP_
50 #include <com/sun/star/i18n/XCollator.hpp>
51 #endif
52 #ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_
53 #include <com/sun/star/view/XSelectionSupplier.hpp>
54 #endif
55 #ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_
56 #include <com/sun/star/awt/XWindow.hpp>
57 #endif
58 #ifndef _COM_SUN_STAR_DOCUMENT_XSCRIPTINVOCATIONCONTEXT_HPP_
59 #include <com/sun/star/document/XScriptInvocationContext.hpp>
60 #endif
61 #ifndef _COM_SUN_STAR_UI_XCONTEXTMENUINTERCEPTION_HPP_
62 #include <com/sun/star/ui/XContextMenuInterception.hpp>
63 #endif
64 #ifndef _COM_SUN_STAR_SDB_APPLICATION_DATABASEOBJECT_HPP_
65 #include <com/sun/star/sdb/application/DatabaseObject.hpp>
66 #endif
67 #ifndef _COM_SUN_STAR_SDB_APPLICATION_DATABASEOBJECTCONTAINER_HPP_
68 #include <com/sun/star/sdb/application/DatabaseObjectContainer.hpp>
69 #endif
70 #ifndef _COM_SUN_STAR_SDB_DATABASEOBJECTCONTAINER_HPP_
71 #include <com/sun/star/sdb/XDatabaseRegistrationsListener.hpp>
72 #endif
73 #ifndef _CPPUHELPER_IMPLBASE5_HXX_
74 #include <cppuhelper/implbase5.hxx>
75 #endif
76 #ifndef _DBACCESS_UI_CALLBACKS_HXX_
77 #include "callbacks.hxx"
78 #endif
79 #ifndef _SV_TIMER_HXX
80 #include <vcl/timer.hxx>
81 #endif
82 #ifndef _TRANSFER_HXX
83 #include <svtools/transfer.hxx>
84 #endif
85 #ifndef _SVX_DATACCESSDESCRIPTOR_HXX_
86 #include <svx/dataaccessdescriptor.hxx>
87 #endif
88 #ifndef _SOT_STORAGE_HXX
89 #include <sot/storage.hxx>
90 #endif
91 #ifndef DBUI_TABLECOPYHELPER_HXX
92 #include "TableCopyHelper.hxx"
93 #endif
94 #ifndef _DBAUI_COMMON_TYPES_HXX_
95 #include "commontypes.hxx"
96 #endif
97 
98 // =========================================================================
99 class SvLBoxEntry;
100 class Splitter;
101 struct SvSortData;
102 
103 namespace com { namespace sun{ namespace star { namespace container { class XNameContainer; } } } }
104 
105 class SvLBoxTreeList;
106 // .........................................................................
107 namespace dbaui
108 {
109 // .........................................................................
110 
111 	class DBTreeView;
112 	struct DBTreeEditedEntry;
113     class ImageProvider;
114 
115 	// =====================================================================
116 	typedef ::cppu::ImplHelper5	<	::com::sun::star::frame::XStatusListener
117 								,	::com::sun::star::view::XSelectionSupplier
118                                 ,   ::com::sun::star::document::XScriptInvocationContext
119                                 ,   ::com::sun::star::ui::XContextMenuInterception
120                                 ,   ::com::sun::star::sdb::XDatabaseRegistrationsListener
121 								>	SbaTableQueryBrowser_Base;
122 	class SbaTableQueryBrowser
123 				:public SbaXDataBrowserController
124 				,public SbaTableQueryBrowser_Base
125 				,public IControlActionListener
126                 ,public IContextMenuProvider
127 	{
128 	protected:
129 
130 		// ---------------------------
131 		::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator >	m_xCollator;
132 		::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >		m_xCurrentFrameParent;
133         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >      m_xMainToolbar;
134 
135 		// ---------------------------
136         struct ExternalFeature
137         {
138             ::com::sun::star::util::URL     aURL;
139             ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
140                                             xDispatcher;
141             sal_Bool                        bEnabled;
142 
143             ExternalFeature() : bEnabled( sal_False ) { }
144             ExternalFeature( const ::com::sun::star::util::URL& _rURL ) : aURL( _rURL ), bEnabled( sal_False ) { }
145         };
146 
147         typedef ::std::map< sal_uInt16, ExternalFeature, ::std::less< sal_uInt16 > >  ExternalFeaturesMap;
148         ExternalFeaturesMap     m_aExternalFeatures;
149 
150 		::svx::ODataAccessDescriptor	m_aDocumentDataSource;
151 			// if we're part of a document, this is the state of the DocumentDataSource slot
152 
153 		::cppu::OInterfaceContainerHelper	m_aSelectionListeners;
154 		::cppu::OInterfaceContainerHelper	m_aContextMenuInterceptors;
155 
156         OTableCopyHelper::DropDescriptor    m_aAsyncDrop;
157         OTableCopyHelper                    m_aTableCopyHelper;
158 
159 		::rtl::OUString			m_sQueryCommand;	// the command of the query currently loaded (if any)
160         //::rtl::OUString         m_sToBeLoaded;      // contains the element name which should be loaded if any
161 
162 		DBTreeView*				m_pTreeView;
163 		Splitter*				m_pSplitter;
164 		SvLBoxTreeList*         m_pTreeModel;			// contains the datasources of the registry
165 		SvLBoxEntry*			m_pCurrentlyDisplayed;
166         sal_uLong					m_nAsyncDrop;
167 
168 		sal_Int16				m_nBorder;				// sal_True when border should be shown
169 
170 		sal_Bool				m_bQueryEscapeProcessing : 1;	// the escape processing flag of the query currently loaded (if any)
171 		sal_Bool				m_bShowMenu;			// if sal_True the menu should be visible otherwise not
172 		sal_Bool				m_bInSuspend;
173 		sal_Bool				m_bEnableBrowser;
174         ::boost::optional< bool >
175                                 m_aDocScriptSupport;    // relevant if and only if we are associated with exactly one DBDoc
176 
177 
178 		virtual ::rtl::OUString getPrivateTitle( ) const;
179 	// attribute access
180 	public:
181 		SbaTableQueryBrowser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM);
182 		~SbaTableQueryBrowser();
183 
184 		enum EntryType
185 		{
186             // don't change the above definitions! There are places (in particular SbaTableQueryBrowser::getCurrentSelection)
187             // which rely on the fact that the EntryType values really equal the DatabaseObject(Container) values!
188             etDatasource     = ::com::sun::star::sdb::application::DatabaseObjectContainer::DATA_SOURCE,
189 			etQueryContainer = ::com::sun::star::sdb::application::DatabaseObjectContainer::QUERIES,
190 			etTableContainer = ::com::sun::star::sdb::application::DatabaseObjectContainer::TABLES,
191             etQuery          = ::com::sun::star::sdb::application::DatabaseObject::QUERY,
192 			etTableOrView    = ::com::sun::star::sdb::application::DatabaseObject::TABLE,
193 			etUnknown        = -1
194 		};
195 
196         /** returns a DatabaseObject value corresponding to the given EntryType
197             @param _eType
198                 the entry type. Must not be etUnknown.
199         */
200         static sal_Int32    getDatabaseObjectType( EntryType _eType );
201 
202 		// need by registration
203 		static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
204 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
205 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
206 				SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
207 
208 		DECLARE_UNO3_DEFAULTS(SbaTableQueryBrowser,SbaXDataBrowserController);
209 		// late construction
210 		virtual sal_Bool Construct(Window* pParent);
211 		// XInterface
212 		virtual ::com::sun::star::uno::Any	SAL_CALL queryInterface(const ::com::sun::star::uno::Type& _rType) throw (::com::sun::star::uno::RuntimeException);
213 
214 		// XTypeProvider
215 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException);
216 		virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException);
217 
218 		// ::com::sun::star::beans::XPropertyChangeListener
219 		virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
220 
221 		// ::com::sun::star::frame::XController
222 		virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException );
223 		virtual void SAL_CALL attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame) throw( ::com::sun::star::uno::RuntimeException );
224 
225 		// ::com::sun::star::lang::XComponent
226 		virtual void		SAL_CALL disposing();
227 
228 		// XStatusListener
229 	    virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
230 
231 		// XEventListener
232 	    virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
233 
234 		// XSelectionSupplier
235 		virtual sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& aSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
236 		virtual ::com::sun::star::uno::Any SAL_CALL getSelection(  ) throw (::com::sun::star::uno::RuntimeException);
237 		virtual void SAL_CALL addSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
238 		virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
239 
240 		// XServiceInfo
241 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
242 		virtual ::comphelper::StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
243 
244 		// XContainerListener
245 		virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
246 		virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
247 		virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
248 		// ::com::sun::star::frame::XFrameActionListener
249 		virtual void SAL_CALL frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException );
250 
251 		//IController
252 		virtual void notifyHiContrastChanged();
253 
254         // XScriptInvocationContext
255         virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedScripts > SAL_CALL getScriptContainer() throw (::com::sun::star::uno::RuntimeException);
256 
257         // XContextMenuInterception
258         virtual void SAL_CALL registerContextMenuInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XContextMenuInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException);
259         virtual void SAL_CALL releaseContextMenuInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XContextMenuInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException);
260 
261         // XDatabaseRegistrationsListener
262         virtual void SAL_CALL registeredDatabaseLocation( const ::com::sun::star::sdb::DatabaseRegistrationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
263         virtual void SAL_CALL revokedDatabaseLocation( const ::com::sun::star::sdb::DatabaseRegistrationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
264         virtual void SAL_CALL changedDatabaseLocation( const ::com::sun::star::sdb::DatabaseRegistrationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
265 
266 	protected:
267 		// SbaXDataBrowserController overridables
268 		virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties );
269 		virtual sal_Bool InitializeGridModel(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > & xGrid);
270 
271 		virtual sal_Bool preReloadForm();
272 		virtual void	 postReloadForm();
273 
274 		virtual void addModelListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel);
275 		virtual void removeModelListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel);
276 
277 		virtual void AddColumnListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xCol);
278 		virtual void RemoveColumnListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & xCol);
279 
280 		virtual void LoadFinished(sal_Bool _bWasSynch);
281 
282 		virtual void criticalFail();
283 
284 		virtual void			describeSupportedFeatures();
285 		virtual FeatureState	GetState(sal_uInt16 nId) const;
286 		virtual void			Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs);
287 
288 		// IControlActionListener overridables
289 		virtual sal_Bool    requestQuickHelp( const SvLBoxEntry* _pEntry, String& _rText ) const;
290 		virtual sal_Bool	requestDrag( sal_Int8 _nAction, const Point& _rPosPixel );
291 		virtual sal_Int8	queryDrop( const AcceptDropEvent& _rEvt, const DataFlavorExVector& _rFlavors );
292 		virtual sal_Int8	executeDrop( const ExecuteDropEvent& _rEvt );
293 
294         // IContextMenuProvider
295         virtual PopupMenu*      getContextMenu( Control& _rControl ) const;
296         virtual IController&    getCommandController();
297         virtual ::cppu::OInterfaceContainerHelper*
298                                 getContextMenuInterceptors();
299         virtual ::com::sun::star::uno::Any
300                                 getCurrentSelection( Control& _rControl ) const;
301 
302         virtual void impl_initialize();
303 
304 		// SbaGridListener overridables
305 		virtual void RowChanged();
306 		virtual void ColumnChanged();
307 		virtual void SelectionChanged();
308 
309 		// methods for showing/hiding the explorer part
310 		sal_Bool	haveExplorer() const;
311 		void		hideExplorer();
312 		void		showExplorer();
313 		void		toggleExplorer() { if (haveExplorer()) hideExplorer(); else showExplorer(); }
314 
315 		// methods for handling the 'selection' (paintin them bold) of SvLBoxEntries
316 		// returns <TRUE/> if the entry is selected (which means it's part of the selected path)
317 		sal_Bool	isSelected(SvLBoxEntry* _pEntry) const;
318 		// select the entry (and only the entry, not the whole path)
319 		void		select(SvLBoxEntry* _pEntry, sal_Bool _bSelect = sal_True);
320 		// select the path of the entry (which must be an entry without children)
321 		void		selectPath(SvLBoxEntry* _pEntry, sal_Bool _bSelect = sal_True);
322 
323 		virtual void loadMenu(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame);
324 
325 	private:
326 		// check the state of the external slot given, update any UI elements if necessary
327 		void implCheckExternalSlot( sal_uInt16 _nId );
328 
329 		// connect to the external dispatchers (if any)
330 		void connectExternalDispatches();
331 
332 		/** get the state of an external slot
333 			<p>The slot is available if an external dispatcher is responsible for it, _and_ if this dispatcher
334 			told us the slot is available.</p>
335 		*/
336 		sal_Bool	getExternalSlotState( sal_uInt16 _nId ) const;
337 
338 		/** add an entry (including the subentries for queries/tables) to the list model
339 
340 			<p>The given names and images may be empty, in this case they're filled with the correct
341 			values. This way they may be reused for the next call, which saves some resource manager calls.</p>
342 		*/
343 		void implAddDatasource(const String& _rDbName, Image& _rDbImage,
344 				String& _rQueryName, Image& _rQueryImage,
345 				String& _rTableName, Image& _rTableImage,
346                 const SharedConnection& _rxConnection
347 			);
348 
349         void    implAddDatasource( const String& _rDataSourceName, const SharedConnection& _rxConnection );
350 
351         /// removes (and cleans up) the entry for the given data source
352         void        impl_cleanupDataSourceEntry( const String& _rDataSourceName );
353 
354 		/// clears the tree list box
355 		void clearTreeModel();
356 
357 		/** unloads the form, empties the grid model, cleans up anything related to the currently displayed object
358 			@param _bDisposeConnection
359 				<TRUE/> if the connection should be disposed
360 			@param _bFlushData
361 				<TRUE/> if the currently displayed object (if any) should be flushed
362 		*/
363 		void unloadAndCleanup( sal_Bool _bDisposeConnection = sal_True );
364 
365 		// disposes the connection associated with the given entry (which must represent a data source)
366 		void		disposeConnection( SvLBoxEntry* _pDSEntry );
367 
368         /// flushs and disposes the given connection, and de-registers as listener
369         void        impl_releaseConnection( SharedConnection& _rxConnection );
370 
371 		/** close the connection (and collapse the list entries) of the given list entries
372 		*/
373 		void		closeConnection(SvLBoxEntry* _pEntry,sal_Bool _bDisposeConnection = sal_True);
374 
375 		void        populateTree(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _xNameAccess, SvLBoxEntry* _pParent, EntryType _eEntryType);
376 		void		initializeTreeModel();
377 
378 		/** search in the tree for query- or tablecontainer equal to this interface and return
379 			this container entry
380 		*/
381 		SvLBoxEntry* getEntryFromContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxNameAccess);
382 		// return true when there is connection available
383 		sal_Bool ensureConnection(SvLBoxEntry* _pDSEntry, void * pDSData, SharedConnection& _rConnection );
384 		sal_Bool ensureConnection(SvLBoxEntry* _pAnyEntry, SharedConnection& _rConnection );
385 
386         sal_Bool getExistentConnectionFor( SvLBoxEntry* _pDSEntry, SharedConnection& _rConnection );
387         /** returns an image provider which works with the connection belonging to the given entry
388         */
389         ::std::auto_ptr< ImageProvider >
390                 getImageProviderFor( SvLBoxEntry* _pAnyEntry );
391 
392 		void	implAdministrate( SvLBoxEntry* _pApplyTo );
393 
394 		TransferableHelper*
395 				implCopyObject( SvLBoxEntry* _pApplyTo, sal_Int32 _nCommandType, sal_Bool _bAllowConnection = sal_True );
396 
397 		EntryType	getEntryType( SvLBoxEntry* _pEntry ) const;
398 		EntryType	getChildType( SvLBoxEntry* _pEntry ) const;
399 		sal_Bool	isObject( EntryType _eType ) const { return ( etTableOrView== _eType ) || ( etQuery == _eType ); }
400 		sal_Bool	isContainer( EntryType _eType ) const { return (etTableContainer == _eType) || (etQueryContainer == _eType); }
401 		sal_Bool	isContainer( SvLBoxEntry* _pEntry ) const { return isContainer( getEntryType( _pEntry ) ); }
402 
403 		// ensure that the xObject for the given entry is set on the user data
404 		sal_Bool	ensureEntryObject( SvLBoxEntry* _pEntry );
405 
406 		// get the display text of the entry given
407 		String		GetEntryText( SvLBoxEntry* _pEntry ) const;
408 
409 		// is called when a table or a query was selected
410 		DECL_LINK( OnSelectionChange, void* );
411 		DECL_LINK( OnExpandEntry, SvLBoxEntry* );
412 
413 		DECL_LINK( OnCopyEntry, void* );
414 
415 		DECL_LINK( OnTreeEntryCompare, const SvSortData* );
416 
417         DECL_LINK( OnAsyncDrop, void* );
418 
419 		void implRemoveStatusListeners();
420 
421 		sal_Bool implSelect(const ::svx::ODataAccessDescriptor& _rDescriptor,sal_Bool _bSelectDirect = sal_False);
422         bool implSelect( SvLBoxEntry* _pEntry );
423 
424 		/// selects the entry given and loads the grid control with the object's data
425 		sal_Bool implSelect(
426             const ::rtl::OUString& _rDataSourceName,
427             const ::rtl::OUString& _rCommand,
428 			const sal_Int32 _nCommandType,
429             const sal_Bool _bEscapeProcessing,
430             const SharedConnection& _rxConnection,
431 			sal_Bool _bSelectDirect = sal_False
432         );
433 
434         SvLBoxEntry* implGetConnectionEntry(SvLBoxEntry* _pEntry) const;
435         /// inserts an entry into the tree
436         SvLBoxEntry* implAppendEntry(
437             SvLBoxEntry* _pParent,
438             const String& _rName,
439             void* _pUserData,
440             EntryType _eEntryType
441         );
442 
443 		/// loads the grid control with the data object specified (which may be a table, a query or a command)
444 		sal_Bool implLoadAnything(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rCommand,
445 			const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing, const SharedConnection& _rxConnection = SharedConnection() );
446 
447 		/** retrieves the tree entry for the object described by <arg>_rDescriptor</arg>
448 			@param _rDescriptor
449 				the object descriptor
450 			@param _ppDataSourceEntry
451 				If not <NULL/>, the data source tree entry will be returned here
452 			@param _ppContainerEntry
453 				If not <NULL/>, the object container tree entry will be returned here
454 			@param _bExpandAncestors
455 				If <TRUE/>, all ancestor on the way to the entry will be expanded
456 		*/
457 		SvLBoxEntry* getObjectEntry(const ::svx::ODataAccessDescriptor& _rDescriptor,
458 			SvLBoxEntry** _ppDataSourceEntry = NULL, SvLBoxEntry** _ppContainerEntry = NULL,
459 			sal_Bool _bExpandAncestors = sal_True
460 		);
461 		/** retrieves the tree entry for the object described by data source name, command and command type
462 			@param _rDataSource
463 				the data source name
464 			@param _rCommand
465 				the command
466 			@param _nCommandType
467 				the command type
468 			@param _rDescriptor
469 				the object descriptor
470 			@param _ppDataSourceEntry
471 				If not <NULL/>, the data source tree entry will be returned here
472 			@param _ppContainerEntry
473 				If not <NULL/>, the object container tree entry will be returned here
474 			@param _bExpandAncestors
475 				If <TRUE/>, all ancestor on the way to the entry will be expanded
476 		*/
477 		SvLBoxEntry* getObjectEntry(
478 			const ::rtl::OUString& _rDataSource, const ::rtl::OUString& _rCommand, sal_Int32 _nCommandType,
479 			SvLBoxEntry** _ppDataSourceEntry = NULL, SvLBoxEntry** _ppContainerEntry = NULL,
480 			sal_Bool _bExpandAncestors = sal_True,
481 			const SharedConnection& _rxConnection = SharedConnection()
482 		);
483 
484 		/// checks if m_aDocumentDataSource describes a known object
485 		void checkDocumentDataSource();
486 
487 		void extractDescriptorProps(const ::svx::ODataAccessDescriptor& _rDescriptor,
488 			::rtl::OUString& _rDataSource, ::rtl::OUString& _rCommand, sal_Int32& _rCommandType, sal_Bool& _rEscapeProcessing);
489 
490 		void transferChangedControlProperty(const ::rtl::OUString& _rProperty, const ::com::sun::star::uno::Any& _rNewValue);
491 
492 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > connectWithStatus(
493 			const ::rtl::OUString& _rDataSourceName,
494 			void* _pTreeListUserData	// in rela a DBTreeListUserData*, but we do not know this class here ....
495 		);
496 
497 #ifdef DBG_UTIL
498         // checks whether the given tree entry denotes a data source
499         bool impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const;
500 #endif
501 
502         /// retrieves the data source URL/name for the given entry representing a data source
503         String  getDataSourceAcessor( SvLBoxEntry* _pDataSourceEntry ) const;
504 
505 		/** get the signature (command/escape processing) of the query the form is based on
506 			<p>If the for is not based on a query or not even loaded, nothing happens and <FALSE/> is returned.</p>
507 		*/
508 		sal_Bool implGetQuerySignature( ::rtl::OUString& _rCommand, sal_Bool& _bEscapeProcessing );
509 
510 		sal_Bool isEntryCopyAllowed(SvLBoxEntry* _pEntry) const;
511 
512 		void copyEntry(SvLBoxEntry* _pEntry);
513 
514 		// remove all grid columns and dispose them
515 		void clearGridColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _xColContainer);
516 
517 		sal_Bool isHiContrast() const;
518 
519 
520 		/** checks if the currently displayed entry changed
521 			@param	_sName
522 					Name of the changed entry
523 			@param	_pContainer
524 					The container of the displayed entry
525 			@return
526 					<TRUE/> if it is the currently displayed otherwise <FALSE/>
527 		*/
528 		sal_Bool isCurrentlyDisplayedChanged(const String& _sName,SvLBoxEntry* _pContainer);
529 
530         /** called whenever the content of the browser is used for preview, as the very last action
531             of the load process
532         */
533         void initializePreviewMode();
534 
535         /** checks whether the Order/Filter clauses set at our row set are valid, removes them if not so
536         */
537         void    impl_sanitizeRowSetClauses_nothrow();
538 	};
539 
540 // .........................................................................
541 }	// namespace dbaui
542 // .........................................................................
543 
544 #endif // _SBA_UNODATBR_HXX_
545 
546