diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-05 15:15:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-05 21:25:35 +0100 |
commit | 74b5218b68469c29f93436b308e85a20140ce9dd (patch) | |
tree | a6001a0887bf1a3ab7664ba27b125bc60107e83f /include | |
parent | 37673f115fb3f8afb85fb0b5a2713ec9c1497771 (diff) |
add a callback for when a container gains or loses focus
Change-Id: Id8e8e59547280297db9140a840228f62b75593ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112021
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/weld.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
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<Container&, void> 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<css::awt::XWindow> 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<Container&, void>& rLink) + { + m_aContainerFocusChangedHdl = rLink; + } }; class VCL_DLLPUBLIC Box : virtual public Container |