diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-05-07 10:19:42 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-05-07 10:19:42 +0200 |
commit | 0434aa5708d99334f445b894c48b7650732cc2cb (patch) | |
tree | 0b6822d83de04d727a1d0afe588704e15b7e5e9b /framework | |
parent | 5ac537f937a7d8bfbe6c12203e8f10d0d92441df (diff) |
slidecopy: allow activating a tool panel view XLayoutManager::showElement
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/classes/sfxhelperfunctions.hxx | 5 | ||||
-rw-r--r-- | framework/source/classes/sfxhelperfunctions.cxx | 23 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 8 |
3 files changed, 36 insertions, 0 deletions
diff --git a/framework/inc/classes/sfxhelperfunctions.hxx b/framework/inc/classes/sfxhelperfunctions.hxx index ab20e9f0f25f..ac3fa472f249 100644 --- a/framework/inc/classes/sfxhelperfunctions.hxx +++ b/framework/inc/classes/sfxhelperfunctions.hxx @@ -40,6 +40,7 @@ typedef svt::StatusbarController* ( *pfunc_setStatusBarControllerCreator)( const typedef void ( *pfunc_getRefreshToolbars)( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); typedef void ( *pfunc_createDockingWindow)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL ); typedef bool ( *pfunc_isDockingWindowVisible)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL ); +typedef void ( *pfunc_activateToolPanel)( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL ); namespace framework { @@ -63,6 +64,10 @@ void SAL_CALL CreateDockingWindow( const ::com::sun::star::uno::Reference< ::com pfunc_isDockingWindowVisible SAL_CALL SetIsDockingWindowVisible( pfunc_isDockingWindowVisible pIsDockingWindowVisible ); bool SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL ); + +pfunc_activateToolPanel SAL_CALL SetActivateToolPanel( pfunc_activateToolPanel i_pActivator ); + +void SAL_CALL ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL ); } #endif // __FRAMEWORK_CLASSES_SFXHELPERFUNCTIONS_HXX_ diff --git a/framework/source/classes/sfxhelperfunctions.cxx b/framework/source/classes/sfxhelperfunctions.cxx index 655d96cdb681..c6953b1ea2b9 100644 --- a/framework/source/classes/sfxhelperfunctions.cxx +++ b/framework/source/classes/sfxhelperfunctions.cxx @@ -32,11 +32,14 @@ #include <classes/sfxhelperfunctions.hxx> #endif +#include <tools/diagnose_ex.h> + static pfunc_setToolBoxControllerCreator pToolBoxControllerCreator = NULL; static pfunc_setStatusBarControllerCreator pStatusBarControllerCreator = NULL; static pfunc_getRefreshToolbars pRefreshToolbars = NULL; static pfunc_createDockingWindow pCreateDockingWindow = NULL; static pfunc_isDockingWindowVisible pIsDockingWindowVisible = NULL; +static pfunc_activateToolPanel pActivateToolPanel = NULL; @@ -155,4 +158,24 @@ bool SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< :: return false; } +pfunc_activateToolPanel SAL_CALL SetActivateToolPanel( pfunc_activateToolPanel i_pActivator ) +{ + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + pfunc_activateToolPanel pOldFunc = pActivateToolPanel; + pActivateToolPanel = i_pActivator; + return pOldFunc; +} + +void SAL_CALL ActivateToolPanel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame, const ::rtl::OUString& i_rPanelURL ) +{ + pfunc_activateToolPanel pActivator = NULL; + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + pActivator = pActivateToolPanel; + } + + ENSURE_OR_RETURN_VOID( pActivator, "framework::ActivateToolPanel: no activator function!" ); + (*pActivator)( i_rFrame, i_rPanelURL ); +} + } diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 458368bd6581..f72759891acb 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -4707,6 +4707,14 @@ throw (RuntimeException) impl_setDockingWindowVisibility( xSMGR, xFrame, aElementName, true ); } + else if ( aElementType.equalsIgnoreAsciiCaseAscii( "toolpanel" )) + { + ReadGuard aReadGuard( m_aLock ); + css::uno::Reference< css::frame::XFrame > xFrame( m_xFrame ); + aReadGuard.unlock(); + + ActivateToolPanel( m_xFrame, aName ); + } } if ( bNotify ) |