diff options
29 files changed, 98 insertions, 199 deletions
diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk index b1b1660f96d5..1ca1ddc4dab9 100644 --- a/framework/Library_fwk.mk +++ b/framework/Library_fwk.mk @@ -145,7 +145,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ framework/source/uielement/statusbarwrapper \ framework/source/uielement/statusindicatorinterfacewrapper \ framework/source/uielement/togglebuttontoolbarcontroller \ - framework/source/uielement/toolbar \ framework/source/uielement/toolbarmanager \ framework/source/uielement/toolbarmerger \ framework/source/uielement/toolbarwrapper \ diff --git a/framework/inc/uielement/addonstoolbarmanager.hxx b/framework/inc/uielement/addonstoolbarmanager.hxx index eb6b1db2af5c..53384bb92428 100644 --- a/framework/inc/uielement/addonstoolbarmanager.hxx +++ b/framework/inc/uielement/addonstoolbarmanager.hxx @@ -37,20 +37,18 @@ #include <cppuhelper/weak.hxx> #include <cppuhelper/interfacecontainer.hxx> -#include <vcl/toolbox.hxx> - +class ToolBox; namespace framework { -class ToolBar; class AddonsToolBarManager : public ToolBarManager { public: AddonsToolBarManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ); + ToolBox* pToolBar ); virtual ~AddonsToolBarManager(); // XComponent diff --git a/framework/inc/uielement/buttontoolbarcontroller.hxx b/framework/inc/uielement/buttontoolbarcontroller.hxx index 328b3c3949fa..368062dff5a8 100644 --- a/framework/inc/uielement/buttontoolbarcontroller.hxx +++ b/framework/inc/uielement/buttontoolbarcontroller.hxx @@ -30,15 +30,16 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/frame/XToolbarController.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <comphelper/broadcasthelper.hxx> #include <cppuhelper/weak.hxx> -#include <vcl/toolbox.hxx> + +class ToolBox; namespace framework { -class ToolBar; class ButtonToolbarController : public ::com::sun::star::frame::XStatusListener, public ::com::sun::star::frame::XToolbarController, public ::com::sun::star::lang::XInitialization, @@ -49,7 +50,7 @@ class ButtonToolbarController : public ::com::sun::star::frame::XStatusListener, { public: ButtonToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, - ToolBox* pToolBar, + ToolBox* pToolBar, const OUString& aCommand ); virtual ~ButtonToolbarController(); diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx b/framework/inc/uielement/comboboxtoolbarcontroller.hxx index 8fa205f86742..442dcd968803 100644 --- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx +++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx @@ -26,10 +26,11 @@ #include <uielement/complextoolbarcontroller.hxx> +#include <vcl/event.hxx> + namespace framework { -class ToolBar; class ComboBoxControl; class IComboBoxListener diff --git a/framework/inc/uielement/complextoolbarcontroller.hxx b/framework/inc/uielement/complextoolbarcontroller.hxx index 3d28cf6688a5..9bb3848ef362 100644 --- a/framework/inc/uielement/complextoolbarcontroller.hxx +++ b/framework/inc/uielement/complextoolbarcontroller.hxx @@ -27,8 +27,10 @@ #include <com/sun/star/frame/XControlNotificationListener.hpp> #include <svtools/toolboxcontroller.hxx> +#include <tools/link.hxx> -#include <vcl/toolbox.hxx> +class ToolBox; +class Window; namespace framework { @@ -48,15 +50,13 @@ struct NotifyInfo ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > aInfoSeq; }; -class ToolBar; - class ComplexToolbarController : public svt::ToolboxController { public: ComplexToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, + ToolBox* pToolBar, sal_uInt16 nID, const OUString& aCommand ); virtual ~ComplexToolbarController(); diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx index 6757d11b90ca..5886de1c3793 100644 --- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx +++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx @@ -25,13 +25,13 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/lstbox.hxx> +class ToolBox; + namespace framework { -class ToolBar; class ListBoxControl; class IListBoxListener @@ -53,9 +53,9 @@ class DropdownToolbarController : public IListBoxListener, public: DropdownToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - sal_Int32 nWidth, + ToolBox* pToolBar, + sal_uInt16 nID, + sal_Int32 nWidth, const OUString& aCommand ); virtual ~DropdownToolbarController(); diff --git a/framework/inc/uielement/edittoolbarcontroller.hxx b/framework/inc/uielement/edittoolbarcontroller.hxx index 590581920ab2..c231d0d6b091 100644 --- a/framework/inc/uielement/edittoolbarcontroller.hxx +++ b/framework/inc/uielement/edittoolbarcontroller.hxx @@ -25,13 +25,13 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/edit.hxx> +class ToolBox; + namespace framework { -class ToolBar; class EditControl; class IEditListener @@ -54,9 +54,9 @@ class EditToolbarController : public IEditListener, public: EditToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - sal_Int32 nWidth, + ToolBox* pToolBar, + sal_uInt16 nID, + sal_Int32 nWidth, const OUString& aCommand ); virtual ~EditToolbarController(); diff --git a/framework/inc/uielement/generictoolbarcontroller.hxx b/framework/inc/uielement/generictoolbarcontroller.hxx index 2eb1697971f9..7ece0f1c6dbf 100644 --- a/framework/inc/uielement/generictoolbarcontroller.hxx +++ b/framework/inc/uielement/generictoolbarcontroller.hxx @@ -21,23 +21,24 @@ #define __FRAMEWORK_UIELEMENT_GENERICTOOLBARCONTROLLER_HXX_ #include <svtools/toolboxcontroller.hxx> -#include <vcl/toolbox.hxx> #include <memory> +#include <tools/link.hxx> + class PopupMenu; +class ToolBox; namespace framework { struct ExecuteInfo; -class ToolBar; class GenericToolbarController : public svt::ToolboxController { public: GenericToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, ToolBox* pToolBar, - sal_uInt16 nID, + sal_uInt16 nID, const OUString& aCommand ); virtual ~GenericToolbarController(); @@ -50,7 +51,7 @@ class GenericToolbarController : public svt::ToolboxController // XStatusListener virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ); - DECL_STATIC_LINK( GenericToolbarController, ExecuteHdl_Impl, ExecuteInfo* ); + DECL_STATIC_LINK( GenericToolbarController, ExecuteHdl_Impl, ExecuteInfo* ); protected: ToolBox* m_pToolbar; @@ -70,7 +71,7 @@ class MenuToolbarController : public GenericToolbarController MenuToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, ToolBox* pToolBar, - sal_uInt16 nID, + sal_uInt16 nID, const OUString& aCommand, const OUString& aModuleIdentifier, const com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& xMenuDesc ); diff --git a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx index c5066d8d4034..751351577bc3 100644 --- a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx +++ b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx @@ -25,21 +25,21 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/image.hxx> +class ToolBox; + namespace framework { -class ToolBar; class ImageButtonToolbarController : public ComplexToolbarController { public: ImageButtonToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, + ToolBox* pToolBar, + sal_uInt16 nID, const OUString& aCommand ); virtual ~ImageButtonToolbarController(); diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx index ca30f4f17f50..d54b26541241 100644 --- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx +++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx @@ -25,13 +25,13 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> #include <vcl/spinfld.hxx> +class ToolBox; + namespace framework { -class ToolBar; class SpinfieldControl; class ISpinfieldListener @@ -60,9 +60,9 @@ class SpinfieldToolbarController : public ISpinfieldListener, public: SpinfieldToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - sal_Int32 nWidth, + ToolBox* pToolBar, + sal_uInt16 nID, + sal_Int32 nWidth, const OUString& aCommand ); virtual ~SpinfieldToolbarController(); diff --git a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx index a33e226aad5b..ab8e6b4c13c6 100644 --- a/framework/inc/uielement/togglebuttontoolbarcontroller.hxx +++ b/framework/inc/uielement/togglebuttontoolbarcontroller.hxx @@ -25,13 +25,14 @@ #include <com/sun/star/frame/ControlCommand.hpp> #include <uielement/complextoolbarcontroller.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/image.hxx> +#include <tools/link.hxx> + +class Menu; +class ToolBox; namespace framework { -class ToolBar; class ToggleButtonToolbarController : public ComplexToolbarController { @@ -45,9 +46,9 @@ class ToggleButtonToolbarController : public ComplexToolbarController ToggleButtonToolbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, - ToolBox* pToolBar, - sal_uInt16 nID, - Style eStyle, + ToolBox* pToolBar, + sal_uInt16 nID, + Style eStyle, const OUString& aCommand ); virtual ~ToggleButtonToolbarController(); diff --git a/framework/inc/uielement/toolbar.hxx b/framework/inc/uielement/toolbar.hxx deleted file mode 100644 index b7ac587ae595..000000000000 --- a/framework/inc/uielement/toolbar.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * 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 . - */ - -#ifndef __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ -#define __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ - -#include <vcl/toolbox.hxx> - -namespace framework -{ - -class ToolBarManager; -class ToolBar : public ToolBox -{ - public: - ToolBar( Window* pParent, WinBits nWinBits ); - virtual ~ToolBar(); - - virtual void Command ( const CommandEvent& rCEvt ); - virtual void StateChanged( StateChangedType nType ); - virtual void DataChanged( const DataChangedEvent& rDCEvt ); - - // Provide additional handlers to support external implementations - void SetCommandHdl( const Link& aLink ) { m_aCommandHandler = aLink; } - const Link& GetCommandHdl() const { return m_aCommandHandler; } - void SetStateChangedHdl( const Link& aLink ) { m_aStateChangedHandler = aLink; } - const Link& GetStateChangedHdl() const { return m_aStateChangedHandler; } - void SetDataChangedHdl( const Link& aLink ) { m_aDataChangedHandler = aLink; } - const Link& GetDataChangedHdl() { return m_aDataChangedHandler; } - - private: - Link m_aCommandHandler; - Link m_aStateChangedHandler; - Link m_aDataChangedHandler; -}; - -} - -#endif // __FRAMEWORK_UIELEMENT_TOOLBAR_HXX_ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index 572bb6bff30b..3e058689df7e 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -43,18 +43,22 @@ #include <com/sun/star/ui/ItemStyle.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/ui/XAcceleratorConfiguration.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <rtl/ustring.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/interfacecontainer.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/accel.hxx> +#include <tools/link.hxx> +#include <vcl/window.hxx> +#include <vcl/timer.hxx> + +class PopupMenu; +class ToolBox; namespace framework { -class ToolBar; class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener , public ::com::sun::star::frame::XStatusListener , public ::com::sun::star::lang::XComponent , @@ -67,7 +71,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener ToolBarManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ); + ToolBox* pToolBar ); virtual ~ToolBarManager(); // XInterface, XTypeProvider, XServiceInfo @@ -175,6 +179,7 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener typedef BaseHash< SubToolBarControllerVector > SubToolBarToSubToolBarControllerMap; typedef ::boost::unordered_map< sal_uInt16, ::com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > > MenuDescriptionMap; + bool m_bDisposed : 1, m_bSmallSymbols : 1, m_bModuleIdentified : 1, @@ -183,10 +188,14 @@ class ToolBarManager : public ::com::sun::star::frame::XFrameActionListener m_bUpdateControllers : 1, m_bImageOrientationRegistered : 1, m_bImageMirrored : 1; - long m_lImageRotation; - ToolBar* m_pToolBar; - OUString m_aModuleIdentifier; - OUString m_aResourceName; + + long m_lImageRotation; + + ToolBox* m_pToolBar; + + OUString m_aModuleIdentifier; + OUString m_aResourceName; + com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer; com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame; com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_xUICommandLabels; diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 4e897c0521ba..b0992eeac48d 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -20,7 +20,6 @@ #include <uielement/addonstoolbarmanager.hxx> #include <uielement/toolbarmerger.hxx> -#include <uielement/toolbar.hxx> #include <uielement/generictoolbarcontroller.hxx> #include <threadhelp/resetableguard.hxx> #include "services.h" @@ -55,6 +54,7 @@ #include <vcl/menu.hxx> #include <vcl/syswin.hxx> #include <vcl/taskpanelist.hxx> +#include <vcl/toolbox.hxx> //_________________________________________________________________________________________________________________ // namespaces @@ -78,7 +78,7 @@ static const char TOOLBOXITEM_SEPARATOR_STR[] = "private:separator"; AddonsToolBarManager::AddonsToolBarManager( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ) : + ToolBox* pToolBar ) : ToolBarManager( rxContext, rFrame, rResourceName, pToolBar ) { m_pToolBar->SetMenuType( TOOLBOX_MENUTYPE_CLIPPEDITEMS ); diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx index 75a9fb2a0e82..2921b020ab84 100644 --- a/framework/source/uielement/addonstoolbarwrapper.cxx +++ b/framework/source/uielement/addonstoolbarwrapper.cxx @@ -24,8 +24,6 @@ #include <uielement/rootitemcontainer.hxx> #include <uielement/addonstoolbarmanager.hxx> -#include <uielement/toolbar.hxx> - #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -108,7 +106,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument if ( xFrame.is() && m_aConfigData.getLength() > 0 ) { // Create VCL based toolbar which will be filled with settings data - ToolBar* pToolBar = 0; + ToolBox* pToolBar = 0; AddonsToolBarManager* pToolBarManager = 0; { SolarMutexGuard aSolarMutexGuard; @@ -117,7 +115,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument { sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE; - pToolBar = new ToolBar( pWindow, nStyles ); + pToolBar = new ToolBox( pWindow, nStyles ); pToolBarManager = new AddonsToolBarManager( comphelper::getComponentContext(m_xServiceManager), xFrame, m_aResourceURL, pToolBar ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); } diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx index cd827d7eebcb..0b8ffb186c7c 100644 --- a/framework/source/uielement/buttontoolbarcontroller.cxx +++ b/framework/source/uielement/buttontoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/buttontoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -42,6 +40,7 @@ #include <vcl/graph.hxx> #include <vcl/bitmap.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/toolbox.hxx> #include <svtools/miscopt.hxx> using namespace ::com::sun::star; diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index ceb614c0ed2f..de69836e1b8f 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/comboboxtoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index d5960f8f9b68..589bfd8a4107 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/complextoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -37,6 +35,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::awt; diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index 69b52f2f2516..fc9ff2f094b6 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/dropdownboxtoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -34,6 +32,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::awt; diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx index 53afe0f28674..a0ead9aaaae0 100644 --- a/framework/source/uielement/edittoolbarcontroller.cxx +++ b/framework/source/uielement/edittoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/edittoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -34,6 +32,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx index 6d44e91b4cae..a76686066fe5 100644 --- a/framework/source/uielement/generictoolbarcontroller.cxx +++ b/framework/source/uielement/generictoolbarcontroller.cxx @@ -20,8 +20,6 @@ #include "uielement/generictoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/URLTransformer.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> diff --git a/framework/source/uielement/imagebuttontoolbarcontroller.cxx b/framework/source/uielement/imagebuttontoolbarcontroller.cxx index 2b01e9297ecd..a6ba09b092df 100644 --- a/framework/source/uielement/imagebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/imagebuttontoolbarcontroller.cxx @@ -21,7 +21,6 @@ #include "uielement/imagebuttontoolbarcontroller.hxx" #include <framework/addonsoptions.hxx> -#include "uielement/toolbar.hxx" #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -40,6 +39,7 @@ #include <vcl/graph.hxx> #include <vcl/bitmap.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/toolbox.hxx> #include <svtools/miscopt.hxx> using namespace ::com::sun::star; diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx index 9da2523b2743..ea55937d94c0 100644 --- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx +++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx @@ -23,8 +23,6 @@ #include "uielement/spinfieldtoolbarcontroller.hxx" -#include "uielement/toolbar.hxx" - #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -37,6 +35,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> +#include <vcl/toolbox.hxx> #ifdef WINNT #include <systools/win32/snprintf.h> #endif diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx index dfa24230d05b..9a766a14b48f 100644 --- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx +++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx @@ -21,15 +21,14 @@ #include "uielement/togglebuttontoolbarcontroller.hxx" #include <framework/addonsoptions.hxx> -#include "uielement/toolbar.hxx" #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/XControlNotificationListener.hpp> -#include "com/sun/star/util/XMacroExpander.hpp" -#include "com/sun/star/uno/XComponentContext.hpp" -#include "com/sun/star/beans/XPropertySet.hpp" +#include <com/sun/star/util/XMacroExpander.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> #include <rtl/uri.hxx> #include <osl/mutex.hxx> @@ -41,6 +40,7 @@ #include <vcl/graph.hxx> #include <vcl/bitmap.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/toolbox.hxx> #include <svtools/miscopt.hxx> using namespace ::com::sun::star; diff --git a/framework/source/uielement/toolbar.cxx b/framework/source/uielement/toolbar.cxx deleted file mode 100644 index 4e71b6a3e166..000000000000 --- a/framework/source/uielement/toolbar.cxx +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * 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 . - */ - -#include <uielement/toolbar.hxx> -#include <uielement/toolbarmanager.hxx> -#include <rtl/logfile.hxx> - -namespace framework -{ - -ToolBar::ToolBar( Window* pParent, WinBits nWinBits ) : - ToolBox( pParent, nWinBits ) -{ -} - -ToolBar::~ToolBar() -{ -} - -void ToolBar::Command( const CommandEvent& rCEvt ) -{ - if ( m_aCommandHandler.IsSet() ) - m_aCommandHandler.Call( (void *)( &rCEvt )); - ToolBox::Command( rCEvt ); -} - -void ToolBar::StateChanged( StateChangedType nType ) -{ - ToolBox::StateChanged( nType ); - if ( m_aStateChangedHandler.IsSet() ) - m_aStateChangedHandler.Call( &nType ); -} - -void ToolBar::DataChanged( const DataChangedEvent& rDCEvt ) -{ - ToolBox::DataChanged( rDCEvt ); - if ( m_aDataChangedHandler.IsSet() ) - m_aDataChangedHandler.Call( (void*)&rDCEvt ); -} - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 85de30c0542d..ae5fafbb8b9c 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -19,7 +19,6 @@ #include <uielement/toolbarmanager.hxx> -#include <uielement/toolbar.hxx> #include <uielement/generictoolbarcontroller.hxx> #include <threadhelp/resetableguard.hxx> #include "services.h" @@ -68,6 +67,7 @@ #include <vcl/menu.hxx> #include <vcl/syswin.hxx> #include <vcl/taskpanelist.hxx> +#include <vcl/toolbox.hxx> #include <rtl/logfile.hxx> #include <svtools/menuoptions.hxx> #include <boost/bind.hpp> @@ -201,7 +201,7 @@ DEFINE_XTYPEPROVIDER_6 ( ToolBarManager ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& rFrame, const OUString& rResourceName, - ToolBar* pToolBar ) : + ToolBox* pToolBar ) : ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject(), m_bDisposed( false ), @@ -751,7 +751,7 @@ void ToolBarManager::setToolBarImage(const Image& _aImage,const CommandToInfoMap { const ::std::vector< sal_uInt16 >& _rIDs = _pIter->second.aIds; m_pToolBar->SetItemImage( _pIter->second.nId, _aImage ); - ::std::for_each(_rIDs.begin(),_rIDs.end(),::boost::bind(&ToolBar::SetItemImage,m_pToolBar,_1,_aImage)); + ::std::for_each(_rIDs.begin(),_rIDs.end(),::boost::bind(&ToolBox::SetItemImage,m_pToolBar,_1,_aImage)); } void SAL_CALL ToolBarManager::elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException) diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx index 2dbaa1d7e44a..6c40103b0c93 100644 --- a/framework/source/uielement/toolbarwrapper.cxx +++ b/framework/source/uielement/toolbarwrapper.cxx @@ -24,8 +24,6 @@ #include <uielement/rootitemcontainer.hxx> #include <uielement/toolbarmanager.hxx> -#include <uielement/toolbar.hxx> - #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XSystemDependentMenuPeer.hpp> @@ -144,7 +142,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th if ( xFrame.is() && m_xConfigSource.is() ) { // Create VCL based toolbar which will be filled with settings data - ToolBar* pToolBar = 0; + ToolBox* pToolBar = 0; ToolBarManager* pToolBarManager = 0; { SolarMutexGuard aSolarMutexGuard; @@ -153,7 +151,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th { sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE; - pToolBar = new ToolBar( pWindow, nStyles ); + pToolBar = new ToolBox( pWindow, nStyles ); pToolBarManager = new ToolBarManager( comphelper::getComponentContext(m_xServiceFactory), xFrame, m_aResourceURL, pToolBar ); m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY ); pToolBar->WillUsePopupMode( bPopupMode ); diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 6106bb1bf0ba..3b1f69e36477 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -207,6 +207,9 @@ private: Link maDeactivateHdl; Link maHighlightHdl; Link maSelectHdl; + Link maCommandHandler; + Link maStateChangedHandler; + Link maDataChangedHandler; public: using Window::ImplInit; @@ -509,6 +512,12 @@ public: const Link& GetHighlightHdl() const { return maHighlightHdl; } void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } const Link& GetSelectHdl() const { return maSelectHdl; } + void SetCommandHdl( const Link& aLink ) { maCommandHandler = aLink; } + const Link& GetCommandHdl() const { return maCommandHandler; } + void SetStateChangedHdl( const Link& aLink ) { maStateChangedHandler = aLink; } + const Link& GetStateChangedHdl() const { return maStateChangedHandler; } + void SetDataChangedHdl( const Link& aLink ) { maDataChangedHandler = aLink; } + const Link& GetDataChangedHdl() { return maDataChangedHandler; } // support for custom menu (eg for configuration) // note: this menu will also be used to display currently diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 809c8cd375ad..73b4d2132b24 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4414,6 +4414,9 @@ long ToolBox::Notify( NotifyEvent& rNEvt ) void ToolBox::Command( const CommandEvent& rCEvt ) { + if ( maCommandHandler.IsSet() ) + maCommandHandler.Call( (void *)( &rCEvt )); + // depict StartDrag on MouseButton/Left/Alt if ( (rCEvt.GetCommand() == COMMAND_STARTDRAG) && rCEvt.IsMouseEvent() && mbCustomize && !mbDragging && !mbDrag && !mbSelection && @@ -4506,6 +4509,9 @@ void ToolBox::StateChanged( StateChangedType nType ) ImplInitSettings( sal_False, sal_False, sal_True ); // font, foreground, background Invalidate(); } + + if ( maStateChangedHandler.IsSet() ) + maStateChangedHandler.Call( &nType ); } // ----------------------------------------------------------------------- @@ -4525,6 +4531,9 @@ void ToolBox::DataChanged( const DataChangedEvent& rDCEvt ) ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } + + if ( maDataChangedHandler.IsSet() ) + maDataChangedHandler.Call( (void*)&rDCEvt ); } // ----------------------------------------------------------------------- |