From 74b5218b68469c29f93436b308e85a20140ce9dd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 5 Mar 2021 15:15:12 +0000 Subject: add a callback for when a container gains or loses focus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id8e8e59547280297db9140a840228f62b75593ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112021 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/vcl/weld.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 181b35631c97..a42dd09aad5d 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -324,6 +324,11 @@ public: class VCL_DLLPUBLIC Container : virtual public Widget { +protected: + Link m_aContainerFocusChangedHdl; + + void signal_container_focus_changed() { m_aContainerFocusChangedHdl.Call(*this); } + public: // remove and add in one go virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) = 0; @@ -332,6 +337,12 @@ public: // create an XWindow as a child of this container. The XWindow is // suitable to contain css::awt::XControl items virtual css::uno::Reference CreateChildFrame() = 0; + // rLink is called when the focus transitions from a widget outside the container + // to a widget inside the container or vice versa + virtual void connect_container_focus_changed(const Link& rLink) + { + m_aContainerFocusChangedHdl = rLink; + } }; class VCL_DLLPUBLIC Box : virtual public Container -- cgit