Kaydet (Commit) 0b3a7747 authored tarafından Ariel Constenla-Haile's avatar Ariel Constenla-Haile

#i121442# - framework refactoring and new code to support status bar merging and…

#i121442# - framework refactoring and new code to support status bar merging and UNO StatusbarControllers
üst b2db8c4c
...@@ -145,6 +145,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ ...@@ -145,6 +145,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
framework/source/uielement/controlmenucontroller \ framework/source/uielement/controlmenucontroller \
framework/source/uielement/dropdownboxtoolbarcontroller \ framework/source/uielement/dropdownboxtoolbarcontroller \
framework/source/uielement/edittoolbarcontroller \ framework/source/uielement/edittoolbarcontroller \
framework/source/uielement/genericstatusbarcontroller \
framework/source/uielement/generictoolbarcontroller \ framework/source/uielement/generictoolbarcontroller \
framework/source/uielement/imagebuttontoolbarcontroller \ framework/source/uielement/imagebuttontoolbarcontroller \
framework/source/uielement/langselectionstatusbarcontroller \ framework/source/uielement/langselectionstatusbarcontroller \
...@@ -158,7 +159,9 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ ...@@ -158,7 +159,9 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
framework/source/uielement/recentfilesmenucontroller \ framework/source/uielement/recentfilesmenucontroller \
framework/source/uielement/spinfieldtoolbarcontroller \ framework/source/uielement/spinfieldtoolbarcontroller \
framework/source/uielement/statusbar \ framework/source/uielement/statusbar \
framework/source/uielement/statusbaritem \
framework/source/uielement/statusbarmanager \ framework/source/uielement/statusbarmanager \
framework/source/uielement/statusbarmerger \
framework/source/uielement/statusbarwrapper \ framework/source/uielement/statusbarwrapper \
framework/source/uielement/statusindicatorinterfacewrapper \ framework/source/uielement/statusindicatorinterfacewrapper \
framework/source/uielement/togglebuttontoolbarcontroller \ framework/source/uielement/togglebuttontoolbarcontroller \
......
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef __FRAMEWORK_UIELEMENT_GENERICSTATUSBARCONTROLLER_HXX_
#define __FRAMEWORK_UIELEMENT_GENERICSTATUSBARCONTROLLER_HXX_
#include <svtools/statusbarcontroller.hxx>
#include <com/sun/star/graphic/XGraphic.hpp>
namespace framework
{
class AddonStatusbarItemData;
class GenericStatusbarController : public svt::StatusbarController
{
public:
GenericStatusbarController( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame,
const com::sun::star::uno::Reference< com::sun::star::ui::XStatusbarItem >& rxItem,
AddonStatusbarItemData *pItemData );
virtual ~GenericStatusbarController();
// XComponent
virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
// XStatusListener
virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
const ::com::sun::star::awt::Rectangle& rOutputRectangle,
::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
protected:
sal_Bool m_bEnabled;
sal_Bool m_bOwnerDraw;
AddonStatusbarItemData *m_pItemData;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xGraphic;
};
}
#endif
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef __FRAMEWORK_UIELEMENT_STATUSBARITEM_HXX_
#define __FRAMEWORK_UIELEMENT_STATUSBARITEM_HXX_
#include <com/sun/star/ui/XStatusbarItem.hpp>
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/basemutex.hxx>
class StatusBar;
namespace framework
{
struct AddonStatusbarItemData;
typedef cppu::WeakComponentImplHelper1< com::sun::star::ui::XStatusbarItem > StatusbarItem_Base;
class StatusbarItem : protected cppu::BaseMutex,
public StatusbarItem_Base
{
public:
explicit StatusbarItem(
StatusBar *pStatusBar,
AddonStatusbarItemData *pItemData,
sal_uInt16 nId,
const rtl::OUString& aCommand );
~StatusbarItem();
void SAL_CALL disposing();
// com::sun::star::ui::XStatusbarItem Attributes
virtual ::rtl::OUString SAL_CALL getCommand() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_uInt16 SAL_CALL getItemId() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_uInt32 SAL_CALL getWidth() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_uInt16 SAL_CALL getStyle() throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Int32 SAL_CALL getOffset() throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::awt::Rectangle SAL_CALL getItemRect() throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getText() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setText( const rtl::OUString& rText ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getHelpText() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setHelpText( const rtl::OUString& rHelpText ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getQuickHelpText() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setQuickHelpText( const rtl::OUString& rQuickHelpText ) throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getAccessibleName() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setAccessibleName( const rtl::OUString& rAccessibleName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL getVisible() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (::com::sun::star::uno::RuntimeException);
// com::sun::star::ui::XStatusbarItem Methods
virtual void SAL_CALL repaint( ) throw (::com::sun::star::uno::RuntimeException);
private:
StatusBar *m_pStatusBar;
AddonStatusbarItemData *m_pItemData;
sal_uInt16 m_nId;
sal_uInt16 m_nStyle;
rtl::OUString m_aCommand;
};
}
#endif
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <cppuhelper/weak.hxx> #include <cppuhelper/weak.hxx>
#include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/interfacecontainer.hxx>
#include <vcl/status.hxx> #include <vcl/status.hxx>
#include <map>
namespace framework namespace framework
{ {
...@@ -117,7 +118,7 @@ class StatusBarManager : public ::com::sun::star::frame::XFrameActionListener ...@@ -117,7 +118,7 @@ class StatusBarManager : public ::com::sun::star::frame::XFrameActionListener
void MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL ::com::sun::star::frame::XStatusbarController::*_pMethod )(const ::com::sun::star::awt::MouseEvent&)); void MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL ::com::sun::star::frame::XStatusbarController::*_pMethod )(const ::com::sun::star::awt::MouseEvent&));
protected: protected:
typedef std::vector< ::com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > > StatusBarControllerVector; typedef std::map< sal_uInt16, ::com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > > StatusBarControllerMap;
sal_Bool m_bDisposed : 1, sal_Bool m_bDisposed : 1,
m_bFrameActionRegistered : 1, m_bFrameActionRegistered : 1,
...@@ -128,7 +129,7 @@ class StatusBarManager : public ::com::sun::star::frame::XFrameActionListener ...@@ -128,7 +129,7 @@ class StatusBarManager : public ::com::sun::star::frame::XFrameActionListener
rtl::OUString m_aResourceName; rtl::OUString m_aResourceName;
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame; com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame;
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_xUICommandLabels; com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_xUICommandLabels;
StatusBarControllerVector m_aControllerVector; StatusBarControllerMap m_aControllerMap;
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerRegistration > m_xStatusbarControllerRegistration; ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUIControllerRegistration > m_xStatusbarControllerRegistration;
......
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef __FRAMEWORK_UIELEMENT_STATUSBARMERGER_HXX_
#define __FRAMEWORK_UIELEMENT_STATUSBARMERGER_HXX_
#include <com/sun/star/beans/PropertyValue.hpp>
#include <rtl/ustring.hxx>
#include <uielement/statusbar.hxx>
namespace framework
{
struct AddonStatusbarItemData
{
rtl::OUString aLabel;
sal_uInt16 nItemBits;
};
struct AddonStatusbarItem
{
rtl::OUString aCommandURL;
rtl::OUString aLabel;
rtl::OUString aContext;
sal_uInt16 nItemBits;
sal_Int16 nWidth;
};
typedef ::std::vector< AddonStatusbarItem > AddonStatusbarItemContainer;
class StatusbarMerger
{
public:
static bool IsCorrectContext( const ::rtl::OUString& aContext,
const ::rtl::OUString& aModuleIdentifier );
static bool ConvertSeqSeqToVector( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > &rSequence,
AddonStatusbarItemContainer& rContainer );
static sal_uInt16 FindReferencePos( StatusBar* pStatusbar,
const ::rtl::OUString& rReferencePoint );
static bool ProcessMergeOperation( StatusBar* pStatusbar,
sal_uInt16 nPos,
sal_uInt16& rItemId,
const ::rtl::OUString& rModuleIdentifier,
const ::rtl::OUString& rMergeCommand,
const ::rtl::OUString& rMergeCommandParameter,
const AddonStatusbarItemContainer& rItems );
static bool ProcessMergeFallback( StatusBar* pStatusbar,
sal_uInt16 nPos,
sal_uInt16& rItemId,
const ::rtl::OUString& rModuleIdentifier,
const ::rtl::OUString& rMergeCommand,
const ::rtl::OUString& rMergeFallback,
const AddonStatusbarItemContainer& rItems );
private:
StatusbarMerger();
StatusbarMerger( const StatusbarMerger& );
StatusbarMerger& operator=( const StatusbarMerger& );
};
}
#endif
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <uielement/genericstatusbarcontroller.hxx>
#include <uielement/statusbarmerger.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/status.hxx>
#include <vcl/image.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <toolkit/helper/convert.hxx>
#include <com/sun/star/ui/ItemStyle.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/ImageDrawMode.hpp>
#include <com/sun/star/graphic/GraphicType.hpp>
using ::rtl::OUString;
using namespace ::cppu;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
namespace framework
{
GenericStatusbarController::GenericStatusbarController(
const Reference< XMultiServiceFactory >& rxServiceManager,
const Reference< XFrame >& rxFrame,
const Reference< ui::XStatusbarItem >& rxItem,
AddonStatusbarItemData *pItemData )
: svt::StatusbarController( rxServiceManager, rxFrame, OUString(), 0 )
, m_bEnabled( sal_False )
, m_bOwnerDraw( sal_False )
, m_pItemData( pItemData )
, m_xGraphic()
{
m_xStatusbarItem = rxItem;
if ( m_xStatusbarItem.is() )
{
m_aCommandURL = m_xStatusbarItem->getCommand();
m_nID = m_xStatusbarItem->getItemId();
m_bOwnerDraw = ( m_xStatusbarItem->getStyle() & ui::ItemStyle::OWNER_DRAW ) == ui::ItemStyle::OWNER_DRAW;
if ( !m_bOwnerDraw && m_pItemData && m_pItemData->aLabel.getLength() )
m_xStatusbarItem->setText( m_pItemData->aLabel );
}
}
GenericStatusbarController::~GenericStatusbarController()
{
}
void SAL_CALL GenericStatusbarController::dispose()
throw ( RuntimeException )
{
svt::StatusbarController::dispose();
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
m_pItemData = NULL;
m_xGraphic.clear();
m_xStatusbarItem.clear();
}
void SAL_CALL GenericStatusbarController::statusChanged(
const FeatureStateEvent& rEvent)
throw ( RuntimeException )
{
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
if ( m_bDisposed || !m_xStatusbarItem.is() )
return;
m_bEnabled = rEvent.IsEnabled;
rtl::OUString aStrValue;
Reference< graphic::XGraphic > aGraphic;
if ( rEvent.State >>= aStrValue )
{
if ( !m_bOwnerDraw )
m_xStatusbarItem->setText( aStrValue );
else
{
if ( aStrValue.getLength() )
{
m_xStatusbarItem->setQuickHelpText( aStrValue );
}
}
}
else if ( ( rEvent.State >>= aGraphic ) && m_bOwnerDraw )
{
m_xGraphic = aGraphic;
}
// when the status is updated, and the controller is responsible for
// painting the statusbar item content, we must trigger a repaint
if ( m_bOwnerDraw && m_xStatusbarItem->getVisible() )
{
m_xStatusbarItem->repaint();
}
}
void SAL_CALL GenericStatusbarController::paint(
const Reference< awt::XGraphics >& xGraphics,
const awt::Rectangle& rOutputRectangle,
::sal_Int32 /*nStyle*/ )
throw ( RuntimeException )
{
OSL_TRACE("framework::GenericStatusbarController::paint");
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( !m_xStatusbarItem.is() || !xGraphics.is() )
return;
Reference< beans::XPropertySet > xGraphicProps( m_xGraphic, UNO_QUERY );
if ( xGraphicProps.is() && m_xGraphic->getType() != graphic::GraphicType::EMPTY )
{
awt::Size aGraphicSize;
xGraphicProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("SizePixel") ) ) >>= aGraphicSize;
OSL_ENSURE( aGraphicSize.Height > 0 && aGraphicSize.Width > 0, "Empty status bar graphic!" );
sal_Int32 nOffset = m_xStatusbarItem->getOffset( );
awt::Point aPos;
aPos.X = ( rOutputRectangle.Width + nOffset ) / 2 - aGraphicSize.Width / 2;
aPos.Y = rOutputRectangle.Height / 2 - aGraphicSize.Height / 2;
xGraphics->drawImage( rOutputRectangle.X + aPos.X,
rOutputRectangle.Y + aPos.Y,
aGraphicSize.Width,
aGraphicSize.Height,
m_bEnabled ? awt::ImageDrawMode::NONE : awt::ImageDrawMode::DISABLE,
m_xGraphic );
}
else
{
xGraphics->clear( rOutputRectangle );
}
}
}
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include <uielement/statusbaritem.hxx>
#include <vcl/status.hxx>
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
#include <com/sun/star/ui/ItemStyle.hpp>
using namespace com::sun::star::ui;
using rtl::OUString;
using com::sun::star::uno::RuntimeException;
namespace framework
{
namespace
{
static sal_uInt16 impl_convertItemBitsToItemStyle( sal_Int16 nItemBits )
{
sal_uInt16 nStyle( 0 );
if ( ( nItemBits & SIB_RIGHT ) == SIB_RIGHT )
nStyle |= ItemStyle::ALIGN_RIGHT;
else if ( ( nItemBits & SIB_LEFT ) == SIB_LEFT )
nStyle |= ItemStyle::ALIGN_LEFT;
else
nStyle |= ItemStyle::ALIGN_CENTER;
if ( ( nItemBits & SIB_FLAT ) == SIB_FLAT )
nStyle |= ItemStyle::DRAW_FLAT;
else if ( ( nItemBits & SIB_OUT ) == SIB_OUT )
nStyle |= ItemStyle::DRAW_OUT3D;
else
nStyle |= ItemStyle::DRAW_IN3D;
if ( ( nItemBits & SIB_AUTOSIZE ) == SIB_AUTOSIZE )
nStyle |= ItemStyle::AUTO_SIZE;
if ( ( nItemBits & SIB_USERDRAW ) == SIB_USERDRAW )
nStyle |= ItemStyle::OWNER_DRAW;
return nStyle;
}
}
StatusbarItem::StatusbarItem(
StatusBar *pStatusBar,
AddonStatusbarItemData *pItemData,
sal_uInt16 nId,
const rtl::OUString& aCommand )
: StatusbarItem_Base( m_aMutex )
, m_pStatusBar( pStatusBar )
, m_pItemData( pItemData )
, m_nId( nId )
, m_nStyle( 0 )
, m_aCommand( aCommand )
{
if ( m_pStatusBar )
m_nStyle = impl_convertItemBitsToItemStyle(
m_pStatusBar->GetItemBits( m_nId ) );
}
StatusbarItem::~StatusbarItem()
{
}
void SAL_CALL StatusbarItem::disposing()
{
osl::MutexGuard aGuard( m_aMutex );
m_pItemData = 0;
m_pStatusBar = 0;
}
OUString SAL_CALL StatusbarItem::getCommand()
throw (RuntimeException)
{
osl::MutexGuard aGuard( m_aMutex );
return m_aCommand;
}
::sal_uInt16 SAL_CALL StatusbarItem::getItemId()
throw (RuntimeException)
{
osl::MutexGuard aGuard( m_aMutex );
return m_nId;
}
::sal_uInt32 SAL_CALL StatusbarItem::getWidth()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
return m_pStatusBar->GetItemWidth( m_nId );
return ::sal_uInt32(0);
}
::sal_uInt16 SAL_CALL StatusbarItem::getStyle()
throw (RuntimeException)
{
osl::MutexGuard aGuard( m_aMutex );
return m_nStyle;
}
::sal_Int32 SAL_CALL StatusbarItem::getOffset()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
return m_pStatusBar->GetItemOffset( m_nId );
return ::sal_Int32(0);
}
::com::sun::star::awt::Rectangle SAL_CALL StatusbarItem::getItemRect()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
::com::sun::star::awt::Rectangle aAWTRect;
if ( m_pStatusBar )
{
Rectangle aRect = m_pStatusBar->GetItemRect( m_nId );
return ::com::sun::star::awt::Rectangle( aRect.Left(),
aRect.Top(),
aRect.GetWidth(),
aRect.GetHeight() );
}
return aAWTRect;
}
OUString SAL_CALL StatusbarItem::getText()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
return m_pStatusBar->GetItemText( m_nId );
return OUString();
}
void SAL_CALL StatusbarItem::setText( const OUString& rText )
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
m_pStatusBar->SetItemText( m_nId, rText );;
}
OUString SAL_CALL StatusbarItem::getHelpText()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
return m_pStatusBar->GetHelpText( m_nId );
return OUString();
}
void SAL_CALL StatusbarItem::setHelpText( const OUString& rHelpText )
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
m_pStatusBar->SetHelpText( m_nId, rHelpText );;
}
OUString SAL_CALL StatusbarItem::getQuickHelpText()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
return m_pStatusBar->GetHelpText( m_nId );
return OUString();
}
void SAL_CALL StatusbarItem::setQuickHelpText( const OUString& rQuickHelpText )
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
m_pStatusBar->SetQuickHelpText( m_nId, rQuickHelpText );
}
OUString SAL_CALL StatusbarItem::getAccessibleName()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
return m_pStatusBar->GetAccessibleName( m_nId );
return OUString();
}
void SAL_CALL StatusbarItem::setAccessibleName( const OUString& rAccessibleName )
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
m_pStatusBar->SetAccessibleName( m_nId, rAccessibleName );
}
::sal_Bool SAL_CALL StatusbarItem::getVisible()
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
return m_pStatusBar->IsItemVisible( m_nId );
return sal_False;
}
void SAL_CALL StatusbarItem::setVisible( ::sal_Bool bVisible )
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( !m_pStatusBar )
return;
if ( bVisible != m_pStatusBar->IsItemVisible( m_nId ) )
{
if ( bVisible )
m_pStatusBar->ShowItem( m_nId );
else
m_pStatusBar->HideItem( m_nId );
}
}
void SAL_CALL StatusbarItem::repaint( )
throw (RuntimeException)
{
vos::OGuard aSolarGuard( Application::GetSolarMutex() );
osl::MutexGuard aGuard( m_aMutex );
if ( m_pStatusBar )
{
m_pStatusBar->RedrawItem( m_nId );
}
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment