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
qembeddedwindownode.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 QEMBEDDEDWINDOWNODE_H
5#define QEMBEDDEDWINDOWNODE_H
6
7#include <QtCore/private/qohoscommon_p.h>
8#include <QtCore/qglobal.h>
9#include <QtCore/qrect.h>
10#include <qohosplatformwindowidstruct_hack_p.h>
11#include <arkui/drag_and_drop.h>
12#include <arkui/native_gesture.h>
13#include <arkui/native_node.h>
14#include <arkui/native_type.h>
15#include <arkui/ui_input_event.h>
16#include <cstdint>
17#include <functional>
18#include <memory>
19#include <native_window/external_window.h>
20#include <qarkui/input.h>
21#include <qarkui/qnativenodeapi.h>
22#include <qohosplugincore.h>
23#include <qohosudmf.h>
24#include <render/qxcomponent.h>
25#include <vector>
26
28
29namespace QArkUi {
30
41
43{
44public:
46 {
47 public:
54 explicit ParentDescriptor(std::shared_ptr<QXComponentNode> node);
55
58
61
62 Type type() const;
64 std::shared_ptr<QXComponentNode> xComponentNodeOrNull() const;
65 bool operator==(const ParentDescriptor &) const;
66
67 private:
68 Type m_type;
69 QOhosOptional<std::weak_ptr<QEmbeddedWindowNode>> m_embeddedWindowNode;
70 QOhosOptional<std::weak_ptr<QXComponentNode>> m_xComponentNode;
71 };
72
74
75 enum class SizePolicy
76 {
79 };
80
82 std::unique_ptr<Node> stack,
83 std::unique_ptr<Node> contentNode,
84 std::unique_ptr<QtOhos::WindowIdStruct> windowId);
85
88
91
92 void setNodeVisibility(bool visible);
93 void setSize(const QSizeF &size);
94 void setSizeParentFillPercentageNormalized(const QSizeF &size);
95 void setPosition(const QPointF &position);
96 void setFocused(bool focused);
97 void setFocusable(bool focusable);
98 void setBackgroundColor(const QColor &color);
99 void setBrightness(int brightness);
100 void setContrast(int contrast);
101 void setSaturation(int saturation);
102 void setGesturesHandler(QOhosConsumer<const NativeGestureInfo &> gesturesHandler);
103 void setHitTestMode(::ArkUI_HitTestMode hitTestMode);
104 void setDragEventsHandler(QOhosConsumer<::ArkUI_NodeEvent *> dragEventsHandler);
105 void setKeyEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent *> keyEventsHandler);
106 void setHoverEventsHandler(QOhosConsumer<NativeNodeHoverEvent> hoverEventsHandler);
107 void setAxisEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent *> axisEventsHandler);
108 void setMouseEventsHandler(QOhosConsumer<NativeNodeMouseEvent> mouseEventsHandler);
109 void setCoastingAxisEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent *> coastingAxisEventsHandler);
110 std::shared_ptr<void> startDrag(
111 std::vector<std::shared_ptr<::OH_PixelmapNative>> pixelMaps, const QPointF &hotspot,
112 QOhosUdmfData udmfData, std::function<void(::ArkUI_DragAndDropInfo *)> statusListener);
113
114 void raise();
115 void lower();
116
117 void *qtWindowId();
118
121 void handleGestureEvent(const NativeGestureInfo &nativeGestureInfo) const;
122
124
125protected:
126 Node &contentNode();
127 const Node &contentNode() const;
128 Node &stackNode();
129 const Node &stackNode() const;
130
131private:
132 void setContentNodeEventHandler(
133 ::ArkUI_NodeEventType eventType, const char *eventTypeName,
134 QOhosConsumer<::ArkUI_UIInputEvent *> inputEventsHandler);
135
136 std::unique_ptr<Node> m_stackNode;
137 std::unique_ptr<Node> m_contentNode;
138 std::shared_ptr<void> m_nodeEventDispatcherToken;
139 QOhosOptional<ParentDescriptor> m_parentDescriptor;
140 std::unique_ptr<QtOhos::WindowIdStruct> m_windowIdStruct;
141 std::shared_ptr<void> m_nativeNodeDispatcherHandle;
142 QOhosConsumer<const NativeGestureInfo &> m_gesturesHandler;
143};
144
145}
146
147QT_END_NAMESPACE
148
149#endif
ParentDescriptor(ParentDescriptor &&)=default
ParentDescriptor(std::shared_ptr< QXComponentNode > node)
ParentDescriptor & operator=(ParentDescriptor &&)=default
std::shared_ptr< QXComponentNode > xComponentNodeOrNull() const
std::shared_ptr< QEmbeddedWindowNode > embeddedWindowNodeOrNull() const
ParentDescriptor & operator=(const ParentDescriptor &)=default
ParentDescriptor(const ParentDescriptor &)=default
bool operator==(const ParentDescriptor &) const
void setHitTestMode(::ArkUI_HitTestMode hitTestMode)
QEmbeddedWindowNode & operator=(const QEmbeddedWindowNode &)=delete
void setHoverEventsHandler(QOhosConsumer< NativeNodeHoverEvent > hoverEventsHandler)
void setGesturesHandler(QOhosConsumer< const NativeGestureInfo & > gesturesHandler)
void setSizeParentFillPercentageNormalized(const QSizeF &size)
void setAxisEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent * > axisEventsHandler)
void setParentOrReparent(ParentDescriptor parent)
void setKeyEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent * > keyEventsHandler)
QEmbeddedWindowNode(std::unique_ptr< Node > stack, std::unique_ptr< Node > contentNode, std::unique_ptr< QtOhos::WindowIdStruct > windowId)
QEmbeddedWindowNode(const QEmbeddedWindowNode &)=delete
std::shared_ptr< void > startDrag(std::vector< std::shared_ptr<::OH_PixelmapNative > > pixelMaps, const QPointF &hotspot, QOhosUdmfData udmfData, std::function< void(::ArkUI_DragAndDropInfo *)> statusListener)
static const std::int32_t minimumNodeZIndexValue
void setSize(const QSizeF &size)
void setBackgroundColor(const QColor &color)
void handleGestureEvent(const NativeGestureInfo &nativeGestureInfo) const
void setDragEventsHandler(QOhosConsumer<::ArkUI_NodeEvent * > dragEventsHandler)
QEmbeddedWindowNode(QEmbeddedWindowNode &&)=delete
void setPosition(const QPointF &position)
void setCoastingAxisEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent * > coastingAxisEventsHandler)
void setMouseEventsHandler(QOhosConsumer< NativeNodeMouseEvent > mouseEventsHandler)
QEmbeddedWindowNode & operator=(QEmbeddedWindowNode &&)=delete
Combined button and popup list for selecting options.
QXComponent< QXComponentType::Node > QXComponentNode
Definition qxcomponent.h:44
::ArkUI_GestureEvent * event