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