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
65
66 static std::shared_ptr<QQtEmbeddedWindowNode> createOrFail(const CreateInfo &createInfo);
67
70 void setCallbackReceiver(std::unique_ptr<QXComponentCallbackReceiver> callbackReceiver);
71 void setSurfaceResolution(std::uint32_t width, std::uint32_t height);
72 void setAreaChangeReceiver(QOhosConsumer<AreaChangeEvent> areaChangeReceiver);
73 void setFocusedChangeReceiver(QOhosConsumer<bool> focus);
74 void setVisibilityChangeReceiver(QOhosConsumer<bool> visibilityChangedReceiver);
75 void setTouchInterceptReceiver(QOhosConsumer<const ::ArkUI_UIInputEvent *> touchInterceptReceiver);
79 bool hasNonQtManagedChildren() const;
80
82
83private:
84 QQtEmbeddedWindowNode(
85 std::unique_ptr<Node> stackNode,
86 std::unique_ptr<Node> xComponentNode,
87 std::unique_ptr<QtOhos::WindowIdStruct> windowId);
88
89 void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override;
90 void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow) override;
91 void onHoverEvent(bool isHover) override;
92
93 std::shared_ptr<void> m_xComponentCallbackDispatcherToken;
94 std::unique_ptr<QXComponentCallbackReceiver> m_callbackReceiver;
95 ::OHNativeWindow *m_nativeWindow = nullptr;
96 QOhosConsumer<AreaChangeEvent> m_optAreaChangedReceiver;
97 QOhosConsumer<bool> m_optFocusedChangedReceiver;
98 QOhosConsumer<bool> m_optVisibilityChangedReceiver;
99 QOhosConsumer<const ::ArkUI_UIInputEvent *> m_optTouchInterceptReceiver;
100};
101
102}
103
104QT_END_NAMESPACE
105
106#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 setSurfaceResolution(std::uint32_t width, std::uint32_t height)
void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override
static std::shared_ptr< QQtEmbeddedWindowNode > createOrFail(const CreateInfo &createInfo)
void setAreaChangeReceiver(QOhosConsumer< AreaChangeEvent > areaChangeReceiver)
void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *nativeWindow) override
::OHNativeWindow * nativeWindowOrNull() const
void setCallbackReceiver(std::unique_ptr< QXComponentCallbackReceiver > callbackReceiver)
QXComponentRender renderXComponent() const
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
std::enable_if_t< qohosplugincore_h_detail::isQOhosOptional< QOhosInvokeResult< Func, T > >, QOhosInvokeResult< Func, T > > andThen(Func &&func) const
Combined button and popup list for selecting options.
bool isNativeNodeApiMouseEventsEnabled()
bool isNativeNodeApiKeyEventsEnabled()
QXComponent< QXComponentType::Render > QXComponentRender
Definition qxcomponent.h:43
QOhosOptional< ParentDescriptor > optParent