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/qnativenodeapi.h>
21#include <qohosplugincore.h>
22#include <qohosudmf.h>
23#include <render/qxcomponent.h>
24#include <vector>
25
27
28namespace QArkUi {
29
40
42{
43public:
45 {
46 public:
53 explicit ParentDescriptor(std::shared_ptr<QXComponentNode> node);
54
57
60
61 Type type() const;
63 std::shared_ptr<QXComponentNode> xComponentNodeOrNull() const;
64 bool operator==(const ParentDescriptor &) const;
65
66 private:
67 Type m_type;
68 QOhosOptional<std::weak_ptr<QEmbeddedWindowNode>> m_embeddedWindowNode;
69 QOhosOptional<std::weak_ptr<QXComponentNode>> m_xComponentNode;
70 };
71
73
74 enum class SizePolicy
75 {
78 };
79
81 std::unique_ptr<Node> stack,
82 std::unique_ptr<Node> contentNode,
83 std::unique_ptr<QtOhos::WindowIdStruct> windowId);
84
87
90
91 void setNodeVisibility(bool visible);
92 void setSize(const QSizeF &size);
93 void setSizeParentFillPercentageNormalized(const QSizeF &size);
94 void setPosition(const QPointF &position);
95 void setFocused(bool focused);
96 void setFocusable(bool focusable);
97 void setBackgroundColor(const QColor &color);
98 void setBrightness(int brightness);
99 void setContrast(int contrast);
100 void setSaturation(int saturation);
101 void setGesturesHandler(QOhosConsumer<const NativeGestureInfo &> gesturesHandler);
102 void setHitTestMode(::ArkUI_HitTestMode hitTestMode);
103 void setDragEventsHandler(QOhosConsumer<::ArkUI_NodeEventType, ::ArkUI_DragEvent *> dragEventsHandler);
104 void setKeyEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent *> keyEventsHandler);
105 void setMouseEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent *> mouseEventsHandler);
106 void setHoverEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent *> hoverEventsHandler);
107 void setAxisEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent *> axisEventsHandler);
108 std::shared_ptr<void> startDrag(
109 std::vector<std::shared_ptr<::OH_PixelmapNative>> pixelMaps, const QPointF &hotspot,
110 QOhosUdmfData udmfData, std::function<void(::ArkUI_DragAndDropInfo *)> statusListener);
111
112 std::int32_t zIndex() const;
113 void setZIndex(std::int32_t index);
114
115 void *qtWindowId();
116
119 void handleGestureEvent(const NativeGestureInfo &nativeGestureInfo) const;
120
122
123protected:
124 Node &contentNode();
125 const Node &contentNode() const;
126 Node &stackNode();
127 const Node &stackNode() const;
128
129private:
130 void setContentNodeEventHandler(
131 ::ArkUI_NodeEventType eventType, const char *eventTypeName,
132 QOhosConsumer<::ArkUI_UIInputEvent *> inputEventsHandler);
133
134 std::unique_ptr<Node> m_stackNode;
135 std::unique_ptr<Node> m_contentNode;
136 std::shared_ptr<void> m_nodeEventDispatcherToken;
137 QOhosOptional<ParentDescriptor> m_parentDescriptor;
138 std::unique_ptr<QtOhos::WindowIdStruct> m_windowIdStruct;
139 std::shared_ptr<void> m_nativeNodeDispatcherHandle;
140 QOhosConsumer<const NativeGestureInfo &> m_gesturesHandler;
141};
142
143}
144
145QT_END_NAMESPACE
146
147#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)
void setDragEventsHandler(QOhosConsumer<::ArkUI_NodeEventType, ::ArkUI_DragEvent * > dragEventsHandler)
void setMouseEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent * > mouseEventsHandler)
QEmbeddedWindowNode & operator=(const QEmbeddedWindowNode &)=delete
void setGesturesHandler(QOhosConsumer< const NativeGestureInfo & > gesturesHandler)
void setSizeParentFillPercentageNormalized(const QSizeF &size)
void setZIndex(std::int32_t index)
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
QEmbeddedWindowNode(QEmbeddedWindowNode &&)=delete
void setPosition(const QPointF &position)
void setHoverEventsHandler(QOhosConsumer<::ArkUI_UIInputEvent * > hoverEventsHandler)
QEmbeddedWindowNode & operator=(QEmbeddedWindowNode &&)=delete
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.
QXComponent< QXComponentType::Node > QXComponentNode
Definition qxcomponent.h:44
::ArkUI_GestureEvent * event