diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-22 17:08:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-04-24 17:48:00 +0200 |
commit | 16309a9516c1f173056fc103c6428e74217c7927 (patch) | |
tree | a9c469560345db2047857836cb708971112471a3 /include | |
parent | 1d23ff22c112f5b2bac23d9329a72c399007bf98 (diff) |
weld StylesPropertyPanel
and SvxStyleToolBoxControl, etc.
use a GtkOverlay to support the submenu hackery in the Style
wysiwyg combobox dropdown
Change-Id: I17baa56f382243070ee49e6d707e97324e4f4d67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85720
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/ctrlbox.hxx | 2 | ||||
-rw-r--r-- | include/svx/tbcontrl.hxx | 24 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 19 |
3 files changed, 26 insertions, 19 deletions
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 4ecff16ec1ef..8cdb5efd1fed 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -339,7 +339,7 @@ private: SVT_DLLPRIVATE void ImplDestroyFontList(); DECL_LINK(CustomRenderHdl, weld::ComboBox::render_args, void); - DECL_STATIC_LINK(FontNameBox, CustomGetSizeHdl, weld::ComboBox::get_size_args, Size); + DECL_STATIC_LINK(FontNameBox, CustomGetSizeHdl, OutputDevice&, Size); DECL_LINK(UpdateHdl, Timer*, void); void LoadMRUEntries( const OUString& aFontMRUEntriesFile ); diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index 0c7da003291f..387c67f4bdb3 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -146,7 +146,6 @@ class SvxFontItem; class SfxStyleControllerItem_Impl; class SfxStyleSheetBasePool; class SfxTemplateItem; -class SvxStyleBox_Impl; class PaletteManager; namespace svx @@ -154,25 +153,22 @@ namespace svx class ToolboxButtonColorUpdaterBase; } -class SVXCORE_DLLPUBLIC SvxStyleToolBoxControl final : public SfxToolBoxControl +class SVXCORE_DLLPUBLIC SvxStyleToolBoxControl final : public cppu::ImplInheritanceHelper<svt::ToolboxController, + css::lang::XServiceInfo> { struct Impl; std::unique_ptr<Impl> pImpl; public: - SFX_DECL_TOOLBOX_CONTROL(); - - SvxStyleToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox); + SvxStyleToolBoxControl(); virtual ~SvxStyleToolBoxControl() override; - virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) override; - - virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, - const SfxPoolItem* pState) override; + // XStatusListener + virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override; - DECL_LINK( VisibilityNotification, SvxStyleBox_Impl&, void ); + // XToolbarController + virtual css::uno::Reference<css::awt::XWindow> SAL_CALL createItemWindow(const css::uno::Reference<css::awt::XWindow>& rParent) override; -private: // XInitialization virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& aArguments) override; @@ -182,6 +178,12 @@ private: // XComponent virtual void SAL_CALL dispose() override; + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override; + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; + +private: #define MAX_FAMILIES 5 SfxStyleSheetBasePool* pStyleSheetPool; diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 2d94323d6434..d059e9cd455d 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -585,6 +585,8 @@ enum class EntryMessageType Error, }; +class Menu; + /// A widget used to choose from a list of items. class VCL_DLLPUBLIC ComboBox : virtual public Container { @@ -593,7 +595,6 @@ private: public: // OUString is the id of the row, it may be null to measure the height of a generic line - typedef std::pair<vcl::RenderContext&, const OUString&> get_size_args; typedef std::tuple<vcl::RenderContext&, const tools::Rectangle&, bool, const OUString&> render_args; @@ -615,11 +616,8 @@ protected: rDevice, rRect, bSelected, rId)); } - Link<get_size_args, Size> m_aGetSizeHdl; - Size signal_custom_get_size(vcl::RenderContext& rDevice, const OUString& rId) - { - return m_aGetSizeHdl.Call(std::pair<vcl::RenderContext&, const OUString&>(rDevice, rId)); - } + Link<vcl::RenderContext&, Size> m_aGetSizeHdl; + Size signal_custom_get_size(vcl::RenderContext& rDevice) { return m_aGetSizeHdl.Call(rDevice); } public: virtual void insert(int pos, const OUString& rStr, const OUString* pId, @@ -717,12 +715,19 @@ public: bool get_value_changed_from_saved() const { return m_sSavedValue != get_active_text(); } // for custom rendering a row - void connect_custom_get_size(const Link<get_size_args, Size>& rLink) { m_aGetSizeHdl = rLink; } + void connect_custom_get_size(const Link<vcl::RenderContext&, Size>& rLink) + { + m_aGetSizeHdl = rLink; + } void connect_custom_render(const Link<render_args, void>& rLink) { m_aRenderHdl = rLink; } // call set_custom_renderer after setting custom callbacks virtual void set_custom_renderer() = 0; // create a virtual device compatible with the device passed in render_args wrt alpha virtual VclPtr<VirtualDevice> create_render_virtual_device() const = 0; + // set a sub menu for a entry, only works with custom rendering + virtual void set_item_menu(const OString& rIdent, weld::Menu* pMenu) = 0; + // get the width needed to show the menu launcher in a custom row + virtual int get_menu_button_width() const = 0; // for mru support virtual int get_max_mru_count() const = 0; |