summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-19 16:40:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-25 22:10:21 +0200
commitb047ae6e5bde45555a20a9ad8b7d570d93496187 (patch)
treef8c13e7cb38b93f0cf2a86b2bde0519423fb628c /include
parent86d02e1fde746988adc17c9e8480ae9967c5a299 (diff)
weld SwWatermarkDialog
Change-Id: Iff3ddfb4dd75088e39ea7675b085f1bbde2c2045 Reviewed-on: https://gerrit.libreoffice.org/56247 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/svtools/toolbarmenu.hxx30
-rw-r--r--include/svtools/valueset.hxx4
-rw-r--r--include/svx/colorbox.hxx61
-rw-r--r--include/svx/colorwindow.hxx57
-rw-r--r--include/vcl/customweld.hxx2
-rw-r--r--include/vcl/menubtn.hxx2
-rw-r--r--include/vcl/virdev.hxx2
-rw-r--r--include/vcl/weld.hxx35
8 files changed, 166 insertions, 27 deletions
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
index 5372c719892e..352a7d6368d5 100644
--- a/include/svtools/toolbarmenu.hxx
+++ b/include/svtools/toolbarmenu.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVTOOLS_TOOLBARMENU_HXX
#include <svtools/svtdllapi.h>
+#include <svtools/framestatuslistener.hxx>
#include <com/sun/star/frame/FeatureStateEvent.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -36,17 +37,33 @@
#include <vcl/dockwin.hxx>
class ValueSet;
-namespace svt { class FrameStatusListener; }
namespace svtools {
class ToolbarMenuEntry;
struct ToolbarMenu_Impl;
-class SVT_DLLPUBLIC ToolbarPopup : public DockingWindow
+class SVT_DLLPUBLIC ToolbarPopupBase
{
friend class ToolbarPopupStatusListener;
public:
+ ToolbarPopupBase(const css::uno::Reference<css::frame::XFrame>& rFrame);
+ virtual ~ToolbarPopupBase();
+
+protected:
+ void AddStatusListener( const OUString& rCommandURL );
+
+ // Forwarded from XStatusListener (subclasses must override this one to get the status updates):
+ /// @throws css::uno::RuntimeException
+ virtual void statusChanged(const css::frame::FeatureStateEvent& Event );
+
+ css::uno::Reference<css::frame::XFrame> mxFrame;
+ rtl::Reference<svt::FrameStatusListener> mxStatusListener;
+};
+
+class SVT_DLLPUBLIC ToolbarPopup : public DockingWindow, public ToolbarPopupBase
+{
+public:
ToolbarPopup(const css::uno::Reference<css::frame::XFrame>& rFrame,
vcl::Window* pParentWindow,
WinBits nBits );
@@ -57,20 +74,11 @@ public:
virtual void dispose() override;
protected:
- void AddStatusListener( const OUString& rCommandURL );
-
bool IsInPopupMode();
void EndPopupMode();
- // Forwarded from XStatusListener (subclasses must override this one to get the status updates):
- /// @throws css::uno::RuntimeException
- virtual void statusChanged(const css::frame::FeatureStateEvent& Event );
-
- css::uno::Reference< css::frame::XFrame > mxFrame;
private:
void init();
-
- rtl::Reference< svt::FrameStatusListener > mxStatusListener;
};
class SVT_DLLPUBLIC ToolbarMenu : public ToolbarPopup
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index 2099fc518b42..0a0e2fd26ed1 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -527,6 +527,10 @@ public:
return !mbNoSelection && (nItemId == mnSelItemId);
}
void SetNoSelection();
+ bool IsNoSelection() const
+ {
+ return mbNoSelection;
+ }
Color GetItemColor( sal_uInt16 nItemId ) const;
OUString GetItemText( sal_uInt16 nItemId ) const;
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index 8ffbc12db77f..cb7c5e820128 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -12,10 +12,12 @@
#include <memory>
#include <vcl/menubtn.hxx>
+#include <vcl/weld.hxx>
#include <svx/colorwindow.hxx>
#include <sfx2/controlwrapper.hxx>
class SvxColorListBox;
+class ColorListBox;
class SvxListBoxColorWrapper
{
@@ -78,6 +80,65 @@ public:
DECL_LINK(WindowEventListener, VclWindowEvent&, void);
};
+class ListBoxColorWrapper
+{
+public:
+ ListBoxColorWrapper(ColorListBox* pControl);
+ void operator()(const OUString& rCommand, const NamedColor& rColor);
+ void dispose();
+private:
+ ColorListBox* mpControl;
+};
+
+class SVX_DLLPUBLIC ColorListBox
+{
+private:
+ friend class ListBoxColorWrapper;
+ std::unique_ptr<ColorWindow> m_xColorWindow;
+ std::unique_ptr<weld::MenuButton> m_xButton;
+ weld::Window* m_pTopLevel;
+ Link<ColorListBox&, void> m_aSelectedLink;
+ ListBoxColorWrapper m_aColorWrapper;
+ Color m_aAutoDisplayColor;
+ Color m_aSaveColor;
+ NamedColor m_aSelectedColor;
+ sal_uInt16 m_nSlotId;
+ bool m_bShowNoneButton;
+ std::shared_ptr<PaletteManager> m_xPaletteManager;
+ BorderColorStatus m_aBorderColorStatus;
+
+ void Selected(const NamedColor& rNamedColor);
+ void createColorWindow();
+ void LockWidthRequest();
+ ColorWindow* getColorWindow() const;
+public:
+ ColorListBox(weld::MenuButton* pControl, weld::Window* pWindow);
+ ~ColorListBox();
+
+ void SetSelectHdl(const Link<ColorListBox&, void>& rLink)
+ {
+ m_aSelectedLink = rLink;
+ }
+
+ void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false);
+
+ Color const & GetSelectEntryColor() const { return m_aSelectedColor.first; }
+ NamedColor const & GetSelectedEntry() const { return m_aSelectedColor; }
+
+ void SelectEntry(const NamedColor& rColor);
+ void SelectEntry(const Color& rColor);
+
+ void SetNoSelection() { getColorWindow()->SetNoSelection(); }
+ bool IsNoSelection() const { return getColorWindow()->IsNoSelection(); }
+
+ void SetAutoDisplayColor(const Color &rColor) { m_aAutoDisplayColor = rColor; }
+ void ShowPreview(const NamedColor &rColor);
+ void EnsurePaletteManager();
+
+ void SaveValue() { m_aSaveColor = GetSelectEntryColor(); }
+ bool IsValueChangedFromSaved() const { return m_aSaveColor != GetSelectEntryColor(); }
+};
+
/** A wrapper for SvxColorListBox. */
class SVX_DLLPUBLIC SvxColorListBoxWrapper
: public sfx::SingleControlWrapper<SvxColorListBox, Color>
diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx
index 16fb45da4ff3..118c69217aa8 100644
--- a/include/svx/colorwindow.hxx
+++ b/include/svx/colorwindow.hxx
@@ -109,6 +109,63 @@ public:
void SetSelectedHdl( const Link<const NamedColor&, void>& rLink ) { maSelectedLink = rLink; }
};
+class SVX_DLLPUBLIC ColorWindow : public svtools::ToolbarPopupBase
+{
+private:
+ std::unique_ptr<weld::Builder> m_xBuilder;
+
+ const sal_uInt16 theSlotId;
+ OUString maCommand;
+ weld::Window* mpParentWindow;
+ weld::MenuButton* mpMenuButton;
+ std::shared_ptr<PaletteManager> mxPaletteManager;
+ BorderColorStatus& mrBorderColorStatus;
+ ColorSelectFunction maColorSelectFunction;
+
+ std::unique_ptr<ColorValueSet> mxColorSet;
+ std::unique_ptr<ColorValueSet> mxRecentColorSet;
+ std::unique_ptr<weld::Container> mxTopLevel;
+ std::unique_ptr<weld::ComboBoxText> mxPaletteListBox;
+ std::unique_ptr<weld::Button> mxButtonAutoColor;
+ std::unique_ptr<weld::Button> mxButtonNoneColor;
+ std::unique_ptr<weld::Button> mxButtonPicker;
+ std::unique_ptr<weld::Widget> mxAutomaticSeparator;
+ std::unique_ptr<weld::CustomWeld> mxColorSetWin;
+ std::unique_ptr<weld::CustomWeld> mxRecentColorSetWin;
+
+ Link<const NamedColor&, void> maSelectedLink;
+ DECL_LINK(SelectHdl, SvtValueSet*, void);
+ DECL_LINK(SelectPaletteHdl, weld::ComboBoxText&, void);
+ DECL_LINK(AutoColorClickHdl, weld::Button&, void);
+ DECL_LINK(OpenPickerClickHdl, weld::Button&, void);
+
+ static bool SelectValueSetEntry(ColorValueSet* pColorSet, const Color& rColor);
+ static NamedColor GetSelectEntryColor(SvtValueSet const * pColorSet);
+ NamedColor GetAutoColor() const;
+
+public:
+ ColorWindow(const OUString& rCommand,
+ std::shared_ptr<PaletteManager> const & rPaletteManager,
+ BorderColorStatus& rBorderColorStatus,
+ sal_uInt16 nSlotId,
+ const css::uno::Reference< css::frame::XFrame >& rFrame,
+ weld::Window* pParentWindow, weld::MenuButton* pMenuButton,
+ ColorSelectFunction const& rColorSelectFunction);
+ weld::Container* GetWidget() { return mxTopLevel.get(); }
+ virtual ~ColorWindow() override;
+ void ShowNoneButton();
+ void StartSelection();
+ void SetNoSelection();
+ bool IsNoSelection() const;
+ void SelectEntry(const NamedColor& rColor);
+ void SelectEntry(const Color& rColor);
+ NamedColor GetSelectEntryColor() const;
+
+ virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
+
+ void SetSelectedHdl( const Link<const NamedColor&, void>& rLink ) { maSelectedLink = rLink; }
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index 622b20c256c5..c191b91ebf2b 100644
--- a/include/vcl/customweld.hxx
+++ b/include/vcl/customweld.hxx
@@ -61,6 +61,8 @@ public:
bool IsMouseCaptured() const { return m_pDrawingArea->has_grab(); }
void EnableRTL(bool bEnable) { m_pDrawingArea->set_direction(bEnable); }
void ReleaseMouse() { m_pDrawingArea->grab_remove(); }
+ void SetHelpId(const OString& rHelpId) { m_pDrawingArea->set_help_id(rHelpId); }
+ void SetAccessibleName(const OUString& rName) { m_pDrawingArea->set_accessible_name(rName); }
void set_size_request(int nWidth, int nHeight)
{
m_pDrawingArea->set_size_request(nWidth, nHeight);
diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx
index 99ddf2bdb1e2..b5c1e226a372 100644
--- a/include/vcl/menubtn.hxx
+++ b/include/vcl/menubtn.hxx
@@ -64,6 +64,8 @@ public:
virtual void Select();
void ExecuteMenu();
+ bool MenuShown() const;
+ void CancelMenu();
//if false then the whole button launches the menu
//if true, then the button has a separator
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index 98647fa4b766..06121aca050a 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -34,7 +34,7 @@ class VCL_DLLPUBLIC VirtualDevice : public OutputDevice
friend class Application;
friend class ::OutputDevice;
friend class Printer;
- friend cairo_surface_t* get_underlying_cairo_suface(VirtualDevice&);
+ friend cairo_surface_t* get_underlying_cairo_surface(VirtualDevice&);
public:
// reference device modes for different compatibility levels
enum class RefDevMode { NONE = 0,
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 07360e8a43e5..39ee0c867886 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -45,6 +45,8 @@ public:
virtual bool is_visible() const = 0; //if this widget visibility and all parents is true
virtual void grab_focus() = 0;
virtual bool has_focus() const = 0;
+ virtual void set_has_default(bool has_default) = 0;
+ virtual bool get_has_default() const = 0;
virtual void show() = 0;
virtual void hide() = 0;
void show(bool bShow)
@@ -364,27 +366,13 @@ protected:
public:
virtual void set_label(const OUString& rText) = 0;
+ virtual void set_image(VirtualDevice& rDevice) = 0;
virtual OUString get_label() const = 0;
void clicked() { signal_clicked(); }
void connect_clicked(const Link<Button&, void>& rLink) { m_aClickHdl = rLink; }
};
-class VCL_DLLPUBLIC MenuButton : virtual public Button
-{
-protected:
- Link<const OString&, void> m_aSelectHdl;
-
- void signal_selected(const OString& rIdent) { m_aSelectHdl.Call(rIdent); }
-
-public:
- void connect_selected(const Link<const OString&, void>& rLink) { m_aSelectHdl = rLink; }
- virtual void set_item_active(const OString& rIdent, bool bActive) = 0;
- virtual void set_item_label(const OString& rIdent, const OUString& rLabel) = 0;
- virtual void set_item_help_id(const OString& rIdent, const OString& rHelpId) = 0;
- virtual OString get_item_help_id(const OString& rIdent) const = 0;
-};
-
class VCL_DLLPUBLIC ToggleButton : virtual public Button
{
protected:
@@ -434,6 +422,23 @@ public:
virtual void connect_toggled(const Link<ToggleButton&, void>& rLink) { m_aToggleHdl = rLink; }
};
+class VCL_DLLPUBLIC MenuButton : virtual public ToggleButton
+{
+protected:
+ Link<const OString&, void> m_aSelectHdl;
+
+ void signal_selected(const OString& rIdent) { m_aSelectHdl.Call(rIdent); }
+
+public:
+ void connect_selected(const Link<const OString&, void>& rLink) { m_aSelectHdl = rLink; }
+ virtual void set_item_active(const OString& rIdent, bool bActive) = 0;
+ virtual void set_item_label(const OString& rIdent, const OUString& rLabel) = 0;
+ virtual void set_item_help_id(const OString& rIdent, const OString& rHelpId) = 0;
+ virtual OString get_item_help_id(const OString& rIdent) const = 0;
+
+ virtual void set_popover(weld::Widget* pPopover) = 0;
+};
+
class VCL_DLLPUBLIC CheckButton : virtual public ToggleButton
{
};