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 DBAUI_GENERICCONTROLLER_HXX 25 #define DBAUI_GENERICCONTROLLER_HXX 26 27 #include "AsyncronousLink.hxx" 28 #include "controllerframe.hxx" 29 #include "dbaccessdllapi.h" 30 #include "IController.hxx" 31 32 /** === begin UNO includes === **/ 33 #include <com/sun/star/container/XNameAccess.hpp> 34 #include <com/sun/star/frame/CommandGroup.hpp> 35 #include <com/sun/star/frame/XController2.hpp> 36 #include <com/sun/star/frame/XDispatch.hpp> 37 #include <com/sun/star/frame/XDispatchInformationProvider.hpp> 38 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> 39 #include <com/sun/star/frame/XFrameActionListener.hpp> 40 #include <com/sun/star/frame/XTitle.hpp> 41 #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> 42 #include <com/sun/star/frame/XLayoutManager.hpp> 43 #include <com/sun/star/lang/XInitialization.hpp> 44 #include <com/sun/star/lang/XServiceInfo.hpp> 45 #include <com/sun/star/sdbc/XConnection.hpp> 46 #include <com/sun/star/sdbc/XDataSource.hpp> 47 #include <com/sun/star/uno/XComponentContext.hpp> 48 #include <com/sun/star/util/XModifyListener.hpp> 49 #include <com/sun/star/util/XURLTransformer.hpp> 50 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 51 #include <com/sun/star/awt/XUserInputInterception.hpp> 52 /** === end UNO includes === **/ 53 54 #include <comphelper/broadcasthelper.hxx> 55 #include <comphelper/sharedmutex.hxx> 56 #include <comphelper/namedvaluecollection.hxx> 57 #include <comphelper/stl_types.hxx> 58 #include <connectivity/dbexception.hxx> 59 #include <cppuhelper/compbase11.hxx> 60 #include <cppuhelper/interfacecontainer.h> 61 62 #include <boost/optional.hpp> 63 #include <sfx2/userinputinterception.hxx> 64 65 namespace dbtools 66 { 67 class SQLExceptionInfo; 68 } 69 70 class Window; 71 class VCLXWindow; 72 namespace dbaui 73 { 74 class ODataView; 75 76 // ==================================================================== 77 // = optional 78 // ==================================================================== 79 /** convenience wrapper around boost::optional, allowing typed assignments 80 */ 81 template < typename T > 82 class optional : public ::boost::optional< T > 83 { 84 typedef ::boost::optional< T > base_type; 85 86 public: optional()87 optional ( ) : base_type( ) { } optional(T const & val)88 explicit optional ( T const& val ) : base_type( val ) { } optional(optional const & rhs)89 optional ( optional const& rhs ) : base_type( (base_type const&)rhs ) { } 90 91 public: operator =(T const & rhs)92 optional& operator= ( T const& rhs ) 93 { 94 base_type::reset( rhs ); 95 return *this; 96 } operator =(optional<T> const & rhs)97 optional& operator= ( optional< T > const& rhs ) 98 { 99 if ( rhs.is_initialized() ) 100 base_type::reset( rhs.get() ); 101 else 102 base_type::reset(); 103 return *this; 104 } 105 }; 106 107 template< typename T > operator >>=(const::com::sun::star::uno::Any & _any,optional<T> & _value)108 inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & _any, optional< T >& _value ) 109 { 110 _value.reset(); // de-init the optional value 111 112 T directValue = T(); 113 if ( _any >>= directValue ) 114 _value.reset( directValue ); 115 116 return !!_value; 117 } 118 119 // ==================================================================== 120 // = FeatureState 121 // ==================================================================== 122 /** describes the state of a feature 123 124 In opposite to the FeatureStateEvent in css.frame, this one allows for multiple states to be specified at once. 125 With this, you can for instance specify that a toolbox item is checked, and has a certain title, at the same 126 time. 127 */ 128 struct FeatureState 129 { 130 sal_Bool bEnabled; 131 132 optional< bool > bChecked; 133 optional< bool > bInvisible; 134 ::com::sun::star::uno::Any aValue; 135 optional< ::rtl::OUString > sTitle; 136 FeatureStatedbaui::FeatureState137 FeatureState() : bEnabled(sal_False) { } 138 }; 139 140 // ==================================================================== 141 // = helper 142 // ==================================================================== 143 144 // .................................................................... 145 struct ControllerFeature : public ::com::sun::star::frame::DispatchInformation 146 { 147 sal_uInt16 nFeatureId; 148 }; 149 150 // .................................................................... 151 typedef ::std::map < ::rtl::OUString 152 , ControllerFeature 153 , ::std::less< ::rtl::OUString > 154 > SupportedFeatures; 155 156 // .................................................................... 157 struct CompareFeatureById : ::std::binary_function< SupportedFeatures::value_type, sal_Int32, bool > 158 { 159 // ................................................................ operator ()dbaui::CompareFeatureById160 inline bool operator()( const SupportedFeatures::value_type& _aType, const sal_Int32& _nId ) const 161 { 162 return !!( _nId == _aType.second.nFeatureId ); 163 } 164 }; 165 166 // .................................................................... 167 struct FeatureListener 168 { 169 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > 170 xListener; 171 sal_Int32 nId; 172 sal_Bool bForceBroadcast; 173 }; 174 175 // .................................................................... 176 typedef ::std::deque< FeatureListener > FeatureListeners; 177 178 // .................................................................... 179 struct FindFeatureListener : ::std::binary_function< FeatureListener, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >, bool > 180 { 181 // ................................................................ operator ()dbaui::FindFeatureListener182 inline bool operator()( const FeatureListener& lhs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& rhs ) const 183 { 184 return !!( lhs.xListener == rhs ); 185 } 186 }; 187 188 // .................................................................... 189 typedef ::comphelper::SharedMutexBase OGenericUnoController_MBASE; 190 191 typedef ::cppu::WeakComponentImplHelper11 < ::com::sun::star::frame::XDispatch 192 , ::com::sun::star::frame::XDispatchProviderInterceptor 193 , ::com::sun::star::util::XModifyListener 194 , ::com::sun::star::frame::XFrameActionListener 195 , ::com::sun::star::lang::XInitialization 196 , ::com::sun::star::lang::XServiceInfo 197 , ::com::sun::star::frame::XDispatchInformationProvider 198 , ::com::sun::star::frame::XController2 199 , ::com::sun::star::frame::XTitle 200 , ::com::sun::star::frame::XTitleChangeBroadcaster 201 , ::com::sun::star::awt::XUserInputInterception 202 > OGenericUnoController_Base; 203 204 struct OGenericUnoController_Data; 205 // ==================================================================== 206 class DBACCESS_DLLPUBLIC OGenericUnoController 207 :public OGenericUnoController_MBASE 208 ,public OGenericUnoController_Base 209 ,public IController 210 { 211 private: 212 SupportedFeatures m_aSupportedFeatures; 213 ::comphelper::NamedValueCollection 214 m_aInitParameters; 215 216 ::std::auto_ptr< OGenericUnoController_Data > 217 m_pData; 218 ODataView* m_pView; // our (VCL) "main window" 219 220 #ifdef DBG_UTIL 221 bool m_bDescribingSupportedFeatures; 222 #endif 223 224 protected: 225 // ---------------------------------------------------------------- 226 // attributes 227 struct DispatchTarget 228 { 229 ::com::sun::star::util::URL aURL; 230 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xListener; 231 DispatchTargetdbaui::OGenericUnoController::DispatchTarget232 DispatchTarget() { } DispatchTargetdbaui::OGenericUnoController::DispatchTarget233 DispatchTarget(const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xRef) : aURL(rURL), xListener(xRef) { } 234 }; 235 236 DECLARE_STL_MAP( sal_uInt16, FeatureState, ::std::less< sal_uInt16 >, StateCache ); 237 DECLARE_STL_VECTOR( DispatchTarget, Dispatch); 238 239 FeatureListeners m_aFeaturesToInvalidate; 240 241 ::osl::Mutex m_aFeatureMutex; // locked when features are append to or remove from deque 242 StateCache m_aStateCache; // save the current status of feature state 243 Dispatch m_arrStatusListener; // all our listeners where we dispatch status changes 244 OAsyncronousLink m_aAsyncInvalidateAll; 245 OAsyncronousLink m_aAsyncCloseTask; // called when a task shoud be closed 246 247 ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xUrlTransformer; // needed sometimes 248 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; 249 ControllerFrame m_aCurrentFrame; 250 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xSlaveDispatcher; // for intercepting dispatches 251 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xMasterDispatcher; // dito 252 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xDatabaseContext; 253 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > m_xTitleHelper; 254 255 sal_Bool m_bPreview; 256 sal_Bool m_bReadOnly; 257 258 sal_Bool m_bCurrentlyModified : 1; 259 sal_Bool m_bExternalTitle : 1; 260 261 262 263 // ---------------------------------------------------------------- 264 // attribute access getMutex() const265 ::osl::Mutex& getMutex() const { return OGenericUnoController_MBASE::getMutex(); } getBroadcastHelper()266 ::cppu::OBroadcastHelper& getBroadcastHelper() { return OGenericUnoController_Base::rBHelper; } 267 268 // ---------------------------------------------------------------- 269 // methods 270 OGenericUnoController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM ); 271 const ::comphelper::NamedValueCollection& getInitParams() const272 getInitParams() const { return m_aInitParameters; } 273 274 275 /** open the help agent for the given help id. 276 @param _nHelpId 277 The help id to dispatch. 278 */ 279 void openHelpAgent( const rtl::OString& _sHelpId ); 280 281 /** open the help agent for the given help url. 282 @param _pHelpStringURL 283 The help url to dispatch. 284 */ 285 void openHelpAgent( const rtl::OUString& _suHelpStringURL ); 286 287 /** opens the given Help URL in the help agent 288 289 The URL does not need to be parsed already, it is passed through 290 XURLTransformer::parseStrict before it is used. 291 */ 292 void openHelpAgent( const ::com::sun::star::util::URL& _rURL ); 293 294 // closes the task when possible 295 void closeTask(); 296 297 // if getMenu returns a non empty string than this will be dispatched at the frame 298 virtual void loadMenu(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame); 299 300 /** called when our menu has been loaded into our frame, can be used to load sub toolbars 301 302 @param _xLayoutManager 303 The layout manager. 304 */ 305 virtual void onLoadedMenu(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager); 306 307 // all the features which should be handled by this class 308 virtual void describeSupportedFeatures(); 309 310 // 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. 311 virtual FeatureState GetState(sal_uInt16 nId) const; 312 // execute a feature 313 virtual void Execute(sal_uInt16 nId , const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); 314 315 /** describes a feature supported by the controller 316 317 Must not be called outside <member>describeSupportedFeatures</member>. 318 319 @param _pAsciiCommandURL 320 the URL of the feature command 321 @param _nFeatureId 322 the id of the feature. Later references to this feature usually happen by id, not by 323 URL 324 @param _nCommandGroup 325 the command group of the feature. This is important for configuring the controller UI 326 by the user, see also <type scope="com::sun::star::frame">CommandGroup</type>. 327 */ 328 void implDescribeSupportedFeature( 329 const sal_Char* _pAsciiCommandURL, 330 sal_uInt16 _nFeatureId, 331 sal_Int16 _nCommandGroup = ::com::sun::star::frame::CommandGroup::INTERNAL 332 ); 333 334 /** returns <TRUE/> if the feature is supported, otherwise <FALSE/> 335 @param _nId 336 The ID of the feature. 337 */ 338 sal_Bool isFeatureSupported( sal_Int32 _nId ); 339 340 // gets the URL which the given id is assigned to 341 ::com::sun::star::util::URL getURLForId(sal_Int32 _nId) const; 342 343 /** determines whether the given feature ID denotes a user-defined feature 344 345 @see IController::registerCommandURL 346 */ 347 bool isUserDefinedFeature( const sal_uInt16 nFeatureId ) const; 348 349 /** determines whether the given feature URL denotes a user-defined feature 350 351 @see IController::registerCommandURL 352 */ 353 bool isUserDefinedFeature( const ::rtl::OUString& _rFeatureURL ) const; 354 355 // connect to a datasource 356 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > connect( 357 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource>& _xDataSource, 358 ::dbtools::SQLExceptionInfo* _pErrorInfo 359 ); 360 361 // connect to a datasource 362 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > connect( 363 const ::rtl::OUString& _rsDataSourceName, 364 const ::rtl::OUString& _rContextInformation, 365 ::dbtools::SQLExceptionInfo* _pErrorInfo 366 ); 367 368 void startConnectionListening(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection); 369 void stopConnectionListening(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection); 370 371 /** return the container window of the top most frame 372 @return 373 The top most container window, nmay be <NULL/>. 374 */ 375 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> getTopMostContainerWindow() const; 376 377 // XInitialize will be called inside initialize 378 virtual void impl_initialize(); 379 getPrivateTitle() const380 virtual ::rtl::OUString getPrivateTitle() const { return ::rtl::OUString(); } 381 382 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > impl_getTitleHelper_throw(); getPrivateModel() const383 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getPrivateModel() const 384 { 385 return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >(); 386 } 387 388 virtual void startFrameListening( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ); 389 virtual void stopFrameListening( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ); 390 391 void releaseNumberForComponent(); 392 393 virtual ~OGenericUnoController(); 394 395 private: 396 void fillSupportedFeatures(); 397 398 void InvalidateAll_Impl(); 399 void InvalidateFeature_Impl(); 400 401 void ImplInvalidateFeature( sal_Int32 _nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& _xListener, sal_Bool _bForceBroadcast ); 402 403 sal_Bool ImplInvalidateTBItem(sal_uInt16 nId, const FeatureState& rState); 404 void ImplBroadcastFeatureState(const ::rtl::OUString& _rFeature, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xListener, sal_Bool _bIgnoreCache); 405 406 // link methods 407 DECL_LINK(OnAsyncInvalidateAll, void*); 408 DECL_LINK(OnAsyncCloseTask, void*); 409 410 public: getORB() const411 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xServiceFactory; } getView() const412 ODataView* getView() const { return m_pView; } setView(ODataView & i_rView)413 void setView( ODataView& i_rView ) { m_pView = &i_rView; } clearView()414 void clearView() { m_pView = NULL; } 415 // shows a error box if the SQLExceptionInfo is valid 416 void showError(const ::dbtools::SQLExceptionInfo& _rInfo); 417 418 // if xListener is NULL the change will be forwarded to all listeners to the given ::com::sun::star::util::URL 419 // if _bForceBroadcast is sal_True, the current feature state is broadcasted no matter if it is the same as the cached state 420 virtual void InvalidateFeature(const ::rtl::OUString& rURLPath, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xListener = NULL, sal_Bool _bForceBroadcast = sal_False); 421 // if there is an ::com::sun::star::util::URL translation for the id ('handle') the preceding InvalidateFeature is used. 422 // if there is a toolbar slot with the given id it is updated (the new state is determined via GetState) 423 // if _bForceBroadcast is sal_True, the current feature state is broadcasted no matter if it is the same as the cached state 424 virtual void InvalidateFeature(sal_uInt16 nId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xListener = NULL, sal_Bool _bForceBroadcast = sal_False); 425 426 /** InvalidateAll invalidates all features currently known 427 */ 428 virtual void InvalidateAll(); 429 // late construction 430 virtual sal_Bool Construct(Window* pParent); 431 432 /** get the layout manager 433 @param _xFrame 434 The frame to ask for the layout manager. 435 @return 436 The layout manager of the frame, can be <NULL/> if the frame isn't initialized. 437 */ 438 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > getLayoutManager(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame) const; 439 440 // IController 441 virtual void executeUnChecked(const ::com::sun::star::util::URL& _rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); 442 virtual void executeChecked(const ::com::sun::star::util::URL& _rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); 443 virtual void executeUnChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); 444 virtual void executeChecked(sal_uInt16 _nCommandId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); 445 virtual sal_Bool isCommandEnabled(sal_uInt16 _nCommandId) const; 446 virtual sal_Bool isCommandEnabled(const ::rtl::OUString& _rCompleteCommandURL) const; 447 virtual sal_uInt16 registerCommandURL( const ::rtl::OUString& _rCompleteCommandURL ); 448 virtual void notifyHiContrastChanged(); 449 virtual sal_Bool isDataSourceReadOnly() const; 450 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > getXController() throw( ::com::sun::star::uno::RuntimeException ); 451 virtual bool interceptUserInput( const NotifyEvent& _rEvent ); 452 453 // misc 454 virtual sal_Bool isCommandChecked(sal_uInt16 _nCommandId) const; 455 456 // ::com::sun::star::lang::XEventListener 457 virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); 458 459 // ::com::sun::star::util::XModifyListener 460 virtual void SAL_CALL modified(const ::com::sun::star::lang::EventObject& aEvent) throw( ::com::sun::star::uno::RuntimeException ); 461 462 // XInterface 463 virtual void SAL_CALL acquire( ) throw (); 464 virtual void SAL_CALL release( ) throw (); 465 466 // ::com::sun::star::frame::XController2 467 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getComponentWindow() throw (::com::sun::star::uno::RuntimeException); 468 virtual ::rtl::OUString SAL_CALL getViewControllerName() throw (::com::sun::star::uno::RuntimeException); 469 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCreationArguments() throw (::com::sun::star::uno::RuntimeException); 470 471 // ::com::sun::star::frame::XController 472 virtual void SAL_CALL attachFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame) throw( ::com::sun::star::uno::RuntimeException ); 473 virtual sal_Bool SAL_CALL attachModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel) throw( ::com::sun::star::uno::RuntimeException ); 474 virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException ) = 0; 475 virtual ::com::sun::star::uno::Any SAL_CALL getViewData(void) throw( ::com::sun::star::uno::RuntimeException ); 476 virtual void SAL_CALL restoreViewData(const ::com::sun::star::uno::Any& Data) throw( ::com::sun::star::uno::RuntimeException ); 477 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel(void) throw( ::com::sun::star::uno::RuntimeException ); 478 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame(void) throw( ::com::sun::star::uno::RuntimeException ); 479 480 // ::com::sun::star::frame::XDispatch 481 virtual void SAL_CALL dispatch(const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) throw(::com::sun::star::uno::RuntimeException); 482 virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw(::com::sun::star::uno::RuntimeException); 483 virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw(::com::sun::star::uno::RuntimeException); 484 485 // ::com::sun::star::frame::XDispatchProviderInterceptor 486 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider(void) throw(::com::sun::star::uno::RuntimeException); 487 virtual void SAL_CALL setSlaveDispatchProvider(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & _xNewProvider) throw(::com::sun::star::uno::RuntimeException); 488 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider(void) throw(::com::sun::star::uno::RuntimeException); 489 virtual void SAL_CALL setMasterDispatchProvider(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & _xNewProvider) throw(::com::sun::star::uno::RuntimeException); 490 491 // ::com::sun::star::frame::XDispatchProvider 492 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( ::com::sun::star::uno::RuntimeException ); 493 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw( ::com::sun::star::uno::RuntimeException ); 494 495 // ::com::sun::star::lang::XComponent 496 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); //LLA: need solar mutex {OGenericUnoController_COMPBASE::dispose(); } 497 virtual void SAL_CALL disposing(); 498 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException); 499 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException); 500 501 // ::com::sun::star::frame::XFrameActionListener 502 virtual void SAL_CALL frameAction(const ::com::sun::star::frame::FrameActionEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException ); 503 // lang::XInitialization 504 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 505 506 // XServiceInfo 507 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException) = 0; 508 virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException); 509 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException) = 0; 510 511 // XDispatchInformationProvider 512 virtual ::com::sun::star::uno::Sequence< ::sal_Int16 > SAL_CALL getSupportedCommandGroups() throw (::com::sun::star::uno::RuntimeException); 513 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( ::sal_Int16 ) throw (::com::sun::star::uno::RuntimeException); 514 515 // XTitle 516 virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException); 517 virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ) throw (::com::sun::star::uno::RuntimeException); 518 519 // XTitleChangeBroadcaster 520 virtual void SAL_CALL addTitleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 521 virtual void SAL_CALL removeTitleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 522 523 // XUserInputInterception 524 virtual void SAL_CALL addKeyHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException); 525 virtual void SAL_CALL removeKeyHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException); 526 virtual void SAL_CALL addMouseClickHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseClickHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException); 527 virtual void SAL_CALL removeMouseClickHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseClickHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException); 528 529 protected: 530 #ifdef WNT 531 OGenericUnoController(); // never implemented 532 #endif 533 }; 534 } 535 536 #endif //DBAUI_GENERICCONTROLLER_HXX 537 538 539