Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
window.h
Go to the documentation of this file.
1
// Copyright (C) 2025 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
ifndef
QARKUI__WINDOW_H
5
#
define
QARKUI__WINDOW_H
6
7
#
include
<
QtCore
/
private
/
qcore_ohos_p
.
h
>
8
#
include
<
QtCore
/
private
/
qnapi_p
.
h
>
9
#
include
<
QtCore
/
private
/
qohoscommon_p
.
h
>
10
#
include
<
QtCore
/
qglobal
.
h
>
11
#
include
<
QtCore
/
qrect
.
h
>
12
#
include
<
optional
>
13
#
include
<
qohosdisplayinfo
.
h
>
14
#
include
<
qohosutils
.
h
>
15
#
include
<
string
>
16
#
include
<
vector
>
17
18
QT_BEGIN_NAMESPACE
19
20
namespace
QArkUi
{
21
22
using
JsWindowId
=
QtOhos
::
TypedId
<
double
,
struct
JsWindowIdTag>;
23
24
struct
WindowProperties
25
{
26
QRect
windowRect
;
27
QRect
drawableRect
;
28
JsWindowId
id
;
29
std
::optional<
QOhosDisplayInfo
::JsDisplayId>
displayId
;
30
};
31
32
std
::optional<
WindowProperties
>
tryGetWindowProperties
(JsWindowId jsWindowId);
33
34
class
JsWindowRef
35
{
36
public
:
37
explicit
JsWindowRef
(
38
std
::string owningQAbilityInstanceId, JsWindowId windowId,
39
QNapi::Object jsWindow, QtOhos::QObjectThreadSafeRef owningQWindowRef);
40
41
JsWindowRef
(
const
JsWindowRef
&) =
delete
;
42
JsWindowRef
&
operator
=(
const
JsWindowRef
&) =
delete
;
43
44
JsWindowRef
(
JsWindowRef
&&) =
delete
;
45
JsWindowRef
&
operator
=(
JsWindowRef
&&) =
delete
;
46
47
bool
isFocused
()
const
;
48
bool
isWindowShown
()
const
;
49
const
std
::string &
owningQAbilityInstanceId
()
const
;
50
JsWindowId
id
()
const
;
51
QtOhos
::
QObjectThreadSafeRef
owningQWindowRef
()
const
;
52
53
template
<
typename
Result =
QNapi
::
Value
>
54
Result
eval
(
const
std
::string &expr,
const
std::vector<QNapi::ValueWrapper> &exprArgs = {})
const
;
55
56
QNapi
::
Promise
evalToPromiseOrRejectOnThrow
(
57
const
std
::string &expr,
const
std::vector<QNapi::ValueWrapper> &exprArgs = {})
const
;
58
59
QNapi
::
Object
jsObject
();
60
61
private
:
62
std
::string m_owningQAbilityInstanceId;
63
JsWindowId m_jsWindowId;
64
QNapi::Reference<QNapi::Object> m_jsWindow;
65
QtOhos::QObjectThreadSafeRef m_owningQWindowRef;
66
};
67
68
template
<
typename
Result>
69
Result
JsWindowRef
::
eval
(
const
std
::string &expr,
const
std::vector<QNapi::ValueWrapper> &exprArgs)
const
70
{
71
return
m_jsWindow.eval<Result>(expr, exprArgs);
72
}
73
74
inline
QNapi
::
Promise
JsWindowRef
::
evalToPromiseOrRejectOnThrow
(
75
const
std
::string &expr,
const
std::vector<QNapi::ValueWrapper> &exprArgs)
const
76
{
77
return
m_jsWindow.evalToPromiseOrRejectOnThrow(expr, exprArgs);
78
}
79
80
}
81
82
QT_END_NAMESPACE
83
84
#
endif
QArkUi::JsWindowRef
Definition
window.h:35
QArkUi::JsWindowRef::jsObject
QNapi::Object jsObject()
Definition
window.cpp:91
QArkUi::JsWindowRef::JsWindowRef
JsWindowRef(JsWindowRef &&)=delete
QArkUi::JsWindowRef::JsWindowRef
JsWindowRef(std::string owningQAbilityInstanceId, JsWindowId windowId, QNapi::Object jsWindow, QtOhos::QObjectThreadSafeRef owningQWindowRef)
Definition
window.cpp:46
QArkUi::JsWindowRef::isFocused
bool isFocused() const
Definition
window.cpp:69
QArkUi::JsWindowRef::JsWindowRef
JsWindowRef(const JsWindowRef &)=delete
QArkUi::JsWindowRef::owningQWindowRef
QtOhos::QObjectThreadSafeRef owningQWindowRef() const
Definition
window.cpp:86
QArkUi::JsWindowRef::operator=
JsWindowRef & operator=(JsWindowRef &&)=delete
QArkUi::JsWindowRef::eval
Result eval(const std::string &expr, const std::vector< QNapi::ValueWrapper > &exprArgs={}) const
Definition
window.h:69
QArkUi::JsWindowRef::isWindowShown
bool isWindowShown() const
Definition
window.cpp:56
QArkUi::JsWindowRef::id
JsWindowId id() const
Definition
window.cpp:81
QArkUi::JsWindowRef::operator=
JsWindowRef & operator=(const JsWindowRef &)=delete
QArkUi::JsWindowRef::owningQAbilityInstanceId
const std::string & owningQAbilityInstanceId() const
Definition
window.cpp:76
QArkUi::JsWindowRef::evalToPromiseOrRejectOnThrow
QNapi::Promise evalToPromiseOrRejectOnThrow(const std::string &expr, const std::vector< QNapi::ValueWrapper > &exprArgs={}) const
Definition
window.h:74
QArkUi
Definition
displaymanager.cpp:17
QArkUi::tryGetWindowProperties
std::optional< WindowProperties > tryGetWindowProperties(JsWindowId jsWindowId)
Definition
window.cpp:28
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
QArkUi::WindowProperties
Definition
window.h:25
QArkUi::WindowProperties::id
JsWindowId id
Definition
window.h:28
QArkUi::WindowProperties::displayId
std::optional< QOhosDisplayInfo::JsDisplayId > displayId
Definition
window.h:29
QArkUi::WindowProperties::drawableRect
QRect drawableRect
Definition
window.h:27
QArkUi::WindowProperties::windowRect
QRect windowRect
Definition
window.h:26
QOhosDisplayInfo
Definition
qohosdisplayinfo.h:20
qtbase
src
plugins
platforms
ohos
qarkui
window.h
Generated on
for Qt by
1.18.0