diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-03-20 21:18:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-22 14:20:43 +0100 |
commit | 7d0bd54bad1782f74c156aa667e875c33efee0c1 (patch) | |
tree | 929357474beb322c71dc13fec316bef940d67308 /include/sfx2/basedlgs.hxx | |
parent | f8efe7d63279900c7fd737cff5030dede870fac6 (diff) |
refactor into a shareable base class
Change-Id: I5eb1f2b6b7b2dbc3bc675845730cb3aef1cab5f0
Reviewed-on: https://gerrit.libreoffice.org/69528
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/sfx2/basedlgs.hxx')
-rw-r--r-- | include/sfx2/basedlgs.hxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 6b86abed0b01..893481e2d4d5 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -111,8 +111,21 @@ class SFX2_DLLPUBLIC SfxDialogController : public weld::GenericDialogController { private: DECL_DLLPRIVATE_STATIC_LINK(SfxDialogController, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*); + + DECL_DLLPRIVATE_LINK(FocusInHdl, weld::Widget&, void); + DECL_DLLPRIVATE_LINK(FocusOutHdl, weld::Widget&, void); + public: SfxDialogController(weld::Widget* pParent, const OUString& rUIFile, const OString& rDialogId); + // dialog gets focus + virtual void Activate() {} + // dialog loses focus + virtual void DeActivate() {} + + // when the dialog has an associated SfxChildWin, typically for Modeless interaction + virtual void ChildWinDispose() {} // called from the associated SfxChildWin dtor + virtual void Close() {} // called by the SfxChildWin when the dialog is closed + virtual void EndDialog(); // called by the SfxChildWin to close the dialog }; class SfxModelessDialog_Impl; @@ -126,8 +139,6 @@ class SFX2_DLLPUBLIC SfxModelessDialogController : public SfxDialogController void Init(SfxBindings *pBindinx, SfxChildWindow *pCW); - DECL_DLLPRIVATE_LINK(FocusInHdl, weld::Widget&, void); - DECL_DLLPRIVATE_LINK(FocusOutHdl, weld::Widget&, void); protected: SfxModelessDialogController(SfxBindings*, SfxChildWindow* pChildWin, weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID); @@ -135,11 +146,13 @@ protected: public: void FillInfo(SfxChildWinInfo&) const; - virtual void Activate() {} void Initialize (SfxChildWinInfo const * pInfo); - void Close(); void DeInit(); - void EndDialog(); + virtual void Close() override; + virtual void EndDialog() override; + virtual void Activate() override; + virtual void DeActivate() override; + virtual void ChildWinDispose() override; SfxBindings& GetBindings() { return *m_pBindings; } }; |