Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqtembeddedwindownode.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 QQTEMBEDDEDWINDOWNODE_H
5#define QQTEMBEDDEDWINDOWNODE_H
6
7#include <QtCore/qglobal.h>
8#include <optional>
9#include <qarkui/qembeddedwindownode.h>
10#include <qohosplugincore.h>
11#include <QtCore/qpoint.h>
12
14
15namespace QArkUi {
16
18{
19public:
26
27 enum class InputEventType
28 {
32 };
33
34 virtual void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) = 0;
35 virtual void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow) = 0;
36 virtual void onHoverEvent(bool isHover) = 0;
38};
39
40class QQtEmbeddedWindowNode final
41 : public QEmbeddedWindowNode
43{
44public:
59
67
68 static std::shared_ptr<QQtEmbeddedWindowNode> createOrFail(const CreateInfo &createInfo);
69
72 void setCallbackReceiver(std::unique_ptr<QXComponentCallbackReceiver> callbackReceiver);
73 void setAreaChangeReceiver(QOhosConsumer<NodeAreaInfo> areaChangeReceiver);
74 void setFocusedChangeReceiver(QOhosConsumer<bool> focus);
75 void setVisibilityChangeReceiver(QOhosConsumer<bool> visibilityChangedReceiver);
76 void setTouchInterceptReceiver(QOhosConsumer<const ::ArkUI_UIInputEvent *> touchInterceptReceiver);
81 bool hasNonQtManagedChildren() const;
83
85
86private:
87 QQtEmbeddedWindowNode(
88 std::unique_ptr<Node> stackNode,
89 std::unique_ptr<Node> xComponentNode,
90 std::unique_ptr<QtOhos::WindowIdStruct> windowId);
91
92 void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override;
93 void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow) override;
94 void onHoverEvent(bool isHover) override;
95
96 std::shared_ptr<void> m_xComponentCallbackDispatcherToken;
97 std::unique_ptr<QXComponentCallbackReceiver> m_callbackReceiver;
98 ::OHNativeWindow *m_nativeWindow = nullptr;
99 QOhosConsumer<NodeAreaInfo> m_optAreaChangedReceiver;
100 QOhosConsumer<bool> m_optFocusedChangedReceiver;
101 QOhosConsumer<bool> m_optVisibilityChangedReceiver;
102 QOhosConsumer<const ::ArkUI_UIInputEvent *> m_optTouchInterceptReceiver;
103};
104
105}
106
107QT_END_NAMESPACE
108
109#endif
static const std::int32_t minimumNodeZIndexValue
void setTouchInterceptReceiver(QOhosConsumer< const ::ArkUI_UIInputEvent * > touchInterceptReceiver)
void onHoverEvent(bool isHover) override
void setFocusedChangeReceiver(QOhosConsumer< bool > focus)
void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override
static std::shared_ptr< QQtEmbeddedWindowNode > createOrFail(const CreateInfo &createInfo)
void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow) override
::OHNativeWindow * nativeWindowOrNull() const
void setCallbackReceiver(std::unique_ptr< QXComponentCallbackReceiver > callbackReceiver)
QXComponentRender renderXComponent() const
void setAreaChangeReceiver(QOhosConsumer< NodeAreaInfo > areaChangeReceiver)
void setVisibilityChangeReceiver(QOhosConsumer< bool > visibilityChangedReceiver)
virtual void onHoverEvent(bool isHover)=0
virtual void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow)=0
virtual void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow)=0
Combined button and popup list for selecting options.
bool isNativeNodeApiMouseEventsEnabled()
bool isNativeNodeApiKeyEventsEnabled()
QXComponent< QXComponentType::Render > QXComponentRender
Definition qxcomponent.h:44
std::optional< ParentDescriptor > optParent