diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-02-19 14:58:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-02-19 18:11:15 +0100 |
commit | 40496a1910c2fc453f010b0492a79aa62afbbc75 (patch) | |
tree | 0eb21a9603540ff481540937fba71600b73cb331 /include | |
parent | 58a8289afb507603c6ec00594ffd7fffd859b6be (diff) |
forward declare VclBuilder in VclBuilderContainer
so we can hide it as a detail
Change-Id: I8ab9097c04a16684ee89a92713ef5975d83b76bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111225
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/builder.hxx | 45 | ||||
-rw-r--r-- | include/vcl/dockwin.hxx | 1 | ||||
-rw-r--r-- | include/vcl/notebookbar/notebookbar.hxx | 2 | ||||
-rw-r--r-- | include/vcl/syswin.hxx | 33 |
4 files changed, 33 insertions, 48 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 1fe1ef85f243..c7d7f645532c 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -438,51 +438,6 @@ inline T* VclBuilder::get(const OString& sID) return static_cast<T*>(w); } - -//helper baseclass to ease retro fitting dialogs/tabpages that load a resource -//to load a .ui file instead -// -//vcl requires the Window Children of a Parent Window to be destroyed before -//the Parent Window. VclBuilderContainer owns the VclBuilder which owns the -//Children Window. So the VclBuilderContainer dtor must be called before -//the Parent Window dtor. -// -//i.e. class Dialog : public SystemWindow, public VclBuilderContainer -//not class Dialog : public VclBuilderContainer, public SystemWindow -// -//With the new 'dispose' framework, it is necessary to force the builder -//dispose before the Window dispose; so a Dialog::dispose() method would -//finish: disposeBuilder(); SystemWindow::dispose() to capture this ordering. - -class VCL_DLLPUBLIC VclBuilderContainer -{ -public: - VclBuilderContainer(); - virtual ~VclBuilderContainer(); - void disposeBuilder(); - - template <typename T> T* get(VclPtr<T>& ret, const OString& sID) - { - return m_pUIBuilder->get<T>(ret, sID); - } - template <typename T = vcl::Window> T* get(const OString & sID) - { - return m_pUIBuilder->get<T>(sID); - } - void setDeferredProperties() - { - if (!m_pUIBuilder) - return; - m_pUIBuilder->setDeferredProperties(); - } - -protected: - std::unique_ptr<VclBuilder> m_pUIBuilder; - - friend class ::SalInstanceBuilder; - friend class ::ScreenshotTest; -}; - /* * @return true if rValue is "True", "true", "1", etc. */ diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx index 0dd5988c23e7..b52091f0c642 100644 --- a/include/vcl/dockwin.hxx +++ b/include/vcl/dockwin.hxx @@ -22,7 +22,6 @@ #include <vcl/dllapi.h> #include <o3tl/deleter.hxx> -#include <vcl/builder.hxx> #include <vcl/floatwin.hxx> #include <memory> #include <vector> diff --git a/include/vcl/notebookbar/notebookbar.hxx b/include/vcl/notebookbar/notebookbar.hxx index 4e5c24631eb0..635bea058f2a 100644 --- a/include/vcl/notebookbar/notebookbar.hxx +++ b/include/vcl/notebookbar/notebookbar.hxx @@ -9,7 +9,7 @@ #pragma once -#include <vcl/builder.hxx> +#include <vcl/syswin.hxx> #include <vcl/ctrl.hxx> #include <vcl/notebookbar/NotebookBarAddonsMerger.hxx> #include <vcl/settings.hxx> diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx index 6238e9f382ca..1551f32e5389 100644 --- a/include/vcl/syswin.hxx +++ b/include/vcl/syswin.hxx @@ -21,7 +21,6 @@ #define INCLUDED_VCL_SYSWIN_HXX #include <vcl/dllapi.h> -#include <vcl/builder.hxx> #include <vcl/idle.hxx> #include <vcl/vclenum.hxx> #include <vcl/window.hxx> @@ -32,6 +31,7 @@ class MenuBar; class NotebookBar; class TaskPaneList; +class VclBuilder; #define ICON_LO_DEFAULT 1 #define ICON_TEXT_DOCUMENT 2 @@ -55,6 +55,37 @@ enum class TitleButton Menu = 4, }; +//helper baseclass to ease retro fitting dialogs/tabpages that load a resource +//to load a .ui file instead +// +//vcl requires the Window Children of a Parent Window to be destroyed before +//the Parent Window. VclBuilderContainer owns the VclBuilder which owns the +//Children Window. So the VclBuilderContainer dtor must be called before +//the Parent Window dtor. +// +//i.e. class Dialog : public SystemWindow, public VclBuilderContainer +//not class Dialog : public VclBuilderContainer, public SystemWindow +// +//With the new 'dispose' framework, it is necessary to force the builder +//dispose before the Window dispose; so a Dialog::dispose() method would +//finish: disposeBuilder(); SystemWindow::dispose() to capture this ordering. + +class VCL_DLLPUBLIC VclBuilderContainer +{ +public: + VclBuilderContainer(); + virtual ~VclBuilderContainer(); + void disposeBuilder(); + + void setDeferredProperties(); + +protected: + std::unique_ptr<VclBuilder> m_pUIBuilder; + + friend class ::SalInstanceBuilder; + friend class ::ScreenshotTest; +}; + class VCL_DLLPUBLIC SystemWindow : public vcl::Window , public VclBuilderContainer |