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
qnativenode.cpp
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#include <render/qnativenode.h>
5
6#include <EGL/eglplatform.h>
7#include <QPointer>
8#include <qohosutils.h>
9#include <QtGui/private/qguiapplication_p.h>
10#include <QtGui/qguiapplication.h>
11#include <ace/xcomponent/native_interface_xcomponent.h>
12#include <arkui/native_node.h>
13#include <arkui/native_type.h>
14#include <arkui/ui_input_event.h>
15#include <native_window/external_window.h>
16#include <qarkui/qembeddedwindownode.h>
17#include <qohosinputmethodeventhandler.h>
18#include <qohosjsmain.h>
19#include <qohospixelmapconversions.h>
20#include <qohosplatformintegration.h>
21#include <qohosplatformwindow.h>
22#include <qohosudmf.h>
23#include <qohosudmfconversions.h>
24#include <qpa/qwindowsysteminterface.h>
25#include <render/qohosarkuinativegestureshandler.h>
26#include <render/qohosdrageventutils.h>
27#include <render/qohoshovereventsgenerator.h>
28#include <render/qohosnativeaxiseventhandler.h>
29#include <render/qohosnativedrageventshandler.h>
30#include <render/qohosnativekeyeventshandler.h>
31#include <render/qohosnativemouseeventshandler.h>
32#include <render/qohosnativexcomponentinputhandler.h>
33#include <render/qohosview.h>
34#include <render/qxcomponent.h>
35#include <algorithm>
36#include <cstdint>
37#include <functional>
38#include <iterator>
39
40QT_BEGIN_NAMESPACE
41
42namespace {
43
46
47class CallbackReceiver final : public QArkUi::QXComponentCallbackReceiver
48{
49public:
51 QXComponentRender xComponent,
52 QtOhos::QThreadSafeRef<QWindow> windowRef,
53 QtOhos::QThreadSafeRef<QOhosInputMethodEventHandler> imEventHandlerRef,
54 std::function<void(SurfaceEventType, ::OHNativeWindow *, QOhosOptional<QSize>)> surfaceEventHandler);
55
56 void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override;
57 void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *window) override;
58 void onHoverEvent(bool isHover) override;
59
60 ~CallbackReceiver() override = default;
61private:
62 QOhosOptional<void *> m_lastWindowArgReceivedViaAnyCallback;
63 std::function<void(SurfaceEventType, ::OHNativeWindow *, QOhosOptional<QSize>)> m_surfaceEventHandler;
64 QSharedPointer<QOhosNativeXComponentInputHandler> m_xComponentInputHandler;
65};
66
67CallbackReceiver::CallbackReceiver(
68 QXComponentRender xComponent,
69 QtOhos::QThreadSafeRef<QWindow> windowRef,
70 QtOhos::QThreadSafeRef<QOhosInputMethodEventHandler> imEventHandlerRef,
71 std::function<void(SurfaceEventType, ::OHNativeWindow *, QOhosOptional<QSize>)> surfaceEventHandler)
77{
78}
79
80void CallbackReceiver::onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow)
81{
82 m_lastWindowArgReceivedViaAnyCallback = nativeWindow;
83 m_surfaceEventHandler(surfaceEventType, nativeWindow, QOhosSurface::tryGetBufferGeometryForWindow(nativeWindow));
84}
85
86void CallbackReceiver::onInputEvent(InputEventType inputEventType, ::OHNativeWindow *window)
87{
88 m_lastWindowArgReceivedViaAnyCallback = window;
89
90 switch (inputEventType) {
91 case QArkUi::QXComponentCallbackReceiver::InputEventType::Mouse:
92 m_xComponentInputHandler->handleMouseEvent(window);
93 break;
94 case QArkUi::QXComponentCallbackReceiver::InputEventType::Touch:
95 m_xComponentInputHandler->handleTouchEvent(window);
96 break;
97 case QArkUi::QXComponentCallbackReceiver::InputEventType::Keyboard:
98 m_xComponentInputHandler->handleKeyEvent();
99 break;
100 }
101}
102
103void CallbackReceiver::onHoverEvent(bool isHover)
104{
105 if (!m_lastWindowArgReceivedViaAnyCallback.has_value()) {
106 qOhosPrintfWarning("Received hover event before without existing surface");
107 return;
108 }
109
110 m_xComponentInputHandler->handleHoverEvent(m_lastWindowArgReceivedViaAnyCallback.value(), isHover);
111}
112
115{
116 switch (renderFitPolicy) {
118 return makeQOhosOptional(::ARKUI_RENDER_FIT_TOP_LEFT);
120 return makeQOhosOptional(::ARKUI_RENDER_FIT_RESIZE_FILL);
121 }
122
124}
125
126}
127
128QNativeNode::QNativeNode(const CreateInfo &nativeNodeCreateInfo)
129 : QObject()
130{
131 auto qWindow = QPointer<QWindow>(nativeNodeCreateInfo.window);
132 auto selfRef = QtOhos::makeQThreadSafeRef(this);
133 auto windowId = QOhosPlatformWindow::fromQWindow(qWindow)->internalWindowId();
134
135 auto platformWindowFlags = QOhosPlatformWindow::platformWindowFlagsForQWindow(qWindow);
136 bool focusable = !platformWindowFlags.testFlag(Qt::WindowDoesNotAcceptFocus);
137
138 auto renderFit = qAndThen(
139 nativeNodeCreateInfo.renderFitPolicyHint, tryMapRenderFitPolicyToArkUi)
140 .value_or(::ARKUI_RENDER_FIT_TOP_LEFT);
141
142 connect(
143 qGuiApp, &QGuiApplication::focusWindowChanged,
144 this, [this, qWindow](QWindow *focusedWindow) {
145 if (focusedWindow == qWindow)
146 setFocused(true);
147 });
148
149 auto qWindowRef = QtOhos::makeQThreadSafeRef(qWindow.data());
150
151 auto *ohosPlatformIntegration = QOhosPlatformIntegration::instance();
152 auto *inputMethodEventHandler = ohosPlatformIntegration->inputMethodEventHandler();
153 if (inputMethodEventHandler == nullptr)
154 qOhosReportFatalErrorAndAbort("QOhosInputMethodEventHandler is null!");
155 auto imEventHandlerRef = QtOhos::makeQThreadSafeRef(inputMethodEventHandler);
156
158 m_jsStateData = QtOhos::makeProxyWithJsThreadDeleter(std::make_shared<JsStateData>());
159
160 using ParentDescriptor = QArkUi::QEmbeddedWindowNode::ParentDescriptor;
161
162 QOhosOptional<ParentDescriptor> optParentDescriptor;
163 if (nativeNodeCreateInfo.optParent.has_value()) {
164 auto *parentNode = nativeNodeCreateInfo.optParent.value()->m_jsStateData->embeddedWindow.get();
165 optParentDescriptor = ParentDescriptor(*parentNode);
166 }
167
168 QArkUi::QQtEmbeddedWindowNode::CreateInfo createInfo = {
169 .offset = nativeNodeCreateInfo.geometry.topLeft(),
170 .size = nativeNodeCreateInfo.geometry.size(),
171 .xComponentId = QXComponentId::createForRenderXComponent(windowId),
172 .xComponentType = ::ArkUI_XComponentType::ARKUI_XCOMPONENT_TYPE_SURFACE,
173 .focusOnTouch = false,
174 .focusable = focusable,
175 .optParent = optParentDescriptor,
176 .sizePolicy = QArkUi::QEmbeddedWindowNode::SizePolicy::Points,
177 .renderFit = renderFit,
178 .backgroundColor = nativeNodeCreateInfo.backgroundColor,
179 };
180
181 m_jsStateData->embeddedWindow = QArkUi::QQtEmbeddedWindowNode::createOrFail(createInfo);
182 m_jsStateData->embeddedWindow->setCallbackReceiver(
183 std::make_unique<CallbackReceiver>(
184 m_jsStateData->embeddedWindow->renderXComponent(),
185 qWindowRef, imEventHandlerRef,
186 [selfRef](SurfaceEventType type, ::OHNativeWindow *window, QOhosOptional<QSize> optSurfaceSize) {
187 selfRef.visitInQtThreadIfAlive(
188 [type, window, optSurfaceSize](auto &self) {
189 self.handleSurfaceEvent(type, window, optSurfaceSize);
190 });
191 }));
192
193 m_jsStateData->embeddedWindow->setTouchInterceptReceiver(
194 [selfRef, embeddedWindow = m_jsStateData->embeddedWindow.get()](const ::ArkUI_UIInputEvent *event) {
195 auto eventAction = ::OH_ArkUI_UIInputEvent_GetAction(event);
196
197 if (eventAction != ::UI_MOUSE_EVENT_ACTION_PRESS && eventAction != ::UI_TOUCH_EVENT_ACTION_DOWN)
198 return;
199
200 if (!embeddedWindow->hasNonQtManagedChildren())
201 return;
202
203 selfRef.visitInQtThreadIfAlive(
204 [](QNativeNode &node) {
205 Q_EMIT node.externalContentClickDetected();
206 });
207 });
208
209 auto sharedAxisEventHandler = QtOhos::moveToSharedPtr(
210 makeQOhosNativeAxisEventHandler(qWindowRef, imEventHandlerRef));
211 m_jsStateData->embeddedWindow->setAxisEventsHandler(
212 [sharedAxisEventHandler](auto *event) {
213 (*sharedAxisEventHandler)(QOhosAxisEventType::AxisEvent, event);
214 }
215 );
216 m_jsStateData->embeddedWindow->setCoastingAxisEventsHandler(
217 [sharedAxisEventHandler](auto *event) {
218 (*sharedAxisEventHandler)(QOhosAxisEventType::CoastingAxisEvent, event);
219 });
220 m_jsStateData->embeddedWindow->setGesturesHandler(
221 makeQOhosArkUiNativeGesturesHandler(qWindowRef));
222 m_jsStateData->embeddedWindow->setDragEventsHandler(makeQOhosNativeDragEventsHandler(qWindowRef));
223 if (QtOhos::isNativeNodeApiKeyEventsEnabled())
224 m_jsStateData->embeddedWindow->setKeyEventsHandler(makeQOhosNativeKeyEventsHandler(qWindowRef, imEventHandlerRef));
226 auto hoverEventsGenerator = makeQOhosHoverEventsGenerator(qWindowRef, imEventHandlerRef);
227 m_jsStateData->embeddedWindow->setMouseEventsHandler(
228 makeQOhosNativeMouseEventsHandler(qWindowRef, imEventHandlerRef, hoverEventsGenerator));
229 m_jsStateData->embeddedWindow->setHoverEventsHandler(
230 [hoverEventsGenerator](QArkUi::NativeNodeHoverEvent hoverEvent) {
231 hoverEventsGenerator->handleQOhosHoverEvent(hoverEvent.isHovered);
232 });
233 }
234 },
235 Q_FUNC_INFO);
236}
237
239{
240 return m_nodeGeometry;
241}
242
244{
246 [&](QtOhos::JsState &) {
247 m_jsStateData->embeddedWindow->setSizeParentFillPercentageNormalized(size);
248 },
249 Q_FUNC_INFO);
250}
251
252void QNativeNode::setSize(const QSizeF &size)
253{
254 m_nodeGeometry.setSize(size.toSize());
256 [&](QtOhos::JsState &) {
257 m_jsStateData->embeddedWindow->setSize(size);
258 },
259 Q_FUNC_INFO);
260}
261
262void QNativeNode::setPosition(QPoint position)
263{
264 m_nodeGeometry.setTopLeft(position);
266 [&](QtOhos::JsState &) {
267 m_jsStateData->embeddedWindow->setPosition(position);
268 },
269 Q_FUNC_INFO);
270}
271
272void QNativeNode::setVisibility(bool visible)
273{
275 [&](QtOhos::JsState &) {
276 m_jsStateData->embeddedWindow->setNodeVisibility(visible);
277 },
278 Q_FUNC_INFO);
279}
280
281QOhosSurface *QNativeNode::surfaceOrNull() const
282{
283 return m_optSurface.get();
284}
285
287{
289 [&](QtOhos::JsState &) {
290 m_jsStateData->embeddedWindow->setPosition(QPointF(0, 0));
291 m_jsStateData->embeddedWindow->setSizeParentFillPercentageNormalized(QSizeF(1.0, 1.0));
292 },
293 Q_FUNC_INFO);
294}
295
296void QNativeNode::handleSurfaceEvent(
297 SurfaceEventType surfaceEventType,
298 ::OHNativeWindow *nativeWindow,
299 const QOhosOptional<QSize> &optSurfaceSize)
300{
301 qCDebug(QtForOhos, "Surface event: %d window: %p", surfaceEventType, nativeWindow);
302 switch (surfaceEventType) {
304 {
305 // NOTE - Its possible to receive surface changed event with null nativeWindow
306 if (nativeWindow == nullptr) {
307 m_optSurface.reset();
308 } else if (m_optSurface) {
309 m_optSurface->setNativeWindowSurface(nativeWindow, optSurfaceSize);
310 } else {
311 m_optSurface = std::make_unique<QOhosSurface>(nativeWindow);
312 }
313 break;
314 }
315 case SurfaceEventType::SurfaceCreated:
316 m_optSurface = std::make_unique<QOhosSurface>(nativeWindow);
317 break;
318 case SurfaceEventType::SurfaceDestroyed:
319 m_optSurface.reset();
320 break;
321 }
322 Q_EMIT surfaceStatusChanged(optSurfaceSize);
323}
324
326{
327 return QtOhos::evalInJsThread([&](QtOhos::JsState &) {
328 return reinterpret_cast<WId>(m_jsStateData->embeddedWindow->qtWindowId());
329 },
330 Q_FUNC_INFO);
331}
332
333void QNativeNode::setParent(std::shared_ptr<QXComponentNode> xComponent)
334{
336 m_jsStateData->embeddedWindow->setParentOrReparent(
337 QArkUi::QEmbeddedWindowNode::ParentDescriptor(xComponent));
338 },
339 Q_FUNC_INFO);
340}
341
343{
345 m_jsStateData->embeddedWindow->setParentOrReparent(
346 QArkUi::QEmbeddedWindowNode::ParentDescriptor(*other.m_jsStateData->embeddedWindow));
347 },
348 Q_FUNC_INFO);
349}
350
352{
354 auto &window = *m_jsStateData->embeddedWindow;
355 window.raise();
356 },
357 Q_FUNC_INFO);
358}
359
361{
363 auto &window = *m_jsStateData->embeddedWindow;
364 window.lower();
365 },
366 Q_FUNC_INFO);
367}
368
370{
372 auto &window = *m_jsStateData->embeddedWindow;
373 window.detachFromParentIfPresent();
374 },
375 Q_FUNC_INFO);
376}
377
378void QNativeNode::setFocused(bool focused)
379{
381 m_jsStateData->embeddedWindow->setFocused(focused);
382 },
383 Q_FUNC_INFO);
384}
385
386void QNativeNode::setFocusable(bool focusable)
387{
389 m_jsStateData->embeddedWindow->setFocusable(focusable);
390 },
391 Q_FUNC_INFO);
392}
393
394void QNativeNode::setBackgroundColor(const QColor &color)
395{
397 m_jsStateData->embeddedWindow->setBackgroundColor(color);
398 },
399 Q_FUNC_INFO);
400}
401
402void QNativeNode::setBrightness(int brightness)
403{
405 [&](QtOhos::JsState &) {
406 m_jsStateData->embeddedWindow->setBrightness(brightness);
407 },
408 Q_FUNC_INFO);
409}
410
411void QNativeNode::setContrast(int contrast)
412{
414 [&](QtOhos::JsState &) {
415 m_jsStateData->embeddedWindow->setContrast(contrast);
416 },
417 Q_FUNC_INFO);
418}
419
420void QNativeNode::setSaturation(int saturation)
421{
423 [&](QtOhos::JsState &) {
424 m_jsStateData->embeddedWindow->setSaturation(saturation);
425 },
426 Q_FUNC_INFO);
427}
428
430 const std::vector<QImage> &images, const QPointF &hotspot,
431 const QMimeData &mimeData, QOhosConsumer<Qt::DropAction> dropActionConsumer)
432{
433 auto udmfDataFactory = makeUdmfDataFactoryFromQMimeData(mimeData, {});
434
436 [&](QtOhos::JsState &) {
437 qOhosPrintfDebug("%s: starting drag", Q_FUNC_INFO);
438
439 std::vector<std::shared_ptr<::OH_PixelmapNative>> pixelMaps;
440 std::transform(
441 images.begin(), images.end(), std::back_inserter(pixelMaps),
442 &createNativePixelMapFromQImage);
443
444 struct DragContext
445 {
446 QOhosConsumer<Qt::DropAction> dropActionConsumer;
447 std::shared_ptr<void> startedDragHandle;
448 };
449 auto context = std::make_shared<DragContext>();
450 context->dropActionConsumer = std::move(dropActionConsumer);
451
452 auto startedDragHandle = m_jsStateData->embeddedWindow->startDrag(
453 std::move(pixelMaps), hotspot,
454 udmfDataFactory(),
455 [context](::ArkUI_DragAndDropInfo *dragAndDropInfo) mutable {
456 auto dragStatus = QArkUi::callArkUi(
457 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragAndDropInfo_GetDragStatus),
458 dragAndDropInfo);
459 qOhosPrintfDebug("%s: drag status: %d", Q_FUNC_INFO, static_cast<int>(dragStatus));
460
461 if (dragStatus == ::ARKUI_DRAG_STATUS_ENDED && context) {
462 auto *dragEvent = QArkUi::callArkUiOrFailOnNullResult(
463 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragAndDropInfo_GetDragEvent),
464 dragAndDropInfo);
465
466 ::ArkUI_DragResult dragResult = ::ARKUI_DRAG_RESULT_FAILED;
467 QArkUi::callArkUiOrFailOnErrorResult(
468 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragEvent_GetDragResult),
469 dragEvent, &dragResult);
470
471 auto qtDropAction =
472 dragResult == ::ARKUI_DRAG_RESULT_SUCCESSFUL
473 ? mapQOhosArkUiDropOperationToQt(
474 getQOhosDragEventDropOperation(dragEvent))
475 : Qt::IgnoreAction;
476
477 qOhosPrintfDebug(
478 "%s: sending drag-end notification: %d / %d",
479 Q_FUNC_INFO, static_cast<int>(dragResult), static_cast<int>(qtDropAction));
480 QtOhos::invokeInQtThread(
481 [dropActionConsumer = std::move(context->dropActionConsumer), qtDropAction]() {
482 dropActionConsumer(qtDropAction);
483 });
484 context.reset();
485 }
486 });
487 context->startedDragHandle = startedDragHandle;
488 },
489 Q_FUNC_INFO);
490}
491
492void QNativeNode::addForeignWindowChild(QOhosForeignWindow *foreignWindow)
493{
495 auto &child = foreignWindow->embeddedWindowNodeInJsThread();
496 auto parentDescriptor = QArkUi::QEmbeddedWindowNode::ParentDescriptor(*m_jsStateData->embeddedWindow);
497 child.setParentOrReparent(parentDescriptor);
498 },
499 Q_FUNC_INFO);
500}
501
502void QNativeNode::setTransparentForInput(bool transparentForInput)
503{
505 m_jsStateData->embeddedWindow->setHitTestMode(
506 transparentForInput
507 ? ::ARKUI_HIT_TEST_MODE_NONE
508 : ::ARKUI_HIT_TEST_MODE_DEFAULT);
509 },
510 Q_FUNC_INFO);
511}
512
513void QNativeNode::setNodeAreaChangeHandler(QOhosConsumer<QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo> areaChangeEventConsumer)
514{
515 auto selfRef = QtOhos::makeQThreadSafeRef(this);
517 m_jsStateData->embeddedWindow->setAreaChangeReceiver(
518 QtOhos::makeCompressingAsyncConsumer(
519 std::move(areaChangeEventConsumer),
520 [selfRef](auto task) {
521 selfRef.visitInQtThreadIfAlive([task = std::move(task)](QNativeNode &) {
522 task();
523 });
524 }));
525 },
526 Q_FUNC_INFO);
527}
528
529void QNativeNode::setNodeFocusChangeHandler(QOhosConsumer<bool> focusedChangedConsumer)
530{
531 auto selfRef = QtOhos::makeQThreadSafeRef(this);
532 auto sharedConsumer = QtOhos::moveToSharedPtr(std::move(focusedChangedConsumer));
534 m_jsStateData->embeddedWindow->setFocusedChangeReceiver(
535 [selfRef, sharedConsumer = std::move(sharedConsumer)](bool focused) {
536 selfRef.visitInQtThreadIfAlive([focused, sharedConsumer](QNativeNode &) {
537 (*sharedConsumer)(focused);
538 });
539 });
540 },
541 Q_FUNC_INFO);
542}
543
544void QNativeNode::setNodeVisibilityChangeHandler(QOhosConsumer<bool> visibilityChangedConsumer)
545{
546 auto selfRef = QtOhos::makeQThreadSafeRef(this);
547 auto sharedConsumer = QtOhos::moveToSharedPtr(std::move(visibilityChangedConsumer));
549 m_jsStateData->embeddedWindow->setVisibilityChangeReceiver(
550 [selfRef, sharedConsumer = std::move(sharedConsumer)](bool visibile) {
551 selfRef.visitInQtThreadIfAlive([visibile, sharedConsumer](QNativeNode &) {
552 (*sharedConsumer)(visibile);
553 });
554 });
555 },
556 Q_FUNC_INFO);
557}
558
560{
561 return QtOhos::evalInJsThread(
562 [&](QtOhos::JsState &) {
563 return m_jsStateData->embeddedWindow->nodeScreenGeometryPixels();
564 },
565 Q_FUNC_INFO);
566}
567
569{
570 return QtOhos::evalInJsThread(
571 [&](QtOhos::JsState &) {
572 return QRect(
573 m_jsStateData->embeddedWindow->parentRelativeOffsetPixels(),
574 m_jsStateData->embeddedWindow->nodeScreenGeometryPixels().size());
575 },
576 Q_FUNC_INFO);
577}
578
579QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo QNativeNode::nodeAreaInfo() const
580{
581 return QtOhos::evalInJsThread(
582 [&](QtOhos::JsState &) {
583 return m_jsStateData->embeddedWindow->nodeAreaInfo();
584 },
585 Q_FUNC_INFO);
586}
587
588QT_END_NAMESPACE
void setParentOrReparent(ParentDescriptor parent)
void setSizeParentFillPercentNormalized(const QSizeF &size)
void setSaturation(int saturation)
QRectF geometry() const
void setTransparentForInput(bool transparentForInput)
void fillToParent()
void setNodeAreaChangeHandler(QOhosConsumer< QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo > areaChangeEventConsumer)
void setPosition(QPoint position)
void setContrast(int contrast)
QRect nodeParentRelativeGeometryPixels() const
void startDrag(const std::vector< QImage > &images, const QPointF &hotspot, const QMimeData &mimeData, QOhosConsumer< Qt::DropAction > dropActionConsumer)
void setNodeVisibilityChangeHandler(QOhosConsumer< bool > visibilityChangedConsumer)
void detachFromParentIfPresent()
QOhosSurface * surfaceOrNull() const
void setFocused(bool focused)
void setBackgroundColor(const QColor &color)
QRect nodeScreenGeometryPixels() const
void setVisibility(bool visible)
QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo nodeAreaInfo() const
void setNodeFocusChangeHandler(QOhosConsumer< bool > focusedChangedConsumer)
QNativeNode(const CreateInfo &nativeNodeCreateInfo)
WId windowId() const
void addForeignWindowChild(QOhosForeignWindow *foreignWindow)
void setSize(const QSizeF &size)
void setFocusable(bool focusable)
void setBrightness(int brightness)
void setParent(std::shared_ptr< QXComponentNode > xComponent)
void setParent(QNativeNode &other)
static QOhosPlatformIntegration * instance()
QOhosInputMethodEventHandler * inputMethodEventHandler() const
void onHoverEvent(bool isHover) override
void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *window) override
CallbackReceiver(QXComponentRender xComponent, QtOhos::QThreadSafeRef< QWindow > windowRef, QtOhos::QThreadSafeRef< QOhosInputMethodEventHandler > imEventHandlerRef, std::function< void(SurfaceEventType, ::OHNativeWindow *, QOhosOptional< QSize >)> surfaceEventHandler)
void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override
QArkUi::QXComponentCallbackReceiver::InputEventType InputEventType
QOhosOptional<::ArkUI_RenderFit > tryMapRenderFitPolicyToArkUi(QOhosPlatformWindow::NativeNodeRenderFitPolicy renderFitPolicy)
QArkUi::QXComponentCallbackReceiver::SurfaceEventType SurfaceEventType
void runInJsThreadAndWait(const std::function< void(JsState &)> &task, std::string callerContextName={})
bool isNativeNodeApiMouseEventsEnabled()
std::nullopt_t makeEmptyQOhosOptional()
QXComponent< QXComponentType::Render > QXComponentRender
Definition qxcomponent.h:43
QXComponent< QXComponentType::Node > QXComponentNode
Definition qxcomponent.h:44