Ocean
WxScopedParentWindow.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
*
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
#ifndef META_OCEAN_PLATFORM_WXWIDGETS_WX_SCOPED_PARENT_WINDOW_H
9
#define META_OCEAN_PLATFORM_WXWIDGETS_WX_SCOPED_PARENT_WINDOW_H
10
11
#include "
ocean/platform/wxwidgets/WxWidgets.h
"
12
13
namespace
Ocean
14
{
15
16
namespace
Platform
17
{
18
19
namespace
WxWidgets
20
{
21
22
/**
23
* This class implements a parent window taking on an already existing window handle as long as the instance of the scoped window exists.
24
* @ingroup platformwxwidgets
25
*/
26
class
OCEAN_PLATFORM_WXWIDGETS_EXPORT
WxScopedParentWindow
27
{
28
public
:
29
30
/**
31
* Creates a new scoped window.
32
*/
33
WxScopedParentWindow
();
34
35
/**
36
* Creates a new scoped window.
37
* @param handle The handle of an already existing window which will be taken over as long as the scoped window exists, may be nullptr which is then equivalent to the default constructor
38
*/
39
explicit
WxScopedParentWindow
(OCEAN_WXWIDGETS_HANDLE handle);
40
41
/**
42
* Move constructor.
43
* @param window Window to move
44
*/
45
WxScopedParentWindow
(
WxScopedParentWindow
&& window) noexcept;
46
47
/**
48
* Destructs a scoped window object and gives the external window handle back.
49
*/
50
~WxScopedParentWindow
();
51
52
/**
53
* Explicitly releases the internal window and gives the external window handle back.
54
* Use this function to release the internal handle before the scope finishes.
55
*/
56
void
release
();
57
58
/**
59
* Move operator.
60
* @param window Window to move
61
* @return Reference to this object
62
*/
63
WxScopedParentWindow
&
operator=
(
WxScopedParentWindow
&& window) noexcept;
64
65
/**
66
* Dereferencing operator providing access to the internal window object.
67
* Beware: Ensure that this object has not been released before!
68
* @return The internal window object
69
* @see release().
70
*/
71
wxWindow
&
operator*
()
const
;
72
73
protected
:
74
75
/**
76
* Disabled copy constructor.
77
*/
78
WxScopedParentWindow
(
const
WxScopedParentWindow
&) =
delete
;
79
80
/**
81
* Disabled assign operator.
82
* @return Reference to this object
83
*/
84
WxScopedParentWindow
&
operator=
(
const
WxScopedParentWindow
&) =
delete
;
85
86
protected
:
87
88
/// True, if the internal window is associated.
89
bool
assocated_ =
false
;
90
91
/// The internal window object.
92
wxWindow
* window_ =
nullptr
;
93
};
94
95
}
96
97
}
98
99
}
100
101
#endif
// META_OCEAN_PLATFORM_WXWIDGETS_WX_SCOPED_PARENT_WINDOW_H
WxWidgets.h
Ocean::Platform::WxWidgets::WxScopedParentWindow
This class implements a parent window taking on an already existing window handle as long as the inst...
Definition:
WxScopedParentWindow.h:27
Ocean::Platform::WxWidgets::WxScopedParentWindow::operator=
WxScopedParentWindow & operator=(WxScopedParentWindow &&window) noexcept
Move operator.
Ocean::Platform::WxWidgets::WxScopedParentWindow::WxScopedParentWindow
WxScopedParentWindow()
Creates a new scoped window.
Ocean::Platform::WxWidgets::WxScopedParentWindow::WxScopedParentWindow
WxScopedParentWindow(OCEAN_WXWIDGETS_HANDLE handle)
Creates a new scoped window.
Ocean::Platform::WxWidgets::WxScopedParentWindow::WxScopedParentWindow
WxScopedParentWindow(WxScopedParentWindow &&window) noexcept
Move constructor.
Ocean::Platform::WxWidgets::WxScopedParentWindow::~WxScopedParentWindow
~WxScopedParentWindow()
Destructs a scoped window object and gives the external window handle back.
Ocean::Platform::WxWidgets::WxScopedParentWindow::operator*
wxWindow & operator*() const
Dereferencing operator providing access to the internal window object.
Ocean::Platform::WxWidgets::WxScopedParentWindow::operator=
WxScopedParentWindow & operator=(const WxScopedParentWindow &)=delete
Disabled assign operator.
Ocean::Platform::WxWidgets::WxScopedParentWindow::WxScopedParentWindow
WxScopedParentWindow(const WxScopedParentWindow &)=delete
Disabled copy constructor.
Ocean::Platform::WxWidgets::WxScopedParentWindow::release
void release()
Explicitly releases the internal window and gives the external window handle back.
wxWindow
Ocean
The namespace covering the entire Ocean framework.
Definition:
Accessor.h:15
impl
ocean
platform
wxwidgets
WxScopedParentWindow.h
Generated on Thu Nov 14 2024 06:04:24 for Ocean by
1.9.1