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 <qarkui/qembeddedwindownode.h>
9#include <qohosplugincore.h>
10#include <QtCore/qpoint.h>
11
13
14namespace QArkUi {
15
17{
18public:
25
26 enum class InputEventType
27 {
31 };
32
33 virtual void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) = 0;
34 virtual void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow) = 0;
35 virtual void onHoverEvent(bool isHover) = 0;
37};
38
39class QQtEmbeddedWindowNode final
40 : public QEmbeddedWindowNode
42{
43public:
58
66
67 static std::shared_ptr<QQtEmbeddedWindowNode> createOrFail(const CreateInfo &createInfo);
68
71 void setCallbackReceiver(std::unique_ptr<QXComponentCallbackReceiver> callbackReceiver);
72 void setAreaChangeReceiver(QOhosConsumer<NodeAreaInfo> areaChangeReceiver);
73 void setFocusedChangeReceiver(QOhosConsumer<bool> focus);
74 void setVisibilityChangeReceiver(QOhosConsumer<bool> visibilityChangedReceiver);
75 void setTouchInterceptReceiver(QOhosConsumer<const ::ArkUI_UIInputEvent *> touchInterceptReceiver);
80 bool hasNonQtManagedChildren() const;
82
84
85private:
86 QQtEmbeddedWindowNode(
87 std::unique_ptr<Node> stackNode,
88 std::unique_ptr<Node> xComponentNode,
89 std::unique_ptr<QtOhos::WindowIdStruct> windowId);
90
91 void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override;
92 void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow) override;
93 void onHoverEvent(bool isHover) override;
94
95 std::shared_ptr<void> m_xComponentCallbackDispatcherToken;
96 std::unique_ptr<QXComponentCallbackReceiver> m_callbackReceiver;
97 ::OHNativeWindow *m_nativeWindow = nullptr;
98 QOhosConsumer<NodeAreaInfo> m_optAreaChangedReceiver;
99 QOhosConsumer<bool> m_optFocusedChangedReceiver;
100 QOhosConsumer<bool> m_optVisibilityChangedReceiver;
101 QOhosConsumer<const ::ArkUI_UIInputEvent *> m_optTouchInterceptReceiver;
102};
103
104}
105
106QT_END_NAMESPACE
107
108#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:43
QOhosOptional< ParentDescriptor > optParent