summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-09-17 23:35:55 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-09-24 15:37:28 +0300
commite867b197540cfc8b75bb1108c8bcd7a0ff65d347 (patch)
tree8dbcdc2d2db4b9f3fb0e302b5d8031386a75c346 /include
parent8bd418a6b8253a9d725981743a0375e2c8bb911e (diff)
tdf#106762 Base SvxColorToolBoxControl on svt::PopupWindowController
This allows us to support tearoff without breaking gtk3/wayland. SvxColorWindow no longer inherits from FloatingWindow, so several call sites need also to be changed to use DockingManager. Change-Id: I5d0bc611bbd2a8b9bfd4335212d0ae7e8fc10593
Diffstat (limited to 'include')
-rw-r--r--include/svtools/toolbarmenu.hxx5
-rw-r--r--include/svx/colorwindow.hxx3
-rw-r--r--include/svx/tbcontrl.hxx23
-rw-r--r--include/vcl/menubtn.hxx4
4 files changed, 27 insertions, 8 deletions
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
index 5f990ef0dcad..88174253548a 100644
--- a/include/svtools/toolbarmenu.hxx
+++ b/include/svtools/toolbarmenu.hxx
@@ -50,6 +50,9 @@ public:
ToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame,
vcl::Window* pParentWindow,
WinBits nBits );
+ ToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame,
+ vcl::Window* pParentWindow,
+ const OString& rID, const OUString& rUIXMLDescription );
virtual ~ToolbarPopup() override;
virtual void dispose() override;
@@ -64,6 +67,8 @@ protected:
virtual void statusChanged(const css::frame::FeatureStateEvent& Event );
private:
+ void init();
+
css::uno::Reference< css::frame::XFrame > mxFrame;
rtl::Reference< svt::FrameStatusListener > mxStatusListener;
};
diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx
index 3f826fa217e4..a782307df9fa 100644
--- a/include/svx/colorwindow.hxx
+++ b/include/svx/colorwindow.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_SOURCE_TBXCTRLS_COLORWINDOW_HXX
#include <sfx2/tbxctrl.hxx>
+#include <svtools/toolbarmenu.hxx>
#include <svtools/valueset.hxx>
#include <svl/lstner.hxx>
#include <rtl/ustring.hxx>
@@ -48,7 +49,7 @@ typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunct
#define COL_NONE_COLOR TRGB_COLORDATA(0x80, 0xFF, 0xFF, 0xFF)
-class SVX_DLLPUBLIC SvxColorWindow : public SfxPopupWindow
+class SVX_DLLPUBLIC SvxColorWindow : public svtools::ToolbarPopup
{
private:
const sal_uInt16 theSlotId;
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 22fd4e72910f..b9b8eb0db7b1 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -205,25 +205,34 @@ friend class SfxStyleControllerItem_Impl;
typedef std::function<void(const OUString&, const NamedColor&)> ColorSelectFunction;
-class SVX_DLLPUBLIC SvxColorToolBoxControl : public cppu::ImplInheritanceHelper< SfxToolBoxControl,
+class SVX_DLLPUBLIC SvxColorToolBoxControl : public cppu::ImplInheritanceHelper< svt::PopupWindowController,
css::frame::XSubToolbarController >
{
std::unique_ptr<svx::ToolboxButtonColorUpdater> m_xBtnUpdater;
std::unique_ptr<PaletteManager> m_xPaletteManager;
BorderColorStatus m_aBorderColorStatus;
bool m_bSplitButton;
+ sal_uInt16 m_nSlotId;
ColorSelectFunction m_aColorSelectFunction;
DECL_LINK(SelectedHdl, const NamedColor&, void);
public:
- SFX_DECL_TOOLBOX_CONTROL();
- SvxColorToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox);
+ explicit SvxColorToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext );
virtual ~SvxColorToolBoxControl() override;
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence<css::uno::Any>& rArguments ) override;
+
+ // XUpdatable
+ virtual void SAL_CALL update() override;
+
// XStatusListener
virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
- virtual VclPtr<SfxPopupWindow> CreatePopupWindow() override;
- virtual void Select(sal_uInt16 nSelectModifier) override;
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 nSelectModifier ) override;
+
+ using svt::ToolboxController::createPopupWindow;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) override;
// XSubToolbarController
virtual sal_Bool SAL_CALL opensSubToolbar() override;
@@ -231,6 +240,10 @@ public:
virtual void SAL_CALL functionSelected( const OUString& rCommand ) override;
virtual void SAL_CALL updateImage() override;
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
void setColorSelectFunction(const ColorSelectFunction& aColorSelectFunction);
void EnsurePaletteManager();
};
diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx
index da725103c1c7..dfbb39962139 100644
--- a/include/vcl/menubtn.hxx
+++ b/include/vcl/menubtn.hxx
@@ -36,7 +36,7 @@ private:
Timer* mpMenuTimer;
VclPtr<PopupMenu> mpMenu;
- VclPtr<FloatingWindow> mpFloatingWindow;
+ VclPtr<Window> mpFloatingWindow;
sal_uInt16 mnCurItemId;
bool mbDelayMenu;
Link<MenuButton*,void> maActivateHdl;
@@ -75,7 +75,7 @@ public:
void SetPopupMenu(PopupMenu* pNewMenu);
PopupMenu* GetPopupMenu() const { return mpMenu; }
- void SetPopover(FloatingWindow* pFloatingWindow);
+ void SetPopover(Window* pWindow);
sal_uInt16 GetCurItemId() const { return mnCurItemId; }
OString GetCurItemIdent() const;