CWS-TOOLING: integrate CWS alf01
2008-12-10 09:35:35 +0100 as r265152 : #158798# hide internal service 2008-12-09 15:29:11 +0100 cd r265098 : #158857# Check index correctly, must be zero 2008-12-09 12:06:21 +0100 mhu r265075 : #158857# Fixed compiler warning(s). 2008-12-09 11:09:34 +0100 cd r265064 : #158857# Added access to the window state configuration to support setting title of internal docking windows via <Module>WindowState.xcu files 2008-12-09 10:43:53 +0100 as r265063 : #158798# make resizes working better 2008-12-08 17:08:05 +0100 mhu r265010 : #158857# Fixed compiler warning(s). 2008-12-08 15:19:04 +0100 as r264999 : #158857# make WindowContentFactories.xcs part of installation set 2008-12-08 13:23:37 +0100 as r264993 : #158857# actualize size on child window 2008-12-08 10:14:05 +0100 cd r264977 : #158857# More helper functions and support to show/hide internal docking windows 2008-12-08 10:13:08 +0100 cd r264976 : #158857# SfxTitleDockingWindow now uses a factory for content window. Additional documentation for special IDs 2008-12-05 07:58:07 +0100 as r264885 : remove obsolete code (not referenced inside makefile any longer) 2008-12-04 18:57:08 +0100 mhu r264871 : #158857# Fixed compiler warning. 2008-12-04 16:13:12 +0100 mhu r264851 : #158857# Fixed compiler warning. 2008-12-04 15:46:45 +0100 as r264849 : solve merge conflicts right 2008-12-04 09:20:26 +0100 cd r264818 : 2008-12-04 09:19:32 +0100 cd r264817 : 2008-12-04 09:19:07 +0100 cd r264816 : Resolved conflicts 2008-12-04 09:13:27 +0100 cd r264815 : New window content factory manager with configuration support added. 2008-12-03 15:15:50 +0100 as r264791 : #158798# make sure tab window will show its content the first time its made visible 2008-12-03 10:59:30 +0100 as r264752 : #158798# new helper service for a dockable tab control window 2008-12-02 15:39:48 +0100 as r264707 : #158798# fix crash in MouseButtonDown for TabControl 2008-12-02 10:28:20 +0100 cd r264665 : #158857# Resolved conflicts on merge 2008-12-02 09:58:36 +0100 cd r264662 : #158857# Added predefined slots for the internal docking windows. Currently only ten predefined docking windows are possible 2008-12-01 09:44:49 +0100 cd r264586 : #158857# Fix problem with close the floated docking window with closer 2008-11-28 13:42:34 +0100 cd r264550 : #158857# First additional code to create a docking window. Very preliminary and not near to final code 2008-11-28 11:53:51 +0100 cd r264538 : #158857# First additional code to create a docking window. Very preliminary and not near to final code 2008-11-28 11:32:38 +0100 cd r264534 : #158857# First version of docking window factory and additional helper classes 2008-11-21 09:46:36 +0100 jsc r264110 : #158798# remove warnings 2008-11-20 17:59:07 +0100 pb r264090 : fix: #158798# tabcontainerwindow.obj and tabdialog.obj added 2008-11-20 17:55:57 +0100 pb r264089 : fix: #i158798# implementation of service TabContainerWindow 2008-11-20 17:52:52 +0100 pb r264088 : fix: #158798# implementation of the TabDialog and its Pages for the TabContainerWindow service 2008-11-20 17:51:26 +0100 pb r264087 : fix: #i158798# TabContainerWindow added 2008-11-20 17:50:11 +0100 pb r264086 : fix: #158798# tabcontainerwindow.obj and tabdialog.obj added 2008-11-20 17:47:16 +0100 pb r264085 : fix: #158798# new resource: TabDialog DLG_TABCONTAINER 2008-11-20 17:46:06 +0100 pb r264084 : fix: #i158798# added ids for TABCONTAINER... 2008-11-20 17:43:19 +0100 pb r264082 : fix: #158798# IMPLEMENTATION/SERVICENAME_TABCONTAINERWINDOW added 2008-11-20 17:43:00 +0100 pb r264081 : fix: #i158798# implementation of service TabContainerWindow 2008-11-20 17:40:42 +0100 pb r264080 : fix: #158798# TabContainerWindow.idl added 2008-11-20 17:36:57 +0100 pb r264079 : fix: #158798# new service TabContainerWindow 2008-11-20 17:33:05 +0100 pb r264077 : fix: #158798# show tooltip if only a image is shown 2008-11-18 15:10:08 +0100 jsc r263770 : CWS-TOOLING: rebase CWS alf01 to trunk@263288 (milestone: DEV300:m35) 2008-11-18 09:55:21 +0100 jsc r263749 : merge from trunk 2008-11-18 09:54:30 +0100 jsc r263748 : merge from trunk 2008-11-13 17:01:17 +0100 pl r263655 : fix some warnings 2008-10-21 15:38:37 +0200 pl r262572 : #i95201# add: EnablePage 2008-10-20 18:57:53 +0200 pl r262335 : #i95201# add: images for tab items 2008-10-20 17:26:50 +0200 pl r262330 : #i95201# remove old tools list
This commit is contained in:
392
framework/source/classes/fwktabwindow.cxx
Normal file
392
framework/source/classes/fwktabwindow.cxx
Normal file
@@ -0,0 +1,392 @@
|
||||
/*************************************************************************
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright 2008 by Sun Microsystems, Inc.
|
||||
*
|
||||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* $RCSfile: backingwindow.cxx,v $
|
||||
* $Revision: 1.12 $
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 3
|
||||
* only, as published by the Free Software Foundation.
|
||||
*
|
||||
* OpenOffice.org is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License version 3 for more details
|
||||
* (a copy is included in the LICENSE file that accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* version 3 along with OpenOffice.org. If not, see
|
||||
* <http://www.openoffice.org/license.html>
|
||||
* for a copy of the LGPLv3 License.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
// autogen include statement, do not remove
|
||||
#include "precompiled_framework.hxx"
|
||||
|
||||
#include <classes/fwktabwindow.hxx>
|
||||
#include "framework.hrc"
|
||||
#include <classes/fwkresid.hxx>
|
||||
|
||||
#include <com/sun/star/awt/PosSize.hpp>
|
||||
#include <com/sun/star/awt/XContainerWindowEventHandler.hpp>
|
||||
#include <com/sun/star/awt/XContainerWindowProvider.hpp>
|
||||
#include <com/sun/star/awt/XWindow.hpp>
|
||||
#include <com/sun/star/awt/XWindowPeer.hpp>
|
||||
#include <com/sun/star/beans/NamedValue.hpp>
|
||||
#include <com/sun/star/graphic/XGraphic.hpp>
|
||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include <toolkit/helper/vclunohelper.hxx>
|
||||
#include <tools/stream.hxx>
|
||||
#include <vcl/bitmap.hxx>
|
||||
#include <vcl/image.hxx>
|
||||
#include <vcl/msgbox.hxx>
|
||||
|
||||
const ::rtl::OUString SERVICENAME_WINPROVIDER
|
||||
= ::rtl::OUString::createFromAscii("com.sun.star.awt.ContainerWindowProvider");
|
||||
const ::rtl::OUString EXTERNAL_EVENT = ::rtl::OUString::createFromAscii("external_event");
|
||||
const ::rtl::OUString BACK_METHOD = ::rtl::OUString::createFromAscii("back");
|
||||
const ::rtl::OUString INITIALIZE_METHOD = ::rtl::OUString::createFromAscii("initialize");
|
||||
const ::rtl::OUString OK_METHOD = ::rtl::OUString::createFromAscii("ok");
|
||||
|
||||
using namespace ::com::sun::star;
|
||||
|
||||
namespace framework
|
||||
{
|
||||
|
||||
// class FwkTabControl ---------------------------------------------------
|
||||
|
||||
FwkTabControl::FwkTabControl( Window* pParent, const ResId& rResId ) :
|
||||
|
||||
TabControl( pParent, rResId )
|
||||
{
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabControl::BroadcastEvent( ULONG nEvent )
|
||||
{
|
||||
if ( VCLEVENT_TABPAGE_ACTIVATE == nEvent || VCLEVENT_TABPAGE_DEACTIVATE == nEvent )
|
||||
ImplCallEventListeners( nEvent, (void*)(ULONG)GetCurPageId() );
|
||||
else
|
||||
{
|
||||
DBG_ERRORFILE( "FwkTabControl::BroadcastEvent(): illegal event" );
|
||||
}
|
||||
}
|
||||
|
||||
// class FwkTabPage ------------------------------------------------
|
||||
|
||||
FwkTabPage::FwkTabPage(
|
||||
Window* pParent, const rtl::OUString& rPageURL, const rtl::OUString& rEventHdl,
|
||||
const css::uno::Reference< css::awt::XContainerWindowProvider >& rProvider ) :
|
||||
|
||||
TabPage( pParent, WB_DIALOGCONTROL ),
|
||||
|
||||
m_sPageURL ( rPageURL ),
|
||||
m_sEventHdl ( rEventHdl ),
|
||||
m_xWinProvider ( rProvider )
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
FwkTabPage::~FwkTabPage()
|
||||
{
|
||||
Hide();
|
||||
DeactivatePage();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabPage::CreateDialog()
|
||||
{
|
||||
try
|
||||
{
|
||||
uno::Reference< uno::XInterface > xHandler;
|
||||
if ( m_sEventHdl.getLength() > 0 )
|
||||
{
|
||||
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
|
||||
m_xEventHdl = uno::Reference< awt::XContainerWindowEventHandler >(
|
||||
xFactory->createInstance( m_sEventHdl ), uno::UNO_QUERY );
|
||||
xHandler = m_xEventHdl;
|
||||
}
|
||||
uno::Reference< awt::XWindowPeer > xParent( VCLUnoHelper::GetInterface( this ), uno::UNO_QUERY );
|
||||
m_xPage = uno::Reference < awt::XWindow >(
|
||||
m_xWinProvider->createContainerWindow(
|
||||
m_sPageURL, rtl::OUString(), xParent, xHandler ), uno::UNO_QUERY );
|
||||
|
||||
CallMethod( INITIALIZE_METHOD );
|
||||
}
|
||||
catch ( lang::IllegalArgumentException& )
|
||||
{
|
||||
DBG_ERRORFILE( "FwkTabPage::CreateDialog(): illegal argument" );
|
||||
}
|
||||
catch ( uno::Exception& )
|
||||
{
|
||||
DBG_ERRORFILE( "FwkTabPage::CreateDialog(): exception of XDialogProvider2::createContainerWindow()" );
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
sal_Bool FwkTabPage::CallMethod( const rtl::OUString& rMethod )
|
||||
{
|
||||
sal_Bool bRet = sal_False;
|
||||
if ( m_xEventHdl.is() )
|
||||
{
|
||||
try
|
||||
{
|
||||
bRet = m_xEventHdl->callHandlerMethod( m_xPage, uno::makeAny( rMethod ), EXTERNAL_EVENT );
|
||||
}
|
||||
catch ( uno::Exception& )
|
||||
{
|
||||
DBG_ERRORFILE( "FwkTabPage::CallMethod(): exception of XDialogEventHandler::callHandlerMethod()" );
|
||||
}
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabPage::ActivatePage()
|
||||
{
|
||||
TabPage::ActivatePage();
|
||||
|
||||
if ( !m_xPage.is() )
|
||||
CreateDialog();
|
||||
|
||||
if ( m_xPage.is() )
|
||||
{
|
||||
Resize ();
|
||||
m_xPage->setVisible( sal_True );
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabPage::DeactivatePage()
|
||||
{
|
||||
TabPage::DeactivatePage();
|
||||
|
||||
if ( m_xPage.is() )
|
||||
m_xPage->setVisible( sal_False );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabPage::Resize()
|
||||
{
|
||||
if ( m_xPage.is () )
|
||||
{
|
||||
Size aSize = GetSizePixel ();
|
||||
Point aPos = GetPosPixel ();
|
||||
|
||||
m_xPage->setPosSize( 0, 0, aSize.Width()-1 , aSize.Height()-1, awt::PosSize::POSSIZE );
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabPage::Reset()
|
||||
{
|
||||
CallMethod( BACK_METHOD );
|
||||
ActivatePage();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabPage::Save()
|
||||
{
|
||||
CallMethod( OK_METHOD );
|
||||
}
|
||||
|
||||
// class FwkTabWindow ---------------------------------------------
|
||||
|
||||
FwkTabWindow::FwkTabWindow( Window* pParent ) :
|
||||
|
||||
Window( pParent, FwkResId( WIN_TABWINDOW ) ),
|
||||
|
||||
m_aTabCtrl ( this, FwkResId( TC_TABCONTROL ) )
|
||||
{
|
||||
uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
|
||||
m_xWinProvider = uno::Reference < awt::XContainerWindowProvider >(
|
||||
xFactory->createInstance( SERVICENAME_WINPROVIDER ), uno::UNO_QUERY );
|
||||
|
||||
SetPaintTransparent(true);
|
||||
|
||||
m_aTabCtrl.SetActivatePageHdl( LINK( this, FwkTabWindow, ActivatePageHdl ) );
|
||||
m_aTabCtrl.SetDeactivatePageHdl( LINK( this, FwkTabWindow, DeactivatePageHdl ) );
|
||||
m_aTabCtrl.Show();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
FwkTabWindow::~FwkTabWindow()
|
||||
{
|
||||
ClearEntryList();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabWindow::ClearEntryList()
|
||||
{
|
||||
TabEntryList::const_iterator pIt;
|
||||
for ( pIt = m_TabList.begin();
|
||||
pIt != m_TabList.end();
|
||||
++pIt )
|
||||
{
|
||||
delete *pIt;
|
||||
}
|
||||
|
||||
m_TabList.clear();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
TabEntry* FwkTabWindow::FindEntry( sal_Int32 nIndex ) const
|
||||
{
|
||||
TabEntry* pEntry = NULL;
|
||||
|
||||
TabEntryList::const_iterator pIt;
|
||||
for ( pIt = m_TabList.begin();
|
||||
pIt != m_TabList.end();
|
||||
++pIt )
|
||||
{
|
||||
if ( (*pIt)->m_nIndex == nIndex )
|
||||
{
|
||||
pEntry = *pIt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return pEntry;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
IMPL_LINK( FwkTabWindow, ActivatePageHdl, TabControl *, EMPTYARG )
|
||||
{
|
||||
const USHORT nId = m_aTabCtrl.GetCurPageId();
|
||||
FwkTabPage* pTabPage = static_cast< FwkTabPage* >( m_aTabCtrl.GetTabPage( nId ) );
|
||||
if ( !pTabPage )
|
||||
{
|
||||
TabEntry* pEntry = FindEntry( nId );
|
||||
if ( pEntry )
|
||||
{
|
||||
pTabPage = new FwkTabPage( &m_aTabCtrl, pEntry->m_sPageURL, pEntry->m_sEventHdl, m_xWinProvider );
|
||||
pTabPage->Show();
|
||||
pTabPage->ActivatePage();
|
||||
m_aTabCtrl.SetTabPage( nId, pTabPage );
|
||||
}
|
||||
}
|
||||
m_aTabCtrl.BroadcastEvent( VCLEVENT_TABPAGE_ACTIVATE );
|
||||
return 1;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
IMPL_LINK( FwkTabWindow, DeactivatePageHdl, TabControl *, EMPTYARG )
|
||||
{
|
||||
m_aTabCtrl.BroadcastEvent( VCLEVENT_TABPAGE_DEACTIVATE );
|
||||
return 1;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
IMPL_LINK( FwkTabWindow, CloseHdl, PushButton *, EMPTYARG )
|
||||
{
|
||||
// Close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabWindow::AddEventListener( const Link& rEventListener )
|
||||
{
|
||||
m_aTabCtrl.AddEventListener( rEventListener );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
FwkTabPage* FwkTabWindow::AddTabPage( sal_Int32 nIndex, const uno::Sequence< beans::NamedValue >& rProperties )
|
||||
{
|
||||
::rtl::OUString sTitle, sToolTip, sPageURL, sEventHdl;
|
||||
uno::Reference< graphic::XGraphic > xImage;
|
||||
bool bDisabled = false;
|
||||
|
||||
sal_Int32 i = 0, nLen = rProperties.getLength();
|
||||
for ( i = 0; i < nLen; ++i )
|
||||
{
|
||||
beans::NamedValue aValue = rProperties[i];
|
||||
::rtl::OUString sName = aValue.Name;
|
||||
uno::Any aAny = aValue.Value;
|
||||
|
||||
if ( sName.equalsAscii("Title") )
|
||||
aAny >>= sTitle;
|
||||
else if ( sName.equalsAscii("ToolTip") )
|
||||
aAny >>= sToolTip;
|
||||
else if ( sName.equalsAscii("PageURL") )
|
||||
aAny >>= sPageURL;
|
||||
else if ( sName.equalsAscii("EventHdl") )
|
||||
aAny >>= sEventHdl;
|
||||
else if ( sName.equalsAscii("Image") )
|
||||
aAny >>= xImage;
|
||||
else if ( sName.equalsAscii("Disabled") )
|
||||
aAny >>= bDisabled;
|
||||
}
|
||||
|
||||
TabEntry* pEntry = new TabEntry( nIndex, sPageURL, sEventHdl );
|
||||
m_TabList.push_back( pEntry );
|
||||
USHORT nIdx = static_cast< USHORT >( nIndex );
|
||||
m_aTabCtrl.InsertPage( nIdx, sTitle );
|
||||
if ( sToolTip.getLength() > 0 )
|
||||
m_aTabCtrl.SetHelpText( nIdx, sToolTip );
|
||||
if ( xImage.is() )
|
||||
m_aTabCtrl.SetPageImage( nIdx, Image( xImage ) );
|
||||
if ( bDisabled )
|
||||
m_aTabCtrl.EnablePage( nIdx, false );
|
||||
|
||||
return pEntry->m_pPage;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabWindow::ActivatePage( sal_Int32 nIndex )
|
||||
{
|
||||
m_aTabCtrl.SetCurPageId( static_cast< USHORT >( nIndex ) );
|
||||
ActivatePageHdl( &m_aTabCtrl );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
void FwkTabWindow::RemovePage( sal_Int32 nIndex )
|
||||
{
|
||||
m_aTabCtrl.RemovePage( static_cast< USHORT >( nIndex ) );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
sal_Int32 FwkTabWindow::GetActivePageId() const
|
||||
{
|
||||
return m_aTabCtrl.GetCurPageId();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
void FwkTabWindow::Resize()
|
||||
{
|
||||
Size aPageSize = GetSizePixel();
|
||||
m_aTabCtrl.SetTabPageSizePixel( aPageSize );
|
||||
}
|
||||
|
||||
} // namespace framework
|
||||
|
@@ -59,7 +59,8 @@ SLOFILES= \
|
||||
$(SLO)$/fwkresid.obj \
|
||||
$(SLO)$/framelistanalyzer.obj \
|
||||
$(SLO)$/sfxhelperfunctions.obj \
|
||||
$(SLO)$/menuextensionsupplier.obj
|
||||
$(SLO)$/menuextensionsupplier.obj \
|
||||
$(SLO)$/fwktabwindow.obj
|
||||
|
||||
SRS1NAME=$(TARGET)
|
||||
SRC1FILES =\
|
||||
|
@@ -38,6 +38,9 @@
|
||||
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;
|
||||
|
||||
|
||||
|
||||
using namespace ::com::sun::star::uno;
|
||||
@@ -48,6 +51,7 @@ namespace framework
|
||||
|
||||
pfunc_setToolBoxControllerCreator SAL_CALL SetToolBoxControllerCreator( pfunc_setToolBoxControllerCreator pSetToolBoxControllerCreator )
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pfunc_setToolBoxControllerCreator pOldSetToolBoxControllerCreator = pToolBoxControllerCreator;
|
||||
pToolBoxControllerCreator = pSetToolBoxControllerCreator;
|
||||
return pOldSetToolBoxControllerCreator;
|
||||
@@ -55,14 +59,21 @@ pfunc_setToolBoxControllerCreator SAL_CALL SetToolBoxControllerCreator( pfunc_se
|
||||
|
||||
svt::ToolboxController* SAL_CALL CreateToolBoxController( const Reference< XFrame >& rFrame, ToolBox* pToolbox, unsigned short nID, const ::rtl::OUString& aCommandURL )
|
||||
{
|
||||
if ( pToolBoxControllerCreator )
|
||||
return (*pToolBoxControllerCreator)( rFrame, pToolbox, nID, aCommandURL );
|
||||
pfunc_setToolBoxControllerCreator pFactory = NULL;
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pFactory = pToolBoxControllerCreator;
|
||||
}
|
||||
|
||||
if ( pFactory )
|
||||
return (*pFactory)( rFrame, pToolbox, nID, aCommandURL );
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pfunc_setStatusBarControllerCreator SAL_CALL SetStatusBarControllerCreator( pfunc_setStatusBarControllerCreator pSetStatusBarControllerCreator )
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pfunc_setStatusBarControllerCreator pOldSetStatusBarControllerCreator = pSetStatusBarControllerCreator;
|
||||
pStatusBarControllerCreator = pSetStatusBarControllerCreator;
|
||||
return pOldSetStatusBarControllerCreator;
|
||||
@@ -70,14 +81,21 @@ pfunc_setStatusBarControllerCreator SAL_CALL SetStatusBarControllerCreator( pfun
|
||||
|
||||
svt::StatusbarController* SAL_CALL CreateStatusBarController( const Reference< XFrame >& rFrame, StatusBar* pStatusBar, unsigned short nID, const ::rtl::OUString& aCommandURL )
|
||||
{
|
||||
if ( pStatusBarControllerCreator )
|
||||
return (*pStatusBarControllerCreator)( rFrame, pStatusBar, nID, aCommandURL );
|
||||
pfunc_setStatusBarControllerCreator pFactory = NULL;
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pFactory = pStatusBarControllerCreator;
|
||||
}
|
||||
|
||||
if ( pFactory )
|
||||
return (*pFactory)( rFrame, pStatusBar, nID, aCommandURL );
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pfunc_getRefreshToolbars SAL_CALL SetRefreshToolbars( pfunc_getRefreshToolbars pNewRefreshToolbarsFunc )
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pfunc_getRefreshToolbars pOldFunc = pRefreshToolbars;
|
||||
pRefreshToolbars = pNewRefreshToolbarsFunc;
|
||||
|
||||
@@ -86,8 +104,58 @@ pfunc_getRefreshToolbars SAL_CALL SetRefreshToolbars( pfunc_getRefreshToolbars p
|
||||
|
||||
void SAL_CALL RefreshToolbars( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame )
|
||||
{
|
||||
if ( pRefreshToolbars )
|
||||
(*pRefreshToolbars)( rFrame );
|
||||
pfunc_getRefreshToolbars pCallback = NULL;
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pCallback = pRefreshToolbars;
|
||||
}
|
||||
|
||||
if ( pCallback )
|
||||
(*pCallback)( rFrame );
|
||||
}
|
||||
|
||||
pfunc_createDockingWindow SAL_CALL SetDockingWindowCreator( pfunc_createDockingWindow pNewCreateDockingWindow )
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pfunc_createDockingWindow pOldFunc = pCreateDockingWindow;
|
||||
pCreateDockingWindow = pNewCreateDockingWindow;
|
||||
|
||||
return pOldFunc;
|
||||
}
|
||||
|
||||
void SAL_CALL CreateDockingWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL )
|
||||
{
|
||||
pfunc_createDockingWindow pFactory = NULL;
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pFactory = pCreateDockingWindow;
|
||||
}
|
||||
|
||||
if ( pFactory )
|
||||
(*pFactory)( rFrame, rResourceURL );
|
||||
}
|
||||
|
||||
pfunc_isDockingWindowVisible SAL_CALL SetIsDockingWindowVisible( pfunc_isDockingWindowVisible pNewIsDockingWindowVisible)
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pfunc_isDockingWindowVisible pOldFunc = pIsDockingWindowVisible;
|
||||
pIsDockingWindowVisible = pNewIsDockingWindowVisible;
|
||||
|
||||
return pOldFunc;
|
||||
}
|
||||
|
||||
bool SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rResourceURL )
|
||||
{
|
||||
pfunc_isDockingWindowVisible pCall = NULL;
|
||||
{
|
||||
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
|
||||
pCall = pIsDockingWindowVisible;
|
||||
}
|
||||
|
||||
if ( pIsDockingWindowVisible )
|
||||
return (*pIsDockingWindowVisible)( rFrame, rResourceURL );
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user