From dbb4df8568726173f69297611936976ff354c2cf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 30 Apr 2018 14:43:29 +0100 Subject: weld ScShowTabDlg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ice5da193d0efbf8e4a61d68c0fcef90f6c6d8e78 Reviewed-on: https://gerrit.libreoffice.org/53665 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/vcl/weld.hxx | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 77f985965c90..702b0cf415c7 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -266,7 +266,6 @@ protected: Link m_aRowActivatedHdl; void signal_changed() { m_aChangeHdl.Call(*this); } - void signal_row_activated() { m_aRowActivatedHdl.Call(*this); } public: @@ -278,19 +277,9 @@ public: { insert(-1, rId, rStr, rImage); } + virtual int n_children() const = 0; - virtual void select(int pos) = 0; - virtual void remove(int pos) = 0; - virtual int find(const OUString& rText) const = 0; - virtual int find_id(const OUString& rId) const = 0; - virtual void set_top_entry(int pos) = 0; virtual void clear() = 0; - virtual OUString get_selected() const = 0; - virtual std::vector get_selected_rows() const = 0; - OUString get_selected_id() const { return get_id(get_selected_index()); } - virtual int get_selected_index() const = 0; - virtual OUString get(int pos) const = 0; - virtual OUString get_id(int pos) const = 0; virtual int get_height_rows(int nRows) const = 0; virtual void freeze() = 0; @@ -300,13 +289,36 @@ public: virtual int count_selected_rows() const = 0; void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } - void connect_row_activated(const Link& rLink) { m_aRowActivatedHdl = rLink; } - void select(const OUString& rText) { select(find(rText)); } - void select_id(const OUString& rId) { select(find_id(rId)); } + //by index + virtual int get_selected_index() const = 0; + virtual void select(int pos) = 0; + virtual void remove(int pos) = 0; + virtual void set_top_entry(int pos) = 0; + virtual std::vector get_selected_rows() const = 0; - void remove(const OUString& rText) { remove(find(rText)); } + //by text + virtual OUString get(int pos) const = 0; + virtual int find(const OUString& rText) const = 0; + OUString get_selected_text() const { return get(get_selected_index()); } + void select_text(const OUString& rText) { select(find(rText)); } + void remove_text(const OUString& rText) { remove(find(rText)); } + std::vector get_selected_rows_text() const + { + std::vector aRows(get_selected_rows()); + std::vector aRet; + aRet.reserve(aRows.size()); + for (auto a : aRows) + aRet.push_back(get(a)); + return aRet; + } + + //by id + virtual OUString get_id(int pos) const = 0; + virtual int find_id(const OUString& rId) const = 0; + OUString get_selected_id() const { return get_id(get_selected_index()); } + void select_id(const OUString& rId) { select(find_id(rId)); } }; class VCL_DLLPUBLIC Button : virtual public Container -- cgit