diff options
Diffstat (limited to 'include/vcl/weld.hxx')
-rw-r--r-- | include/vcl/weld.hxx | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 951b591f654b..2d94323d6434 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -591,6 +591,12 @@ class VCL_DLLPUBLIC ComboBox : virtual public Container private: OUString m_sSavedValue; +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; + protected: Link<ComboBox&, void> m_aChangeHdl; Link<ComboBox&, void> m_aPopupToggledHdl; @@ -600,6 +606,21 @@ protected: void signal_changed() { m_aChangeHdl.Call(*this); } virtual void signal_popup_toggled() { m_aPopupToggledHdl.Call(*this); } + Link<render_args, void> m_aRenderHdl; + void signal_custom_render(vcl::RenderContext& rDevice, const tools::Rectangle& rRect, + bool bSelected, const OUString& rId) + { + m_aRenderHdl.Call( + std::tuple<vcl::RenderContext&, const tools::Rectangle, bool, const OUString&>( + 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)); + } + public: virtual void insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) @@ -694,6 +715,20 @@ public: void save_value() { m_sSavedValue = get_active_text(); } OUString const& get_saved_value() const { return m_sSavedValue; } 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_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; + + // for mru support + virtual int get_max_mru_count() const = 0; + virtual void set_max_mru_count(int nCount) = 0; + virtual OUString get_mru_entries() const = 0; + virtual void set_mru_entries(const OUString& rEntries) = 0; }; class VCL_DLLPUBLIC TreeIter @@ -734,6 +769,7 @@ protected: std::function<int(const weld::TreeIter&, const weld::TreeIter&)> m_aCustomSort; 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; @@ -1094,9 +1130,10 @@ public: bool get_value_changed_from_saved() const { return m_sSavedValue != get_selected_text(); } // for custom rendering a cell - virtual void set_column_custom_renderer(int nColumn) = 0; void connect_custom_get_size(const Link<get_size_args, Size>& rLink) { m_aGetSizeHdl = rLink; } void connect_custom_render(const Link<render_args, void>& rLink) { m_aRenderHdl = rLink; } + // call set_column_custom_renderer after setting custom callbacks + virtual void set_column_custom_renderer(int nColumn) = 0; // for dnd virtual bool get_dest_row_at_pos(const Point& rPos, weld::TreeIter* pResult) = 0; |