diff options
101 files changed, 509 insertions, 213 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 5085223542aa..974d52d49561 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -121,7 +121,7 @@ ChartController::ChartController(uno::Reference<uno::XComponentContext> const & m_eDrawMode( CHARTDRAW_SELECT ), mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( [this]() { return this->GetContextName(); }, - this, sfx2::sidebar::EnumContext::Context_Cell)) + this, vcl::EnumContext::Context_Cell)) { m_aDoubleClickTimer.SetTimeoutHdl( LINK( this, ChartController, DoubleClickWaitingHdl ) ); } diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx index be80a4c88fef..ac0d6f4ae731 100644 --- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx @@ -310,7 +310,7 @@ void ChartAxisPanel::DataChanged( } void ChartAxisPanel::HandleContextChange( - const ::sfx2::sidebar::EnumContext& ) + const vcl::EnumContext& ) { updateData(); } diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.hxx b/chart2/source/controller/sidebar/ChartAxisPanel.hxx index d84f005faad8..6cb9ec7724d5 100644 --- a/chart2/source/controller/sidebar/ChartAxisPanel.hxx +++ b/chart2/source/controller/sidebar/ChartAxisPanel.hxx @@ -50,7 +50,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx index 1e52f24a399d..5a8625b996c5 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx @@ -501,7 +501,7 @@ void ChartElementsPanel::DataChanged( } void ChartElementsPanel::HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if(maContext == rContext) { diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx index e336c82aef3b..43565def2afe 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx @@ -54,7 +54,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; // constructor/destuctor ChartElementsPanel( @@ -98,7 +98,7 @@ private: VclPtr<ListBox> mpLBLegendPosition; VclPtr<VclHBox> mpBoxLegend; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; css::uno::Reference<css::frame::XModel> mxModel; css::uno::Reference<css::util::XModifyListener> mxListener; diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx index 401e7cfab122..248b9e74876f 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx @@ -374,7 +374,7 @@ void ChartErrorBarPanel::DataChanged( } void ChartErrorBarPanel::HandleContextChange( - const ::sfx2::sidebar::EnumContext& ) + const vcl::EnumContext& ) { updateData(); } diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx index 6beb6aec4dff..cff8398444ef 100644 --- a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx +++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx @@ -48,7 +48,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx index b2a71cc08f66..7147dda6cb69 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx @@ -408,7 +408,7 @@ void ChartSeriesPanel::DataChanged( } void ChartSeriesPanel::HandleContextChange( - const ::sfx2::sidebar::EnumContext& ) + const vcl::EnumContext& ) { updateData(); } diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx index 72928b787e08..f9465c328555 100644 --- a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx +++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx @@ -58,7 +58,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index e1117edb3d60..3b322ae5f482 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -804,5 +804,8 @@ <glade-widget-class title="Show Text" name="cuilo-SvxShowText" generic-name="ShowText" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> + <glade-widget-class title="Notebookbar with context" name="vcllo-ContextTabControl" + generic-name="ContextTabControl" parent="GtkNotebook" + icon-name="widget-gtk-notebook"/> </glade-widget-classes> </glade-catalog> diff --git a/include/sfx2/notebookbar/SfxNotebookBar.hxx b/include/sfx2/notebookbar/SfxNotebookBar.hxx index 156d6168f16b..1b79c78ece09 100644 --- a/include/sfx2/notebookbar/SfxNotebookBar.hxx +++ b/include/sfx2/notebookbar/SfxNotebookBar.hxx @@ -29,6 +29,8 @@ public: static void StateMethod(SystemWindow* pSysWindow, const css::uno::Reference<css::frame::XFrame> xFrame, const OUString& rUIFile); + + static void RemoveListeners(SystemWindow* pSysWindow); }; } // namespace sfx2 diff --git a/include/sfx2/sidebar/DeckDescriptor.hxx b/include/sfx2/sidebar/DeckDescriptor.hxx index 8c1b9efb764c..a26256288b61 100644 --- a/include/sfx2/sidebar/DeckDescriptor.hxx +++ b/include/sfx2/sidebar/DeckDescriptor.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_DECKDESCRIPTOR_HXX #define INCLUDED_SFX2_SOURCE_SIDEBAR_DECKDESCRIPTOR_HXX -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include "ContextList.hxx" #include <sfx2/sidebar/Deck.hxx> diff --git a/include/sfx2/sidebar/IContextChangeReceiver.hxx b/include/sfx2/sidebar/IContextChangeReceiver.hxx index ea5c24a61af1..b8f65128fff5 100644 --- a/include/sfx2/sidebar/IContextChangeReceiver.hxx +++ b/include/sfx2/sidebar/IContextChangeReceiver.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_SFX2_SIDEBAR_ICONTEXTCHANGERECEIVER_HXX #define INCLUDED_SFX2_SIDEBAR_ICONTEXTCHANGERECEIVER_HXX -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <sfx2/dllapi.h> @@ -31,7 +31,7 @@ class SFX2_DLLPUBLIC IContextChangeReceiver public: virtual ~IContextChangeReceiver (); - virtual void HandleContextChange (const EnumContext& rContext) = 0; + virtual void HandleContextChange (const vcl::EnumContext& rContext) = 0; }; } } // end of namespace ::sd::sidebar diff --git a/include/sfx2/sidebar/PanelDescriptor.hxx b/include/sfx2/sidebar/PanelDescriptor.hxx index 2e1abb2d445e..f62076e12bd0 100644 --- a/include/sfx2/sidebar/PanelDescriptor.hxx +++ b/include/sfx2/sidebar/PanelDescriptor.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_PANELDESCRIPTOR_HXX #define INCLUDED_SFX2_SOURCE_SIDEBAR_PANELDESCRIPTOR_HXX -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <sfx2/sidebar/ContextList.hxx> namespace sfx2 { namespace sidebar { diff --git a/include/sfx2/sidebar/SidebarPanelBase.hxx b/include/sfx2/sidebar/SidebarPanelBase.hxx index 41e15348299a..606d65c335ef 100644 --- a/include/sfx2/sidebar/SidebarPanelBase.hxx +++ b/include/sfx2/sidebar/SidebarPanelBase.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_SFX2_SIDEBAR_SIDEBARPANELBASE_HXX #define INCLUDED_SFX2_SIDEBAR_SIDEBARPANELBASE_HXX -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <cppuhelper/compbase5.hxx> diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx index 5a8c0cdeca39..a805a94cd42a 100644 --- a/include/sfx2/sidebar/TabBar.hxx +++ b/include/sfx2/sidebar/TabBar.hxx @@ -19,6 +19,7 @@ #ifndef INCLUDED_SFX2_SOURCE_SIDEBAR_TABBAR_HXX #define INCLUDED_SFX2_SOURCE_SIDEBAR_TABBAR_HXX +#include <sfx2//dllapi.h> #include "DeckDescriptor.hxx" #include <sfx2/sidebar/ResourceManager.hxx> diff --git a/include/svx/ParaLineSpacingPopup.hxx b/include/svx/ParaLineSpacingPopup.hxx index 19bbfd47eb66..c9f761c91beb 100644 --- a/include/svx/ParaLineSpacingPopup.hxx +++ b/include/svx/ParaLineSpacingPopup.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARALINESPACINGPOPUP_HXX #include <editeng/lspcitem.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <sfx2/tbxctrl.hxx> #include <svl/poolitem.hxx> #include <svx/svxdllapi.h> diff --git a/include/svx/ParaSpacingControl.hxx b/include/svx/ParaSpacingControl.hxx index 03e7cf9dfe39..b4e287c2370f 100644 --- a/include/svx/ParaSpacingControl.hxx +++ b/include/svx/ParaSpacingControl.hxx @@ -25,7 +25,6 @@ #include <com/sun/star/ui/XContextChangeEventListener.hpp> #include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp> #include <com/sun/star/ui/XContextChangeEventMultiplexer.hpp> -#include <sfx2/sidebar/EnumContext.hxx> namespace svx { diff --git a/include/svx/sidebar/ContextChangeEventMultiplexer.hxx b/include/svx/sidebar/ContextChangeEventMultiplexer.hxx index d5cb3916f84f..9b94e9067faa 100644 --- a/include/svx/sidebar/ContextChangeEventMultiplexer.hxx +++ b/include/svx/sidebar/ContextChangeEventMultiplexer.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SVX_SIDEBAR_CONTEXTCHANGEEVENTMULTIPLEXER_HXX #include <svx/svxdllapi.h> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -41,7 +41,7 @@ public: */ static void NotifyContextChange ( const css::uno::Reference<css::frame::XController>& rxController, - const ::sfx2::sidebar::EnumContext::Context eContext); + const vcl::EnumContext::Context eContext); /** Notify the activation of a context. @param pViewShell @@ -53,7 +53,7 @@ public: */ static void NotifyContextChange ( SfxViewShell* pViewShell, - const ::sfx2::sidebar::EnumContext::Context eContext); + const vcl::EnumContext::Context eContext); private: static ::rtl::OUString GetModuleName ( diff --git a/include/svx/sidebar/SelectionAnalyzer.hxx b/include/svx/sidebar/SelectionAnalyzer.hxx index 62c411624f2e..e80f5db6c0be 100644 --- a/include/svx/sidebar/SelectionAnalyzer.hxx +++ b/include/svx/sidebar/SelectionAnalyzer.hxx @@ -19,7 +19,7 @@ #ifndef INCLUDED_SVX_SIDEBAR_SELECTIONANALYZER_HXX #define INCLUDED_SVX_SIDEBAR_SELECTIONANALYZER_HXX -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/svxdllapi.h> class SdrMarkList; @@ -36,7 +36,7 @@ namespace svx { namespace sidebar { class SVX_DLLPUBLIC SelectionAnalyzer { public: - static sfx2::sidebar::EnumContext::Context GetContextForSelection_SC ( + static vcl::EnumContext::Context GetContextForSelection_SC ( const SdrMarkList& rMarkList); enum ViewType @@ -47,14 +47,14 @@ public: VT_Notes, VT_Outline }; - static sfx2::sidebar::EnumContext::Context GetContextForSelection_SD ( + static vcl::EnumContext::Context GetContextForSelection_SD ( const SdrMarkList& rMarkList, const ViewType eViewType); private: - static sfx2::sidebar::EnumContext::Context GetContextForObjectId_SC ( + static vcl::EnumContext::Context GetContextForObjectId_SC ( const sal_uInt16 nObjectId); - static sfx2::sidebar::EnumContext::Context GetContextForObjectId_SD ( + static vcl::EnumContext::Context GetContextForObjectId_SD ( const sal_uInt16 nObjectId, const ViewType eViewType); static sal_uInt32 GetInventorTypeFromMark ( diff --git a/include/svx/sidebar/SelectionChangeHandler.hxx b/include/svx/sidebar/SelectionChangeHandler.hxx index 841ab32b546f..38d72ab2cca4 100644 --- a/include/svx/sidebar/SelectionChangeHandler.hxx +++ b/include/svx/sidebar/SelectionChangeHandler.hxx @@ -20,7 +20,7 @@ #define INCLUDED_SVX_SIDEBAR_SELECTIONCHANGEHANDLER_HXX #include <svx/svxdllapi.h> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <com/sun/star/frame/XController.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/view/XSelectionChangeListener.hpp> @@ -50,7 +50,7 @@ public: SelectionChangeHandler ( const std::function<rtl::OUString ()>& rSelectionChangeCallback, const css::uno::Reference<css::frame::XController>& rxController, - const sfx2::sidebar::EnumContext::Context eDefaultContext); + const vcl::EnumContext::Context eDefaultContext); virtual ~SelectionChangeHandler(); virtual void SAL_CALL selectionChanged (const css::lang::EventObject& rEvent) @@ -71,7 +71,7 @@ private: const std::function<rtl::OUString ()> maSelectionChangeCallback; css::uno::Reference<css::frame::XController> mxController; - const sfx2::sidebar::EnumContext::Context meDefaultContext; + const vcl::EnumContext::Context meDefaultContext; bool mbIsConnected; }; diff --git a/include/sfx2/sidebar/EnumContext.hxx b/include/vcl/EnumContext.hxx index 2dfa5a251d8a..cb48266d168c 100644 --- a/include/sfx2/sidebar/EnumContext.hxx +++ b/include/vcl/EnumContext.hxx @@ -16,19 +16,19 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SFX2_SIDEBAR_ENUMCONTEXT_HXX -#define INCLUDED_SFX2_SIDEBAR_ENUMCONTEXT_HXX +#ifndef INCLUDED_VCL_ENUMCONTEXT_HXX +#define INCLUDED_VCL_ENUMCONTEXT_HXX -#include <sfx2/dllapi.h> +#include <vcl/dllapi.h> #include <rtl/ustring.hxx> #include <vector> -namespace sfx2 { namespace sidebar { +namespace vcl { -class SFX2_DLLPUBLIC EnumContext +class VCL_DLLPUBLIC EnumContext { public: enum Application @@ -157,10 +157,10 @@ private: }; -#define CombinedEnumContext(a,e) ((static_cast<sal_uInt16>(::sfx2::sidebar::EnumContext::a)<<16)\ - | static_cast<sal_uInt16>(::sfx2::sidebar::EnumContext::e)) +#define CombinedEnumContext(a,e) ((static_cast<sal_uInt16>(::vcl::EnumContext::a)<<16)\ + | static_cast<sal_uInt16>(::vcl::EnumContext::e)) -} } // end of namespace sfx2::sidebar +} // end of namespace vcl #endif diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 8c50feeb2831..353d818cde49 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -18,6 +18,8 @@ #include <vcl/dllapi.h> #include <vcl/window.hxx> #include <vcl/vclptr.hxx> +#include <tools/wintypes.hxx> +#include <vcl/EnumContext.hxx> #include <memory> #include <map> @@ -349,6 +351,8 @@ private: void handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader); VclPtr<vcl::Window> handleObject(vcl::Window *pParent, xmlreader::XmlReader &reader); void handlePacking(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader); + std::vector<vcl::EnumContext::Context> handleStyle(xmlreader::XmlReader &reader); + vcl::EnumContext::Context getContext(xmlreader::XmlReader &reader); void applyPackingProperty(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader); void collectProperty(xmlreader::XmlReader &reader, const OString &rID, stringmap &rVec); static void collectPangoAttribute(xmlreader::XmlReader &reader, stringmap &rMap); diff --git a/include/vcl/contexttabctrl.hxx b/include/vcl/contexttabctrl.hxx new file mode 100644 index 000000000000..452d9f30190b --- /dev/null +++ b/include/vcl/contexttabctrl.hxx @@ -0,0 +1,39 @@ +/* -*- 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 INCLUDED_VCL_CONTEXTTABCTRL_HXX +#define INCLUDED_VCL_CONTEXTTABCTRL_HXX + +#include <vcl/EnumContext.hxx> +#include <vcl/tabctrl.hxx> + +class VCL_DLLPUBLIC ContextTabControl : public TabControl +{ +public: + ContextTabControl( vcl::Window* pParent, WinBits nStyle = WB_STDTABCONTROL ); + + void SetContext( vcl::EnumContext::Context eContext ); + +private: + vcl::EnumContext::Context eLastContext; +}; + +#endif // INCLUDED_VCL_TABCTRL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/notebookbar.hxx b/include/vcl/notebookbar.hxx index 9dd7e9f5b708..37fa7ee3dc36 100644 --- a/include/vcl/notebookbar.hxx +++ b/include/vcl/notebookbar.hxx @@ -12,9 +12,13 @@ #include <vcl/builder.hxx> #include <vcl/ctrl.hxx> +#include <vcl/contexttabctrl.hxx> +#include <com/sun/star/ui/XContextChangeEventListener.hpp> +#include <vcl/EnumContext.hxx> /// This implements Widget Layout-based notebook-like menu bar. -class NotebookBar : public Control, public VclBuilderContainer +class NotebookBar : public Control, public VclBuilderContainer, + public css::ui::XContextChangeEventListener { public: NotebookBar(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame); @@ -25,6 +29,20 @@ public: virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) SAL_OVERRIDE; virtual void StateChanged(StateChangedType nType) override; + + // XContextChangeEventListener + virtual void SAL_CALL notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) + throw (css::uno::RuntimeException, std::exception) override; + + virtual ::css::uno::Any SAL_CALL queryInterface(const ::css::uno::Type& aType) + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual void SAL_CALL acquire() throw () override; + virtual void SAL_CALL release() throw () override; + virtual void SAL_CALL disposing(const ::css::lang::EventObject&) + throw (::css::uno::RuntimeException, ::std::exception) override; + +private: + VclPtr<ContextTabControl> m_pTabControl; }; #endif // INCLUDED_VCL_NOTEBOOKBAR_HXX diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx index 4b3e0e83d7fd..410cb2be8f44 100644 --- a/include/vcl/tabctrl.hxx +++ b/include/vcl/tabctrl.hxx @@ -56,6 +56,7 @@ private: bool mbRestoreHelpId; bool mbSmallInvalidate; bool mbLayoutDirty; + bool mbHideDisabledTabs; Link<TabControl*,void> maActivateHdl; Link<TabControl*,bool> maDeactivateHdl; @@ -125,6 +126,7 @@ public: void RemovePage( sal_uInt16 nPageId ); void Clear(); void EnablePage( sal_uInt16 nPageId, bool bEnable = true ); + void HideDisabledTabs(bool bHide = true); sal_uInt16 GetPagePos( sal_uInt16 nPageId ) const; sal_uInt16 GetPageCount() const; diff --git a/include/vcl/tabpage.hxx b/include/vcl/tabpage.hxx index b1c16e0d5560..5a35901c4007 100644 --- a/include/vcl/tabpage.hxx +++ b/include/vcl/tabpage.hxx @@ -35,6 +35,8 @@ private: SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE void ImplInitSettings(); + std::vector<vcl::EnumContext::Context> maContext; + public: explicit TabPage( vcl::Window* pParent, WinBits nStyle = 0 ); explicit TabPage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription ); @@ -57,6 +59,10 @@ public: virtual void SetPosPixel(const Point& rNewPos) override; virtual void SetSizePixel(const Size& rNewSize) override; virtual Size GetOptimalSize() const override; + + void SetContext( const std::vector<vcl::EnumContext::Context>& aContext ); + bool HasContext( const vcl::EnumContext::Context eContext ) const; + const std::vector<vcl::EnumContext::Context>& GetContext() const; }; #endif // INCLUDED_VCL_TABPAGE_HXX diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx index 56cdadb10ff9..b07f8b93f9c2 100644 --- a/sc/source/ui/drawfunc/chartsh.cxx +++ b/sc/source/ui/drawfunc/chartsh.cxx @@ -25,7 +25,7 @@ #include <sfx2/app.hxx> #include <sfx2/objface.hxx> #include <sfx2/request.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svl/whiter.hxx> #include <vcl/msgbox.hxx> @@ -61,7 +61,7 @@ ScChartShell::ScChartShell(ScViewData* pData) : { SetHelpId( HID_SCSHELL_CHARTSH ); SetName( "ChartObject" ); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Chart)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Chart)); } ScChartShell::~ScChartShell() diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 6ee0f37ae564..ca7f898f834d 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -58,7 +58,7 @@ ScDrawShell::ScDrawShell( ScViewData* pData ) : mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( [this] () { return this->GetSidebarContextName(); }, GetFrame()->GetFrame().GetController(), - sfx2::sidebar::EnumContext::Context_Cell)) + vcl::EnumContext::Context_Cell)) { SetPool( &pViewData->GetScDrawView()->GetModel()->GetItemPool() ); ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager(); @@ -395,13 +395,13 @@ void ScDrawShell::Activate (const bool bMDI) ContextChangeEventMultiplexer::NotifyContextChange( GetFrame()->GetFrame().GetController(), - ::sfx2::sidebar::EnumContext::GetContextEnum( + vcl::EnumContext::GetContextEnum( GetSidebarContextName())); } ::rtl::OUString ScDrawShell::GetSidebarContextName() { - return sfx2::sidebar::EnumContext::GetContextName( + return vcl::EnumContext::GetContextName( svx::sidebar::SelectionAnalyzer::GetContextForSelection_SC( GetDrawView()->GetMarkedObjectList())); } diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx index bea35a866d7b..28b5e4fa880f 100644 --- a/sc/source/ui/drawfunc/drformsh.cxx +++ b/sc/source/ui/drawfunc/drformsh.cxx @@ -35,7 +35,7 @@ #include "drawview.hxx" #include "scresid.hxx" #include <svx/svdobj.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #define ScDrawFormShell #include "scslots.hxx" @@ -56,7 +56,7 @@ ScDrawFormShell::ScDrawFormShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_DRAWFORMSH); SetName("DrawForm"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Form)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Form)); } ScDrawFormShell::~ScDrawFormShell() diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index f98b27dcb567..4a305db3599d 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -61,7 +61,7 @@ #include <svx/svxdlg.hxx> #include <svx/dialogs.hrc> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include "sc.hrc" #include "globstr.hrc" @@ -127,7 +127,7 @@ ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData* pData) : SetHelpId( HID_SCSHELL_DRTXTOB ); SetName("DrawText"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_DrawText)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_DrawText)); } ScDrawTextObjectBar::~ScDrawTextObjectBar() diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index bf09e7500fe7..4176a5a837f5 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -21,7 +21,7 @@ #include <sfx2/app.hxx> #include <sfx2/objface.hxx> #include <sfx2/request.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <sfx2/opengrf.hxx> #include <svl/whiter.hxx> #include <svx/svdograf.hxx> @@ -58,7 +58,7 @@ ScGraphicShell::ScGraphicShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_GRAPHIC); SetName("GraphicObject"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Graphic)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Graphic)); } ScGraphicShell::~ScGraphicShell() diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx index e89733a84701..4ddeec4c2abd 100644 --- a/sc/source/ui/drawfunc/mediash.cxx +++ b/sc/source/ui/drawfunc/mediash.cxx @@ -24,7 +24,7 @@ #include <svl/whiter.hxx> #include <svx/svdomedia.hxx> #include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include "mediash.hxx" #include "sc.hrc" @@ -50,7 +50,7 @@ ScMediaShell::ScMediaShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_MEDIA); SetName( OUString( ScResId( SCSTR_MEDIASHELL ) ) ); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Media)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Media)); } ScMediaShell::~ScMediaShell() diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx index 6c2ff3d34bff..e3096ebb3815 100644 --- a/sc/source/ui/drawfunc/oleobjsh.cxx +++ b/sc/source/ui/drawfunc/oleobjsh.cxx @@ -35,7 +35,7 @@ #include "drawview.hxx" #include "scresid.hxx" #include <svx/svdobj.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #define ScOleObjectShell #include "scslots.hxx" @@ -56,7 +56,7 @@ ScOleObjectShell::ScOleObjectShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_OLEOBEJCTSH); SetName("OleObject"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_OLE)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_OLE)); } ScOleObjectShell::~ScOleObjectShell() diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index 8762aad0f824..463c90b29cc6 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -247,7 +247,7 @@ void AlignmentPropertyPanel::DataChanged( } void AlignmentPropertyPanel::HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if (maContext == rContext) { diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx index 1ae9b98f6b3d..c5c0dea4f8a7 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx @@ -50,7 +50,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, @@ -93,7 +93,7 @@ private: /// bitfield bool mbMultiDisable : 1; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; SfxBindings* mpBindings; DECL_LINK_TYPED( MFLeftIndentMdyHdl, Edit&, void ); diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx index e653c17e8a5a..a4251454885a 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx @@ -245,7 +245,7 @@ void CellAppearancePropertyPanel::DataChanged( (void)rEvent; } -void CellAppearancePropertyPanel::HandleContextChange(const ::sfx2::sidebar::EnumContext& rContext) +void CellAppearancePropertyPanel::HandleContextChange(const vcl::EnumContext& rContext) { if (maContext == rContext) { diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx index f8cddae8d0a8..1aefb2a06fb5 100644 --- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx +++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx @@ -59,7 +59,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, @@ -136,7 +136,7 @@ private: std::unique_ptr< CellLineStylePopup > mpCellLineStylePopup; std::unique_ptr< CellBorderStylePopup > mpCellBorderStylePopup; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; SfxBindings* mpBindings; DECL_LINK_TYPED(TbxCellBorderSelectHdl, ToolBox*, void); diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx index 15bc8a1aa5f0..1a70f32fa54b 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx @@ -169,7 +169,7 @@ void NumberFormatPropertyPanel::DataChanged( } void NumberFormatPropertyPanel::HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if(maContext == rContext) { diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx index c6b2c82ccdc3..7947cb7b0436 100644 --- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx +++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx @@ -46,7 +46,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, @@ -78,7 +78,7 @@ private: sal_Int32 mnCategorySelected; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; SfxBindings* mpBindings; DECL_LINK_TYPED(NumFormatSelectHdl, ListBox&, void); diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx index bba0b46db499..bc94dd09b286 100644 --- a/sc/source/ui/view/auditsh.cxx +++ b/sc/source/ui/view/auditsh.cxx @@ -23,7 +23,7 @@ #include <sfx2/objface.hxx> #include <sfx2/objsh.hxx> #include <sfx2/request.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include "auditsh.hxx" #include "tabvwsh.hxx" @@ -56,7 +56,7 @@ ScAuditingShell::ScAuditingShell(ScViewData* pData) : } SetHelpId( HID_SCSHELL_AUDIT ); SetName("Auditing"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Auditing)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Auditing)); } ScAuditingShell::~ScAuditingShell() diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index f609e15ed3fe..667c869be4f2 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -33,7 +33,7 @@ #include <sfx2/objface.hxx> #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/clipfmtitem.hxx> #include <svx/sidebar/ContextChangeEventMultiplexer.hxx> #include <editeng/langitem.hxx> @@ -80,7 +80,7 @@ ScCellShell::ScCellShell(ScViewData* pData) : { SetHelpId(HID_SCSHELL_CELLSH); SetName("Cell"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Cell)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Cell)); } ScCellShell::~ScCellShell() diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 864f1ab787e5..7953fc54d4d9 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -36,7 +36,7 @@ #include <editeng/flstitem.hxx> #include <editeng/fontitem.hxx> #include <svx/hlnkitem.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <editeng/postitem.hxx> #include <editeng/scripttypeitem.hxx> #include <editeng/shdditem.hxx> @@ -99,7 +99,7 @@ ScEditShell::ScEditShell(EditView* pView, ScViewData* pData) : SetPool( pEditView->GetEditEngine()->GetEmptyItemSet().GetPool() ); SetUndoManager( &pEditView->GetEditEngine()->GetUndoManager() ); SetName("EditCell"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_EditCell)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_EditCell)); } ScEditShell::~ScEditShell() diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index b5c13839438a..13899b25eaaf 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -25,7 +25,7 @@ #include <sfx2/request.hxx> #include <svl/whiter.hxx> #include <vcl/msgbox.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include "sc.hrc" #include "pivotsh.hxx" @@ -65,7 +65,7 @@ ScPivotShell::ScPivotShell( ScTabViewShell* pViewSh ) : } SetHelpId( HID_SCSHELL_PIVOTSH ); SetName("Pivot"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Pivot)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Pivot)); } ScPivotShell::~ScPivotShell() diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index d1430303fb14..caa945a3ca80 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -214,7 +214,7 @@ void ScTabViewShell::Activate(bool bMDI) ContextChangeEventMultiplexer::NotifyContextChange( GetController(), - ::sfx2::sidebar::EnumContext::Context_Default); + vcl::EnumContext::Context_Default); } void ScTabViewShell::Deactivate(bool bMDI) diff --git a/sc/uiconfig/scalc/ui/notebookbar.ui b/sc/uiconfig/scalc/ui/notebookbar.ui index 8b75850678e4..cf72d70311dc 100644 --- a/sc/uiconfig/scalc/ui/notebookbar.ui +++ b/sc/uiconfig/scalc/ui/notebookbar.ui @@ -157,7 +157,7 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkNotebook" id="notebook1"> + <object class="vcllo-ContextTabControl" id="notebook1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index f6876624a866..2d4b06902513 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -91,6 +91,7 @@ #include <vcl/dndhelp.hxx> #include <vcl/dockwin.hxx> #include <vcl/edit.hxx> +#include <vcl/EnumContext.hxx> #include <vcl/field.hxx> #include <vcl/fixed.hxx> #include <vcl/fntstyle.hxx> @@ -355,7 +356,6 @@ #include <sfx2/printer.hxx> #include <sfx2/progress.hxx> #include <sfx2/request.hxx> -#include <sfx2/sidebar/EnumContext.hxx> #include <sfx2/sidebar/Sidebar.hxx> #include <sfx2/sidebar/SidebarChildWindow.hxx> #include <sfx2/sidebar/Theme.hxx> diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 10a6c9129feb..26f1dfd44071 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -160,7 +160,7 @@ void SlideBackground::Initialize() } void SlideBackground::HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if (maContext == rContext) return; @@ -371,10 +371,10 @@ IMPL_LINK_TYPED(SlideBackground, EventMultiplexerListener, { if(!mbTitle) { - sfx2::sidebar::EnumContext rDrawContext(sfx2::sidebar::EnumContext::Application_Draw, - sfx2::sidebar::EnumContext::Context_DrawPage); - sfx2::sidebar::EnumContext rImpressContext(sfx2::sidebar::EnumContext::Application_Impress, - sfx2::sidebar::EnumContext::Context_DrawPage); + vcl::EnumContext rDrawContext(vcl::EnumContext::Application_Draw, + vcl::EnumContext::Context_DrawPage); + vcl::EnumContext rImpressContext(vcl::EnumContext::Application_Impress, + vcl::EnumContext::Context_DrawPage); if(maContext == rDrawContext) { SetPanelTitle(SD_RESSTR(STR_PAGE_NAME)); diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index 1fba18aaf0e5..0848e56828c8 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -69,7 +69,7 @@ public: const SfxPoolItem* pState, const bool bIsEnabled) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; private: @@ -105,7 +105,7 @@ private: bool mbEditModeChangePending; css::uno::Reference<css::frame::XFrame> mxFrame; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; bool mbTitle; SfxBindings* mpBindings; diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 50fa6a7fca6a..25f0810c5281 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -60,7 +60,7 @@ #include <sfx2/request.hxx> #include <sfx2/sidebar/SidebarChildWindow.hxx> #include <svx/svxids.hrc> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/sidebar/ContextChangeEventMultiplexer.hxx> #include <svx/sidebar/SelectionAnalyzer.hxx> #include <com/sun/star/drawing/framework/XControllerManager.hpp> @@ -77,7 +77,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; using ::sd::framework::FrameworkHelper; -using ::sfx2::sidebar::EnumContext; +using ::vcl::EnumContext; namespace sd { namespace slidesorter { diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx index ded39a137046..c52b2717ace6 100644 --- a/sd/source/ui/table/tableobjectbar.cxx +++ b/sd/source/ui/table/tableobjectbar.cxx @@ -25,7 +25,7 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/msgpool.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svl/whiter.hxx> #include <svl/itempool.hxx> #include <svx/svdomedia.hxx> @@ -93,7 +93,7 @@ TableObjectBar::TableObjectBar( ViewShell* pSdViewShell, ::sd::View* pSdView ) SetRepeatTarget( mpView ); SetHelpId( SD_IF_SDDRAWTABLEOBJECTBAR ); SetName( SD_RESSTR( RID_DRAW_TABLE_TOOLBOX ) ); - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Table)); + SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Table)); } TableObjectBar::~TableObjectBar() diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 8f9c46e92470..645a680f24a9 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -45,7 +45,7 @@ #include <svx/fmshell.hxx> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/sidebar/ContextChangeEventMultiplexer.hxx> #include <memory> @@ -55,7 +55,7 @@ using namespace ::cppu; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing::framework; -using ::sfx2::sidebar::EnumContext; +using vcl::EnumContext; namespace sd { diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 2e79b863fc3b..6e78e3e8c36f 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -73,7 +73,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -using sfx2::sidebar::EnumContext; +using vcl::EnumContext; namespace sd { @@ -115,7 +115,7 @@ DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBas , mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler( [this] () { return this->GetSidebarContextName(); }, uno::Reference<frame::XController>(&rViewShellBase.GetDrawController()), - sfx2::sidebar::EnumContext::Context_Default)) + vcl::EnumContext::Context_Default)) { if (pFrameViewArgument != nullptr) mpFrameView = pFrameViewArgument; diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 44fe29aaa974..7da4bd9c1061 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -47,7 +47,7 @@ #include <svl/itempool.hxx> #include <sfx2/tplpitem.hxx> #include <sfx2/sidebar/SidebarChildWindow.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/svdorect.hxx> #include <sot/formats.hxx> #include <com/sun/star/linguistic2/XThesaurus.hpp> @@ -203,7 +203,7 @@ OutlineViewShell::OutlineViewShell ( Construct(GetDocSh()); - SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_OutlineText)); + SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_OutlineText)); m_StrOldPageName.clear(); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 95c3f569a125..df17d6c2b9a9 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -46,7 +46,7 @@ #include <svx/dialogs.hrc> #include <sfx2/viewfrm.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/svdopage.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <svx/xlndsit.hxx> diff --git a/sd/uiconfig/simpress/ui/notebookbar.ui b/sd/uiconfig/simpress/ui/notebookbar.ui index fafd7ef1958c..da12749dcc01 100644 --- a/sd/uiconfig/simpress/ui/notebookbar.ui +++ b/sd/uiconfig/simpress/ui/notebookbar.ui @@ -147,7 +147,7 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkNotebook" id="notebook1"> + <object class="vcllo-ContextTabControl" id="notebook1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 2cbeb2673ca1..ad58c6f5f94c 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -261,7 +261,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/sidebar/DeckLayouter \ sfx2/source/sidebar/DeckTitleBar \ sfx2/source/sidebar/DrawHelper \ - sfx2/source/sidebar/EnumContext \ sfx2/source/sidebar/FocusManager \ sfx2/source/sidebar/MenuButton \ sfx2/source/sidebar/IContextChangeReceiver \ diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index a6fda69ac1ff..694aaa1a3b1c 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -94,6 +94,7 @@ #include <vcl/dibtools.hxx> #include <vcl/dllapi.h> #include <vcl/edit.hxx> +#include <vcl/EnumContext.hxx> #include <vcl/fixed.hxx> #include <vcl/floatwin.hxx> #include <vcl/font.hxx> @@ -492,7 +493,6 @@ #include <sfx2/sidebar/DeckDescriptor.hxx> #include <sfx2/sidebar/DeckTitleBar.hxx> #include <sfx2/sidebar/DrawHelper.hxx> -#include <sfx2/sidebar/EnumContext.hxx> #include <sfx2/sidebar/Paint.hxx> #include <sfx2/sidebar/Panel.hxx> #include <sfx2/sidebar/PanelTitleBar.hxx> diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index dd7a41c5baea..5640e46c374e 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -13,8 +13,14 @@ #include <unotools/viewoptions.hxx> #include <vcl/notebookbar.hxx> #include <vcl/syswin.hxx> +#include <sfx2/viewfrm.hxx> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp> +#include <com/sun/star/ui/XContextChangeEventMultiplexer.hpp> using namespace sfx2; +using namespace css::uno; +using namespace css::ui; void SfxNotebookBar::ExecMethod(SfxBindings& rBindings) { @@ -33,7 +39,7 @@ void SfxNotebookBar::StateMethod(SfxBindings& rBindings, const OUString& rUIFile } void SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, - const css::uno::Reference<css::frame::XFrame> xFrame, + const Reference<css::frame::XFrame> xFrame, const OUString& rUIFile) { assert(pSysWindow); @@ -42,13 +48,44 @@ void SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, if (aViewOpt.IsVisible()) { + RemoveListeners(pSysWindow); + // setup if necessary pSysWindow->SetNotebookBar(rUIFile, xFrame); pSysWindow->GetNotebookBar()->Show(); + + SfxViewFrame* pView = SfxViewFrame::Current(); + + if(pView) + { + Reference<XContextChangeEventMultiplexer> xMultiplexer + = ContextChangeEventMultiplexer::get( + ::comphelper::getProcessComponentContext()); + + if(xFrame.is() && xMultiplexer.is()) + { + xMultiplexer->addContextChangeEventListener( + pSysWindow->GetNotebookBar().get(), + xFrame->getController()); + } + } } else if (auto pNotebookBar = pSysWindow->GetNotebookBar()) pNotebookBar->Hide(); } +void SfxNotebookBar::RemoveListeners(SystemWindow* pSysWindow) +{ + Reference<XContextChangeEventMultiplexer> xMultiplexer + = ContextChangeEventMultiplexer::get( + ::comphelper::getProcessComponentContext()); + + if (pSysWindow->GetNotebookBar() && xMultiplexer.is()) + { + xMultiplexer->removeAllContextChangeEventListeners( + pSysWindow->GetNotebookBar().get()); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx index 5ede4a575ad6..0a1bbe044bba 100644 --- a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx +++ b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <sidebar/ContextChangeBroadcaster.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <com/sun/star/ui/ContextChangeEventObject.hpp> #include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp> #include <com/sun/star/frame/ModuleManager.hpp> @@ -58,7 +58,7 @@ void ContextChangeBroadcaster::Deactivate (const css::uno::Reference<css::frame: BroadcastContextChange( rxFrame, GetModuleName(rxFrame), - EnumContext::GetContextName(EnumContext::Context_Default)); + vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Default)); } } diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 8958f3b4d5cd..d6a51a01f2e9 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -466,42 +466,42 @@ void ResourceManager::ReadContextList ( // application name may result in more than one value (eg // DrawImpress will result in two enums, one for Draw and one // for Impress). - std::vector<EnumContext::Application> aApplications; - EnumContext::Application eApplication (EnumContext::GetApplicationEnum(sApplicationName)); + std::vector<vcl::EnumContext::Application> aApplications; + vcl::EnumContext::Application eApplication (vcl::EnumContext::GetApplicationEnum(sApplicationName)); - if (eApplication == EnumContext::Application_None - && !sApplicationName.equals(EnumContext::GetApplicationName(EnumContext::Application_None))) + if (eApplication == vcl::EnumContext::Application_None + && !sApplicationName.equals(vcl::EnumContext::GetApplicationName(vcl::EnumContext::Application_None))) { // Handle some special names: abbreviations that make // context descriptions more readable. if (sApplicationName == "Writer") - aApplications.push_back(EnumContext::Application_Writer); + aApplications.push_back(vcl::EnumContext::Application_Writer); else if (sApplicationName == "Calc") - aApplications.push_back(EnumContext::Application_Calc); + aApplications.push_back(vcl::EnumContext::Application_Calc); else if (sApplicationName == "Draw") - aApplications.push_back(EnumContext::Application_Draw); + aApplications.push_back(vcl::EnumContext::Application_Draw); else if (sApplicationName == "Impress") - aApplications.push_back(EnumContext::Application_Impress); + aApplications.push_back(vcl::EnumContext::Application_Impress); else if (sApplicationName == "Chart") - aApplications.push_back(EnumContext::Application_Chart); + aApplications.push_back(vcl::EnumContext::Application_Chart); else if (sApplicationName == "DrawImpress") { // A special case among the special names: it is // common to use the same context descriptions for // both Draw and Impress. This special case helps to // avoid duplication in the .xcu file. - aApplications.push_back(EnumContext::Application_Draw); - aApplications.push_back(EnumContext::Application_Impress); + aApplications.push_back(vcl::EnumContext::Application_Draw); + aApplications.push_back(vcl::EnumContext::Application_Impress); } else if (sApplicationName == "WriterVariants") { // Another special case for all Writer variants. - aApplications.push_back(EnumContext::Application_Writer); - aApplications.push_back(EnumContext::Application_WriterGlobal); - aApplications.push_back(EnumContext::Application_WriterWeb); - aApplications.push_back(EnumContext::Application_WriterXML); - aApplications.push_back(EnumContext::Application_WriterForm); - aApplications.push_back(EnumContext::Application_WriterReport); + aApplications.push_back(vcl::EnumContext::Application_Writer); + aApplications.push_back(vcl::EnumContext::Application_WriterGlobal); + aApplications.push_back(vcl::EnumContext::Application_WriterWeb); + aApplications.push_back(vcl::EnumContext::Application_WriterXML); + aApplications.push_back(vcl::EnumContext::Application_WriterForm); + aApplications.push_back(vcl::EnumContext::Application_WriterReport); } else { @@ -516,8 +516,8 @@ void ResourceManager::ReadContextList ( } // Setup the actual context enum. - const EnumContext::Context eContext (EnumContext::GetContextEnum(sContextName)); - if (eContext == EnumContext::Context_Unknown) + const vcl::EnumContext::Context eContext (vcl::EnumContext::GetContextEnum(sContextName)); + if (eContext == vcl::EnumContext::Context_Unknown) { SAL_WARN("sfx.sidebar", "context name " << sContextName << " not recognized"); continue; @@ -538,15 +538,15 @@ void ResourceManager::ReadContextList ( // Add context descriptors. - std::vector<EnumContext::Application>::const_iterator iApplication; + std::vector<vcl::EnumContext::Application>::const_iterator iApplication; for (iApplication = aApplications.begin(); iApplication != aApplications.end(); ++iApplication) { - if (*iApplication != EnumContext::Application_None) + if (*iApplication != vcl::EnumContext::Application_None) { rContextList.AddContextDescription( Context( - EnumContext::GetApplicationName(*iApplication), - EnumContext::GetContextName(eContext)), + vcl::EnumContext::GetApplicationName(*iApplication), + vcl::EnumContext::GetContextName(eContext)), bIsInitiallyVisible, sMenuCommand); } diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 78de65dcc0fb..4685bf67f535 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -683,14 +683,14 @@ void SidebarController::SwitchToDeck ( if (aPanelContextDescriptors.empty()) { // There are no panels to be displayed in the current context. - if (EnumContext::GetContextEnum(rContext.msContext) != EnumContext::Context_Empty) + if (vcl::EnumContext::GetContextEnum(rContext.msContext) != vcl::EnumContext::Context_Empty) { // Switch to the "empty" context and try again. SwitchToDeck( rDeckDescriptor, Context( rContext.msApplication, - EnumContext::GetContextName(EnumContext::Context_Empty))); + vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Empty))); return; } else diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx index e8ed312ba565..ff7708431216 100644 --- a/sfx2/source/sidebar/SidebarPanelBase.cxx +++ b/sfx2/source/sidebar/SidebarPanelBase.cxx @@ -104,9 +104,9 @@ void SAL_CALL SidebarPanelBase::notifyContextChangeEvent ( = dynamic_cast<IContextChangeReceiver*>(mpControl.get()); if (pContextChangeReceiver != nullptr) { - const EnumContext aContext( - EnumContext::GetApplicationEnum(rEvent.ApplicationName), - EnumContext::GetContextEnum(rEvent.ContextName)); + const vcl::EnumContext aContext( + vcl::EnumContext::GetApplicationEnum(rEvent.ApplicationName), + vcl::EnumContext::GetContextEnum(rEvent.ContextName)); pContextChangeReceiver->HandleContextChange(aContext); } } diff --git a/sfx2/uiconfig/ui/notebookbar.ui b/sfx2/uiconfig/ui/notebookbar.ui index 1f7bf46a1294..a0aa02ec23dd 100644 --- a/sfx2/uiconfig/ui/notebookbar.ui +++ b/sfx2/uiconfig/ui/notebookbar.ui @@ -11,7 +11,7 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkNotebook" id="notebook1"> + <object class="vcllo-ContextTabControl" id="notebook1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index d10895b99996..c1dff2d4149a 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -91,6 +91,7 @@ #include <vcl/dllapi.h> #include <vcl/dockwin.hxx> #include <vcl/edit.hxx> +#include <vcl/EnumContext.hxx> #include <vcl/field.hxx> #include <vcl/fixed.hxx> #include <vcl/floatwin.hxx> @@ -331,7 +332,6 @@ #include <sfx2/sfxuno.hxx> #include <sfx2/shell.hxx> #include <sfx2/sidebar/ControlFactory.hxx> -#include <sfx2/sidebar/EnumContext.hxx> #include <sfx2/sidebar/ResourceManager.hxx> #include <sfx2/sidebar/TabBar.hxx> #include <sfx2/sidebar/Theme.hxx> diff --git a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx index 53f40f4b3bbb..f8dbc13110f2 100644 --- a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx +++ b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx @@ -33,14 +33,14 @@ using namespace css::uno; void ContextChangeEventMultiplexer::NotifyContextChange ( const css::uno::Reference<css::frame::XController>& rxController, - const ::sfx2::sidebar::EnumContext::Context eContext) + const vcl::EnumContext::Context eContext) { if (rxController.is() && rxController->getFrame().is()) { const css::ui::ContextChangeEventObject aEvent( rxController, GetModuleName(rxController->getFrame()), - ::sfx2::sidebar::EnumContext::GetContextName(eContext)); + vcl::EnumContext::GetContextName(eContext)); css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer ( css::ui::ContextChangeEventMultiplexer::get( @@ -53,7 +53,7 @@ void ContextChangeEventMultiplexer::NotifyContextChange ( void ContextChangeEventMultiplexer::NotifyContextChange ( SfxViewShell* pViewShell, - const ::sfx2::sidebar::EnumContext::Context eContext) + const vcl::EnumContext::Context eContext) { if (pViewShell != nullptr) NotifyContextChange(pViewShell->GetController(), eContext); @@ -75,8 +75,8 @@ void ContextChangeEventMultiplexer::NotifyContextChange ( // during initialization or destruction of a view. // Ignore it. } - return ::sfx2::sidebar::EnumContext::GetApplicationName( - ::sfx2::sidebar::EnumContext::Application_None); + return vcl::EnumContext::GetApplicationName( + vcl::EnumContext::Application_None); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index 4b954ec8e2be..ceb4f68f0ec3 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -114,7 +114,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( Reference<ui::XSidebar> xSidebar (aArguments.getOrDefault("Sidebar", Reference<ui::XSidebar>())); const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0))); SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); - ::sfx2::sidebar::EnumContext aContext ( + vcl::EnumContext aContext ( aArguments.getOrDefault("ApplicationName", OUString()), aArguments.getOrDefault("ContextName", OUString())); diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx index a4c6dbf4d007..df468fb72a03 100644 --- a/svx/source/sidebar/SelectionAnalyzer.cxx +++ b/svx/source/sidebar/SelectionAnalyzer.cxx @@ -25,7 +25,7 @@ #include "svx/fmglob.hxx" #include "svx/globl3d.hxx" -using sfx2::sidebar::EnumContext; +using vcl::EnumContext; namespace svx { namespace sidebar { diff --git a/svx/source/sidebar/SelectionChangeHandler.cxx b/svx/source/sidebar/SelectionChangeHandler.cxx index 2cc8cc9b9a84..76430afbd6b0 100644 --- a/svx/source/sidebar/SelectionChangeHandler.cxx +++ b/svx/source/sidebar/SelectionChangeHandler.cxx @@ -21,21 +21,19 @@ #include "svx/sidebar/ContextChangeEventMultiplexer.hxx" #include "svx/svdmrkv.hxx" -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <sfx2/shell.hxx> using namespace css; using namespace css::uno; -using namespace sfx2::sidebar; - namespace svx { namespace sidebar { SelectionChangeHandler::SelectionChangeHandler ( const std::function<rtl::OUString()>& rSelectionChangeCallback, const Reference<css::frame::XController>& rxController, - const EnumContext::Context eDefaultContext) + const vcl::EnumContext::Context eDefaultContext) : SelectionChangeHandlerInterfaceBase(m_aMutex), maSelectionChangeCallback(rSelectionChangeCallback), mxController(rxController), @@ -55,11 +53,11 @@ void SAL_CALL SelectionChangeHandler::selectionChanged (const lang::EventObject& { if (maSelectionChangeCallback) { - const EnumContext::Context eContext ( - EnumContext::GetContextEnum(maSelectionChangeCallback())); + const vcl::EnumContext::Context eContext ( + vcl::EnumContext::GetContextEnum(maSelectionChangeCallback())); ContextChangeEventMultiplexer::NotifyContextChange( mxController, - eContext==EnumContext::Context_Unknown + eContext==vcl::EnumContext::Context_Unknown ? meDefaultContext : eContext); } diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx index 9670e74a1aa9..b5038bc10ed4 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.cxx +++ b/svx/source/sidebar/line/LinePropertyPanel.cxx @@ -184,7 +184,7 @@ void LinePropertyPanel::NotifyItemUpdate( } void LinePropertyPanel::HandleContextChange( - const sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if(maContext == rContext) { diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx index 595cc457290a..19b2cdd5f937 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.hxx +++ b/svx/source/sidebar/line/LinePropertyPanel.hxx @@ -71,7 +71,7 @@ public: SfxBindings* pBindings); virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, @@ -113,7 +113,7 @@ private: sfx2::sidebar::ControllerItem maCapStyle; SfxBindings* mpBindings; - sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; void Initialize(); }; diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index b50c587ab0ed..f5cdf2b26231 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -72,7 +72,7 @@ VclPtr<vcl::Window> ParaPropertyPanel::Create ( } void ParaPropertyPanel::HandleContextChange ( - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if (maContext == rContext) { @@ -146,7 +146,7 @@ void ParaPropertyPanel::HandleContextChange ( break; } - mpTBxOutline->Show( maContext.GetApplication_DI() == sfx2::sidebar::EnumContext::Application_DrawImpress ); + mpTBxOutline->Show( maContext.GetApplication_DI() == vcl::EnumContext::Application_DrawImpress ); } void ParaPropertyPanel::DataChanged (const DataChangedEvent& rEvent) diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 50fde91799cf..4b204749efd3 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -56,7 +56,7 @@ public: SfxBindings* GetBindings() { return mpBindings;} virtual void HandleContextChange ( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, @@ -107,7 +107,7 @@ private: ::sfx2::sidebar::ControllerItem maIncIndentControl; ::sfx2::sidebar::ControllerItem m_aMetricCtl; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; SfxBindings* mpBindings; css::uno::Reference<css::ui::XSidebar> mxSidebar; diff --git a/svx/source/sidebar/paragraph/ParaSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx index 7822db158fa7..e4dc5d0c897f 100644 --- a/svx/source/sidebar/paragraph/ParaSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx @@ -137,9 +137,9 @@ void SAL_CALL ParaLRSpacingControl::notifyContextChangeEvent(const css::ui::Cont if(pWindow) { - ::sfx2::sidebar::EnumContext eContext = ::sfx2::sidebar::EnumContext( - ::sfx2::sidebar::EnumContext::GetApplicationEnum(rEvent.ApplicationName), - ::sfx2::sidebar::EnumContext::GetContextEnum(rEvent.ContextName)); + vcl::EnumContext eContext = vcl::EnumContext( + vcl::EnumContext::GetApplicationEnum(rEvent.ApplicationName), + vcl::EnumContext::GetContextEnum(rEvent.ContextName)); pWindow->SetContext(eContext); } } diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx index 93a2099c92c2..e5d81ed0c97d 100644 --- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx +++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx @@ -135,7 +135,7 @@ void ParaLRSpacingWindow::dispose() VclVBox::dispose(); } -void ParaLRSpacingWindow::SetContext(const ::sfx2::sidebar::EnumContext& eContext) +void ParaLRSpacingWindow::SetContext(const vcl::EnumContext& eContext) { m_aContext = eContext; } diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx index 4a01ae8ed372..61ccfca53445 100644 --- a/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx +++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx @@ -24,10 +24,10 @@ #include <editeng/lrspitem.hxx> #include <vcl/builder.hxx> #include <vcl/layout.hxx> +#include <vcl/EnumContext.hxx> #include <svx/relfld.hxx> #include <svtools/unitconv.hxx> #include <sfx2/sidebar/ControllerItem.hxx> -#include <sfx2/sidebar/EnumContext.hxx> using namespace com::sun::star; @@ -64,7 +64,7 @@ public: void SetValue(SfxItemState eState, const SfxPoolItem* pState); void SetUnit(FieldUnit eUnit); - void SetContext(const ::sfx2::sidebar::EnumContext& eContext); + void SetContext(const vcl::EnumContext& eContext); private: VclPtr<SvxRelativeField> m_pBeforeSpacing; @@ -73,7 +73,7 @@ private: SfxMapUnit m_eUnit; - ::sfx2::sidebar::EnumContext m_aContext; + vcl::EnumContext m_aContext; DECL_LINK_TYPED(ModifySpacingHdl, Edit&, void); }; diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 103d226d2616..155e2a3fc2e7 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -253,7 +253,7 @@ void PosSizePropertyPanel::DataChanged( } void PosSizePropertyPanel::HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if (maContext == rContext) { diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index 21ada21e093d..9ec990c4d135 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -65,7 +65,7 @@ public: const DataChangedEvent& rEvent) override; virtual void HandleContextChange( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( const sal_uInt16 nSId, @@ -136,7 +136,7 @@ private: ::sfx2::sidebar::ControllerItem maAutoHeightControl; ::sfx2::sidebar::ControllerItem m_aMetricCtl; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; SfxBindings* mpBindings; /// bitfield diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.hxx b/svx/source/sidebar/styles/StylesPropertyPanel.hxx index dd91133f89a4..1b16267bff53 100644 --- a/svx/source/sidebar/styles/StylesPropertyPanel.hxx +++ b/svx/source/sidebar/styles/StylesPropertyPanel.hxx @@ -4,7 +4,7 @@ #include <sfx2/sidebar/SidebarPanelBase.hxx> #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svtools/ctrlbox.hxx> #include <editeng/fhgtitem.hxx> #include <com/sun/star/ui/XUIElement.hpp> diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index 85cbaab74e81..e9c8d965a17c 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -39,7 +39,7 @@ VclPtr<vcl::Window> TextPropertyPanel::Create ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings, - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if (pParent == nullptr) throw lang::IllegalArgumentException("no parent Window given to TextPropertyPanel::Create", nullptr, 0); @@ -55,7 +55,7 @@ VclPtr<vcl::Window> TextPropertyPanel::Create ( rContext); } -TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings, const ::sfx2::sidebar::EnumContext& /*rContext*/ ) +TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings, const vcl::EnumContext& /*rContext*/ ) : PanelLayout(pParent, "SidebarTextPanel", "svx/ui/sidebartextpanel.ui", rxFrame), maFontSizeControl (SID_ATTR_CHAR_FONTHEIGHT, *pBindings, *this, OUString("FontHeight"), rxFrame), @@ -91,7 +91,7 @@ void TextPropertyPanel::dispose() } void TextPropertyPanel::HandleContextChange ( - const ::sfx2::sidebar::EnumContext& rContext) + const vcl::EnumContext& rContext) { if (maContext == rContext) return; diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx index fbdb7118cb06..a61ea40e9962 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.hxx +++ b/svx/source/sidebar/text/TextPropertyPanel.hxx @@ -22,7 +22,7 @@ #include <sfx2/sidebar/SidebarPanelBase.hxx> #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svtools/ctrlbox.hxx> #include <editeng/fhgtitem.hxx> @@ -51,11 +51,11 @@ public: vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings, - const ::sfx2::sidebar::EnumContext& rContext); + const vcl::EnumContext& rContext); virtual void HandleContextChange ( - const ::sfx2::sidebar::EnumContext& rContext) override; + const vcl::EnumContext& rContext) override; virtual void NotifyItemUpdate( @@ -68,7 +68,7 @@ public: vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame, SfxBindings* pBindings, - const ::sfx2::sidebar::EnumContext& rContext); + const vcl::EnumContext& rContext); private: //ui controls @@ -84,7 +84,7 @@ private: SvxFontHeightItem* mpHeightItem; - ::sfx2::sidebar::EnumContext maContext; + vcl::EnumContext maContext; }; } } // end of namespace svx::sidebar diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index bcad79a6ee39..374228bfcad8 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -99,6 +99,7 @@ #include <vcl/dialog.hxx> #include <vcl/dllapi.h> #include <vcl/edit.hxx> +#include <vcl/EnumContext.hxx> #include <vcl/field.hxx> #include <vcl/fixed.hxx> #include <vcl/floatwin.hxx> @@ -413,7 +414,6 @@ #include <sfx2/progress.hxx> #include <sfx2/request.hxx> #include <sfx2/shell.hxx> -#include <sfx2/sidebar/EnumContext.hxx> #include <sfx2/tbxctrl.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index d9b8d9fba8c6..e83249e9538d 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -102,7 +102,7 @@ #include <svx/dialogs.hrc> #include <svx/svxids.hrc> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svl/itempool.hxx> #include <editeng/outliner.hxx> #include <editeng/editeng.hxx> @@ -156,7 +156,7 @@ SwAnnotationShell::SwAnnotationShell( SwView& r ) : rView(r) { SetPool(SwAnnotationShell::GetAnnotationPool(rView)); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Annotation)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Annotation)); } SwAnnotationShell::~SwAnnotationShell() diff --git a/sw/source/uibase/shells/beziersh.cxx b/sw/source/uibase/shells/beziersh.cxx index 45af54e1f179..8303d4c4728a 100644 --- a/sw/source/uibase/shells/beziersh.cxx +++ b/sw/source/uibase/shells/beziersh.cxx @@ -23,7 +23,7 @@ #include <svl/eitem.hxx> #include <svl/whiter.hxx> #include <svx/svdopath.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objface.hxx> @@ -63,7 +63,7 @@ SwBezierShell::SwBezierShell(SwView &_rView): SdrView* pSdrView = pSh->GetDrawView(); pSdrView->SetEliminatePolyPointLimitAngle(1500L); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Draw)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Draw)); } void SwBezierShell::Execute(SfxRequest &rReq) diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index 6c1fc4360ab9..a1bb7666e471 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -43,7 +43,7 @@ #include <svx/svdoashp.hxx> #include <svx/xtable.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/svdoole2.hxx> #include <sfx2/opengrf.hxx> #include <svx/svdograf.hxx> @@ -538,7 +538,7 @@ SwDrawShell::SwDrawShell(SwView &_rView) : SetHelpId(SW_DRAWSHELL); SetName("Draw"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Draw)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Draw)); } // Edit SfxRequests for FontWork diff --git a/sw/source/uibase/shells/drformsh.cxx b/sw/source/uibase/shells/drformsh.cxx index 360d99bc0d8e..e93f75913aa8 100644 --- a/sw/source/uibase/shells/drformsh.cxx +++ b/sw/source/uibase/shells/drformsh.cxx @@ -26,7 +26,7 @@ #include <sfx2/app.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svl/srchitem.hxx> #include <svx/fmglob.hxx> #include <svx/svdouno.hxx> @@ -250,7 +250,7 @@ SwDrawFormShell::SwDrawFormShell(SwView &_rView) : SetHelpId(SW_DRAWFORMSHELL); GetShell().NoEdit(); SetName("DrawForm"); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Form)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Form)); } SwDrawFormShell::~SwDrawFormShell() diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index df2dbda4f856..9905653d81b2 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -35,7 +35,7 @@ #include <sfx2/bindings.hxx> #include <svx/fontwork.hxx> #include <sfx2/request.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svl/whiter.hxx> #include <editeng/outliner.hxx> #include <editeng/editstat.hxx> @@ -133,7 +133,7 @@ SwDrawTextShell::SwDrawTextShell(SwView &rV) : rSh.NoEdit(); SetName("ObjectText"); SetHelpId(SW_DRWTXTSHELL); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_DrawText)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_DrawText)); } SwDrawTextShell::~SwDrawTextShell() diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index a78df35033f0..0854306985f9 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -39,7 +39,7 @@ #include <sfx2/dispatch.hxx> #include <sfx2/request.hxx> #include <sfx2/objface.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/hlnkitem.hxx> #include <svx/svdview.hxx> #include <vcl/msgbox.hxx> @@ -943,7 +943,7 @@ SwFrameShell::SwFrameShell(SwView &_rView) : // #96392# Use this to announce it is the frame shell who creates the selection. SwTransferable::CreateSelection( _rView.GetWrtShell(), this ); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Frame)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Frame)); } SwFrameShell::~SwFrameShell() diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 110d09165c1d..c5fee03511b7 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -31,7 +31,7 @@ #include <editeng/sizeitem.hxx> #include <editeng/protitem.hxx> #include <sfx2/request.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svl/srchitem.hxx> #include <sfx2/htmlmode.hxx> #include <svx/sdgluitm.hxx> @@ -943,7 +943,7 @@ SwGrfShell::SwGrfShell(SwView &_rView) : { SetName("Graphic"); SetHelpId(SW_GRFSHELL); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Graphic)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Graphic)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/mediash.cxx b/sw/source/uibase/shells/mediash.cxx index 59953c73df16..ccf4e5aef73d 100644 --- a/sw/source/uibase/shells/mediash.cxx +++ b/sw/source/uibase/shells/mediash.cxx @@ -58,7 +58,7 @@ #include <popup.hrc> #include <sfx2/objface.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <svx/svdomedia.hxx> #include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx> #include <avmedia/mediaitem.hxx> @@ -192,7 +192,7 @@ SwMediaShell::SwMediaShell(SwView &_rView) : { SetName("Media Playback"); SetHelpId(SW_MEDIASHELL); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Media)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Media)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/olesh.cxx b/sw/source/uibase/shells/olesh.cxx index 82dbaeff7785..160c34af04ba 100644 --- a/sw/source/uibase/shells/olesh.cxx +++ b/sw/source/uibase/shells/olesh.cxx @@ -21,7 +21,7 @@ #include <sfx2/request.hxx> #include <sfx2/objface.hxx> #include <sfx2/objitem.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <wrtsh.hxx> #include <view.hxx> #include <helpid.h> @@ -52,7 +52,7 @@ SwOleShell::SwOleShell(SwView &_rView) : { SetName("Object"); SetHelpId(SW_OLESHELL); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_OLE)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_OLE)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 2fe8d820b56e..0f8353475cd8 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -45,7 +45,7 @@ #include <sfx2/request.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/objface.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <o3tl/enumrange.hxx> #include <fmtornt.hxx> @@ -1406,7 +1406,7 @@ SwTableShell::SwTableShell(SwView &_rView) : { SetName("Table"); SetHelpId(SW_TABSHELL); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Table)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Table)); } void SwTableShell::GetFrameBorderState(SfxItemSet &rSet) diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 392e42c1f88a..e302b8f0e55d 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -98,7 +98,7 @@ #define SwTextShell #include <sfx2/msg.hxx> -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <swslots.hxx> #include <SwRewriter.hxx> #include <comcore.hrc> @@ -829,7 +829,7 @@ SwTextShell::SwTextShell(SwView &_rView) : { SetName("Text"); SetHelpId(SW_TEXTSHELL); - SfxShell::SetContextName(sfx2::sidebar::EnumContext::GetContextName(sfx2::sidebar::EnumContext::Context_Text)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context_Text)); } SwTextShell::~SwTextShell() diff --git a/sw/uiconfig/swriter/ui/notebookbar.ui b/sw/uiconfig/swriter/ui/notebookbar.ui index 0c22525cdf0e..2c9cbdd9d174 100644 --- a/sw/uiconfig/swriter/ui/notebookbar.ui +++ b/sw/uiconfig/swriter/ui/notebookbar.ui @@ -178,7 +178,7 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <child> - <object class="GtkNotebook" id="notebook1"> + <object class="vcllo-ContextTabControl" id="notebook1"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> @@ -1192,6 +1192,10 @@ <property name="can_focus">False</property> <property name="label" translatable="yes">Home</property> <property name="use_underline">True</property> + <style> + <class name="context-any"/> + <class name="context-Text"/> + </style> </object> <packing> <property name="position">1</property> @@ -3568,24 +3572,15 @@ <property name="can_focus">False</property> <property name="label" translatable="yes">Table</property> <property name="use_underline">True</property> + <style> + <class name="context-Table"/> + </style> </object> <packing> <property name="position">6</property> <property name="tab_fill">False</property> </packing> </child> - <child> - <placeholder/> - </child> - <child type="tab"> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child type="tab"> - <placeholder/> - </child> </object> <packing> <property name="expand">False</property> diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index d3c3f8019c50..8068cffdc6e0 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -189,8 +189,10 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/window \ vcl/source/window/winproc \ vcl/source/window/wrkwin \ + vcl/source/window/EnumContext \ vcl/source/control/button \ vcl/source/control/combobox \ + vcl/source/control/contexttabctrl \ vcl/source/control/ctrl \ vcl/source/control/edit \ vcl/source/control/field2 \ diff --git a/vcl/source/control/contexttabctrl.cxx b/vcl/source/control/contexttabctrl.cxx new file mode 100644 index 000000000000..29e43ad9f098 --- /dev/null +++ b/vcl/source/control/contexttabctrl.cxx @@ -0,0 +1,54 @@ +/* -*- 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 <vcl/builderfactory.hxx> +#include <vcl/contexttabctrl.hxx> +#include <vcl/tabpage.hxx> + +VCL_BUILDER_FACTORY(ContextTabControl); + +ContextTabControl::ContextTabControl( vcl::Window* pParent, WinBits nStyle ) : + TabControl( pParent, nStyle ) + , eLastContext(vcl::EnumContext::Context::Context_Any) +{ + HideDisabledTabs(); +} + +void ContextTabControl::SetContext( vcl::EnumContext::Context eContext ) +{ + if (eLastContext != eContext) + { + for (int nChild = 0; nChild < GetChildCount(); ++nChild) + { + TabPage* pPage = static_cast<TabPage*>(GetChild(nChild)); + + if (pPage->HasContext(eContext) || pPage->HasContext(vcl::EnumContext::Context::Context_Any)) + EnablePage(nChild + 1, true); + else + EnablePage(nChild + 1, false); + + if (pPage->HasContext(eContext) && eContext != vcl::EnumContext::Context::Context_Any) + SetCurPageId(nChild + 1); + } + + eLastContext = eContext; + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index a037eb7fa18e..939fa102360a 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -9,12 +9,14 @@ #include <vcl/layout.hxx> #include <vcl/notebookbar.hxx> +#include <cppuhelper/queryinterface.hxx> NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame) : Control(pParent) { SetStyle(GetStyle() | WB_DIALOGCONTROL); m_pUIBuilder = new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID, rFrame); + get(m_pTabControl, "notebook1"); } NotebookBar::~NotebookBar() @@ -76,4 +78,31 @@ void NotebookBar::StateChanged(StateChangedType nType) Control::StateChanged(nType); } +void SAL_CALL NotebookBar::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) + throw (css::uno::RuntimeException, std::exception) +{ + m_pTabControl->SetContext(vcl::EnumContext::GetContextEnum(rEvent.ContextName)); +} + +::css::uno::Any SAL_CALL NotebookBar::queryInterface(const ::css::uno::Type& aType) + throw (::css::uno::RuntimeException, ::std::exception) +{ + return ::cppu::queryInterface(aType, static_cast<css::ui::XContextChangeEventListener*>(this)); +} + +void SAL_CALL NotebookBar::acquire() throw () +{ + Control::acquire(); +} + +void SAL_CALL NotebookBar::release() throw () +{ + Control::release(); +} + +void SAL_CALL NotebookBar::disposing(const ::css::lang::EventObject&) + throw (::css::uno::RuntimeException, ::std::exception) +{ +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 491a2a06cfe1..6420817a044b 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -96,6 +96,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle ) mbSmallInvalidate = false; mpTabCtrlData = new ImplTabCtrlData; mpTabCtrlData->mpListBox = nullptr; + mbHideDisabledTabs = false; ImplInitSettings( true, true, true ); @@ -1197,16 +1198,20 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const Rectangle& while (idx < mpTabCtrlData->maItemList.size()) { ImplTabItem* pItem = &mpTabCtrlData->maItemList[idx]; - if (pItem != pCurItem) + + if(!mbHideDisabledTabs || (mbHideDisabledTabs && pItem->mbEnabled)) { - vcl::Region aClipRgn(rRenderContext.GetActiveClipRegion()); - aClipRgn.Intersect(pItem->maRect); - if (!rRect.IsEmpty()) - aClipRgn.Intersect(rRect); - if (!aClipRgn.IsEmpty()) + if (pItem != pCurItem) { - ImplDrawItem(rRenderContext, pItem, aCurRect, false/*bLayout*/, - pItem == pFirstTab, pItem == pLastTab); + vcl::Region aClipRgn(rRenderContext.GetActiveClipRegion()); + aClipRgn.Intersect(pItem->maRect); + if (!rRect.IsEmpty()) + aClipRgn.Intersect(rRect); + if (!aClipRgn.IsEmpty()) + { + ImplDrawItem(rRenderContext, pItem, aCurRect, false/*bLayout*/, + pItem == pFirstTab, pItem == pLastTab); + } } } @@ -1757,6 +1762,11 @@ void TabControl::EnablePage( sal_uInt16 i_nPageId, bool i_bEnable ) } } +void TabControl::HideDisabledTabs(bool bHide) +{ + mbHideDisabledTabs = bHide; +} + sal_uInt16 TabControl::GetPageCount() const { return (sal_uInt16)mpTabCtrlData->maItemList.size(); diff --git a/sfx2/source/sidebar/EnumContext.cxx b/vcl/source/window/EnumContext.cxx index 281e63fd6663..80d35b625a13 100644 --- a/sfx2/source/sidebar/EnumContext.cxx +++ b/vcl/source/window/EnumContext.cxx @@ -16,13 +16,13 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <sfx2/sidebar/EnumContext.hxx> +#include <vcl/EnumContext.hxx> #include <osl/diagnose.h> #include <map> -namespace sfx2 { namespace sidebar { +namespace vcl { namespace { @@ -227,6 +227,6 @@ const ::rtl::OUString& EnumContext::GetContextName (const Context eContext) return maContextVector[nIndex]; } -} } // end of namespace sfx2::sidebar +} // end of namespace vcl /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 2f1fd3df4e7f..9797956cfd50 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1923,6 +1923,8 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read int nLevel = 1; stringmap aProperties; + std::vector<vcl::EnumContext::Context> context; + while(true) { xmlreader::Span name; @@ -1952,6 +1954,11 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read } } } + else if (name.equals("style")) + { + context = handleStyle(reader); + --nLevel; + } else if (name.equals("property")) collectProperty(reader, sID, aProperties); } @@ -1977,6 +1984,11 @@ void VclBuilder::handleTabChild(vcl::Window *pParent, xmlreader::XmlReader &read pTabControl->SetPageText(nPageId, OStringToOUString(aFind->second, RTL_TEXTENCODING_UTF8)); pTabControl->SetPageName(nPageId, sID); + if (context.size() != 0) + { + TabPage* pPage = static_cast<TabPage*>(pTabControl->GetTabPage(nPageId)); + pPage->SetContext(context); + } } else pTabControl->RemovePage(pTabControl->GetCurPageId()); @@ -3032,6 +3044,72 @@ void VclBuilder::applyPackingProperty(vcl::Window *pCurrent, } } +std::vector<vcl::EnumContext::Context> VclBuilder::handleStyle(xmlreader::XmlReader &reader) +{ + std::vector<vcl::EnumContext::Context> aContext; + + xmlreader::Span name; + int nsId; + + int nLevel = 1; + + while(true) + { + xmlreader::XmlReader::Result res = reader.nextItem( + xmlreader::XmlReader::Text::NONE, &name, &nsId); + + if (res == xmlreader::XmlReader::Result::Done) + break; + + if (res == xmlreader::XmlReader::Result::Begin) + { + ++nLevel; + if (name.equals("class")) + { + aContext.push_back(getContext(reader)); + } + } + + if (res == xmlreader::XmlReader::Result::End) + { + --nLevel; + } + + if (!nLevel) + break; + } + + return aContext; +} + +vcl::EnumContext::Context VclBuilder::getContext(xmlreader::XmlReader &reader) +{ + xmlreader::Span name; + int nsId; + + while (reader.nextAttribute(&nsId, &name)) + { + if (name.equals("name")) + { + name = reader.getAttributeValue(false); + OString sKey(name.begin, name.length); + + if (sKey.startsWith("context-")) + { + OString sContext = sKey.copy(sKey.indexOf('-') + 1); + OUString sContext2 = OUString(sContext.getStr(), sContext.getLength(), RTL_TEXTENCODING_UTF8); + return vcl::EnumContext::GetContextEnum(sContext2); + } + else + { + SAL_WARN("vcl.layout", "unknown class: " << sKey.getStr()); + } + } + } + + return vcl::EnumContext::Context::Context_Any; +} + OString VclBuilder::getTranslation(const OString &rID, const OString &rProperty) const { Translations::const_iterator aWidgetFind = m_pParserState->m_aTranslations.find(rID); diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index 576d645ea820..2079ec9bdb50 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -44,6 +44,8 @@ void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle ) // otherwise they will paint with a wrong background if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) EnableChildTransparentMode(); + + maContext.push_back( vcl::EnumContext::Context::Context_Any ); } void TabPage::ImplInitSettings() @@ -222,4 +224,22 @@ void TabPage::SetPosPixel(const Point& rAllocPos) } } +void TabPage::SetContext(const std::vector<vcl::EnumContext::Context>& aContext) +{ + maContext = aContext; +} + +bool TabPage::HasContext( const vcl::EnumContext::Context eContext ) const +{ + auto aFind = std::find(maContext.begin(), maContext.end(), eContext); + if (aFind == maContext.end()) + return false; + return true; +} + +const std::vector< vcl::EnumContext::Context >& TabPage::GetContext() const +{ + return maContext; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |