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/private/qohosimageconversions_p.h>
11#include <QtGui/qguiapplication.h>
12#include <ace/xcomponent/native_interface_xcomponent.h>
13#include <arkui/native_node.h>
14#include <arkui/native_type.h>
15#include <arkui/ui_input_event.h>
16#include <native_window/external_window.h>
17#include <qarkui/qembeddedwindownode.h>
18#include <qohosinputmethodeventhandler.h>
19#include <qohosjsmain.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 *, std::optional<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 std::optional<void *> m_lastWindowArgReceivedViaAnyCallback;
63 std::function<void(SurfaceEventType, ::OHNativeWindow *, std::optional<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 *, std::optional<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
113}
114
115QNativeNode::QNativeNode(const CreateInfo &nativeNodeCreateInfo)
116 : QObject()
117{
118 auto qWindow = QPointer<QWindow>(nativeNodeCreateInfo.window);
119 auto selfRef = QtOhos::makeQThreadSafeRef(this);
120 auto windowId = QOhosPlatformWindow::fromQWindow(qWindow)->internalWindowId();
121
122 auto platformWindowFlags = QOhosPlatformWindow::platformWindowFlagsForQWindow(qWindow);
123 bool focusable = !platformWindowFlags.testFlag(Qt::WindowDoesNotAcceptFocus);
124
125 auto renderFit = nativeNodeCreateInfo.renderFitPolicyHint.value_or(::ARKUI_RENDER_FIT_TOP_LEFT);
126
127 connect(
128 qGuiApp, &QGuiApplication::focusWindowChanged,
129 this, [this, qWindow](QWindow *focusedWindow) {
130 if (focusedWindow == qWindow)
131 setFocused(true);
132 });
133
134 auto qWindowRef = QtOhos::makeQThreadSafeRef(qWindow.data());
135
136 auto *ohosPlatformIntegration = QOhosPlatformIntegration::instance();
137 auto *inputMethodEventHandler = ohosPlatformIntegration->inputMethodEventHandler();
138 if (inputMethodEventHandler == nullptr)
139 qOhosReportFatalErrorAndAbort("QOhosInputMethodEventHandler is null!");
140 auto imEventHandlerRef = QtOhos::makeQThreadSafeRef(inputMethodEventHandler);
141
143 m_jsStateData = QtOhos::makeProxyWithJsThreadDeleter(std::make_shared<JsStateData>());
144
145 using ParentDescriptor = QArkUi::QEmbeddedWindowNode::ParentDescriptor;
146
147 std::optional<ParentDescriptor> optParentDescriptor;
148 if (nativeNodeCreateInfo.optParent.has_value()) {
149 auto *parentNode = nativeNodeCreateInfo.optParent.value()->m_jsStateData->embeddedWindow.get();
150 optParentDescriptor = ParentDescriptor(*parentNode);
151 }
152
153 QArkUi::QQtEmbeddedWindowNode::CreateInfo createInfo = {
154 .offset = nativeNodeCreateInfo.geometry.topLeft(),
155 .size = nativeNodeCreateInfo.geometry.size(),
156 .xComponentId = QXComponentId::createForRenderXComponent(windowId),
157 .xComponentType = ::ArkUI_XComponentType::ARKUI_XCOMPONENT_TYPE_SURFACE,
158 .focusOnTouch = false,
159 .focusable = focusable,
160 .optParent = optParentDescriptor,
161 .sizePolicy = QArkUi::QEmbeddedWindowNode::SizePolicy::Points,
162 .renderFit = renderFit,
163 .backgroundColor = nativeNodeCreateInfo.backgroundColor,
164 };
165
166 m_jsStateData->embeddedWindow = QArkUi::QQtEmbeddedWindowNode::createOrFail(createInfo);
167 m_jsStateData->embeddedWindow->setCallbackReceiver(
168 std::make_unique<CallbackReceiver>(
169 m_jsStateData->embeddedWindow->renderXComponent(),
170 qWindowRef, imEventHandlerRef,
171 [selfRef](SurfaceEventType type, ::OHNativeWindow *window, std::optional<QSize> optSurfaceSize) {
172 selfRef.visitInQtThreadIfAlive(
173 [type, window, optSurfaceSize](auto &self) {
174 self.handleSurfaceEvent(type, window, optSurfaceSize);
175 });
176 }));
177
178 m_jsStateData->embeddedWindow->setTouchInterceptReceiver(
179 [selfRef, embeddedWindow = m_jsStateData->embeddedWindow.get()](const ::ArkUI_UIInputEvent *event) {
180 auto eventAction = ::OH_ArkUI_UIInputEvent_GetAction(event);
181
182 if (eventAction != ::UI_MOUSE_EVENT_ACTION_PRESS && eventAction != ::UI_TOUCH_EVENT_ACTION_DOWN)
183 return;
184
185 if (!embeddedWindow->hasNonQtManagedChildren())
186 return;
187
188 selfRef.visitInQtThreadIfAlive(
189 [](QNativeNode &node) {
190 Q_EMIT node.externalContentClickDetected();
191 });
192 });
193
194 auto sharedAxisEventHandler = QtOhos::moveToSharedPtr(
195 makeQOhosNativeAxisEventHandler(qWindowRef, imEventHandlerRef));
196 m_jsStateData->embeddedWindow->setAxisEventsHandler(
197 [sharedAxisEventHandler](auto *event) {
198 (*sharedAxisEventHandler)(QOhosAxisEventType::AxisEvent, event);
199 }
200 );
201 m_jsStateData->embeddedWindow->setCoastingAxisEventsHandler(
202 [sharedAxisEventHandler](auto *event) {
203 (*sharedAxisEventHandler)(QOhosAxisEventType::CoastingAxisEvent, event);
204 });
205 m_jsStateData->embeddedWindow->setGesturesHandler(
206 makeQOhosArkUiNativeGesturesHandler(qWindowRef));
207 m_jsStateData->embeddedWindow->setDragEventsHandler(makeQOhosNativeDragEventsHandler(qWindowRef));
208 if (QtOhos::isNativeNodeApiKeyEventsEnabled())
209 m_jsStateData->embeddedWindow->setKeyEventsHandler(makeQOhosNativeKeyEventsHandler(qWindowRef, imEventHandlerRef));
211 auto hoverEventsGenerator = makeQOhosHoverEventsGenerator(qWindowRef, imEventHandlerRef);
212 m_jsStateData->embeddedWindow->setMouseEventsHandler(
213 makeQOhosNativeMouseEventsHandler(qWindowRef, imEventHandlerRef, hoverEventsGenerator));
214 m_jsStateData->embeddedWindow->setHoverEventsHandler(
215 [hoverEventsGenerator](QArkUi::NativeNodeHoverEvent hoverEvent) {
216 hoverEventsGenerator->handleQOhosHoverEvent(hoverEvent.isHovered);
217 });
218 }
219 },
220 Q_FUNC_INFO);
221}
222
224{
225 return m_nodeGeometry;
226}
227
229{
231 [&](QtOhos::JsState &) {
232 m_jsStateData->embeddedWindow->setSizeParentFillPercentageNormalized(size);
233 },
234 Q_FUNC_INFO);
235}
236
237void QNativeNode::setSize(const QSizeF &size)
238{
239 m_nodeGeometry.setSize(size.toSize());
241 [&](QtOhos::JsState &) {
242 m_jsStateData->embeddedWindow->setSize(size);
243 },
244 Q_FUNC_INFO);
245}
246
247void QNativeNode::setPosition(QPoint position)
248{
249 m_nodeGeometry.setTopLeft(position);
251 [&](QtOhos::JsState &) {
252 m_jsStateData->embeddedWindow->setPosition(position);
253 },
254 Q_FUNC_INFO);
255}
256
257void QNativeNode::setVisibility(bool visible)
258{
260 [&](QtOhos::JsState &) {
261 m_jsStateData->embeddedWindow->setNodeVisibility(visible);
262 },
263 Q_FUNC_INFO);
264}
265
266QOhosSurface *QNativeNode::surfaceOrNull() const
267{
268 return m_optSurface.get();
269}
270
272{
274 [&](QtOhos::JsState &) {
275 m_jsStateData->embeddedWindow->setPosition(QPointF(0, 0));
276 m_jsStateData->embeddedWindow->setSizeParentFillPercentageNormalized(QSizeF(1.0, 1.0));
277 },
278 Q_FUNC_INFO);
279}
280
281void QNativeNode::handleSurfaceEvent(
282 SurfaceEventType surfaceEventType,
283 ::OHNativeWindow *nativeWindow,
284 const std::optional<QSize> &optSurfaceSize)
285{
286 qCDebug(QtForOhos, "Surface event: %d window: %p", surfaceEventType, nativeWindow);
287 switch (surfaceEventType) {
289 {
290 // NOTE - Its possible to receive surface changed event with null nativeWindow
291 if (nativeWindow == nullptr) {
292 m_optSurface.reset();
293 } else if (m_optSurface) {
294 m_optSurface->setNativeWindowSurface(nativeWindow, optSurfaceSize);
295 } else {
296 m_optSurface = std::make_unique<QOhosSurface>(nativeWindow);
297 }
298 break;
299 }
300 case SurfaceEventType::SurfaceCreated:
301 m_optSurface = std::make_unique<QOhosSurface>(nativeWindow);
302 break;
303 case SurfaceEventType::SurfaceDestroyed:
304 m_optSurface.reset();
305 break;
306 }
307 Q_EMIT surfaceStatusChanged(optSurfaceSize);
308}
309
311{
312 return QtOhos::evalInJsThread([&](QtOhos::JsState &) {
313 return reinterpret_cast<WId>(m_jsStateData->embeddedWindow->qtWindowId());
314 },
315 Q_FUNC_INFO);
316}
317
318void QNativeNode::setParent(std::shared_ptr<QXComponentNode> xComponent)
319{
321 m_jsStateData->embeddedWindow->setParentOrReparent(
322 QArkUi::QEmbeddedWindowNode::ParentDescriptor(xComponent));
323 },
324 Q_FUNC_INFO);
325}
326
328{
330 m_jsStateData->embeddedWindow->setParentOrReparent(
331 QArkUi::QEmbeddedWindowNode::ParentDescriptor(*other.m_jsStateData->embeddedWindow));
332 },
333 Q_FUNC_INFO);
334}
335
337{
339 auto &window = *m_jsStateData->embeddedWindow;
340 window.raise();
341 },
342 Q_FUNC_INFO);
343}
344
346{
348 auto &window = *m_jsStateData->embeddedWindow;
349 window.lower();
350 },
351 Q_FUNC_INFO);
352}
353
355{
357 auto &window = *m_jsStateData->embeddedWindow;
358 window.detachFromParentIfPresent();
359 },
360 Q_FUNC_INFO);
361}
362
363void QNativeNode::setFocused(bool focused)
364{
366 m_jsStateData->embeddedWindow->setFocused(focused);
367 },
368 Q_FUNC_INFO);
369}
370
371void QNativeNode::setFocusable(bool focusable)
372{
374 m_jsStateData->embeddedWindow->setFocusable(focusable);
375 },
376 Q_FUNC_INFO);
377}
378
379void QNativeNode::setBackgroundColor(const QColor &color)
380{
382 m_jsStateData->embeddedWindow->setBackgroundColor(color);
383 },
384 Q_FUNC_INFO);
385}
386
387void QNativeNode::setBrightness(int brightness)
388{
390 [&](QtOhos::JsState &) {
391 m_jsStateData->embeddedWindow->setBrightness(brightness);
392 },
393 Q_FUNC_INFO);
394}
395
396void QNativeNode::setContrast(int contrast)
397{
399 [&](QtOhos::JsState &) {
400 m_jsStateData->embeddedWindow->setContrast(contrast);
401 },
402 Q_FUNC_INFO);
403}
404
405void QNativeNode::setSaturation(int saturation)
406{
408 [&](QtOhos::JsState &) {
409 m_jsStateData->embeddedWindow->setSaturation(saturation);
410 },
411 Q_FUNC_INFO);
412}
413
415 const std::vector<QImage> &images, const QPointF &hotspot,
416 const QMimeData &mimeData, QOhosConsumer<Qt::DropAction> dropActionConsumer)
417{
418 auto udmfDataFactory = makeUdmfDataFactoryFromQMimeData(mimeData, {});
419
421 [&](QtOhos::JsState &) {
422 qOhosPrintfDebug("%s: starting drag", Q_FUNC_INFO);
423
424 std::vector<std::shared_ptr<::OH_PixelmapNative>> pixelMaps;
425 std::transform(
426 images.begin(), images.end(), std::back_inserter(pixelMaps),
427 &makeOhosNativePixelMapFromQImage);
428
429 struct DragContext
430 {
431 QOhosConsumer<Qt::DropAction> dropActionConsumer;
432 std::shared_ptr<void> startedDragHandle;
433 };
434 auto context = std::make_shared<DragContext>();
435 context->dropActionConsumer = std::move(dropActionConsumer);
436
437 auto startedDragHandle = m_jsStateData->embeddedWindow->startDrag(
438 std::move(pixelMaps), hotspot,
439 udmfDataFactory(),
440 [context](::ArkUI_DragAndDropInfo *dragAndDropInfo) mutable {
441 auto dragStatus = QArkUi::callArkUi(
442 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragAndDropInfo_GetDragStatus),
443 dragAndDropInfo);
444 qOhosPrintfDebug("%s: drag status: %d", Q_FUNC_INFO, static_cast<int>(dragStatus));
445
446 if (dragStatus == ::ARKUI_DRAG_STATUS_ENDED && context) {
447 auto *dragEvent = QArkUi::callArkUiOrFailOnNullResult(
448 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragAndDropInfo_GetDragEvent),
449 dragAndDropInfo);
450
451 ::ArkUI_DragResult dragResult = ::ARKUI_DRAG_RESULT_FAILED;
452 QArkUi::callArkUiOrFailOnErrorResult(
453 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragEvent_GetDragResult),
454 dragEvent, &dragResult);
455
456 auto qtDropAction =
457 dragResult == ::ARKUI_DRAG_RESULT_SUCCESSFUL
458 ? mapQOhosArkUiDropOperationToQt(
459 getQOhosDragEventDropOperation(dragEvent))
460 : Qt::IgnoreAction;
461
462 qOhosPrintfDebug(
463 "%s: sending drag-end notification: %d / %d",
464 Q_FUNC_INFO, static_cast<int>(dragResult), static_cast<int>(qtDropAction));
465 QtOhos::invokeInQtThread(
466 [dropActionConsumer = std::move(context->dropActionConsumer), qtDropAction]() {
467 dropActionConsumer(qtDropAction);
468 });
469 context.reset();
470 }
471 });
472 context->startedDragHandle = startedDragHandle;
473 },
474 Q_FUNC_INFO);
475}
476
477void QNativeNode::addForeignWindowChild(QOhosForeignWindow *foreignWindow)
478{
480 auto &child = foreignWindow->embeddedWindowNodeInJsThread();
481 auto parentDescriptor = QArkUi::QEmbeddedWindowNode::ParentDescriptor(*m_jsStateData->embeddedWindow);
482 child.setParentOrReparent(parentDescriptor);
483 },
484 Q_FUNC_INFO);
485}
486
487void QNativeNode::setTransparentForInput(bool transparentForInput)
488{
490 m_jsStateData->embeddedWindow->setHitTestMode(
491 transparentForInput
492 ? ::ARKUI_HIT_TEST_MODE_NONE
493 : ::ARKUI_HIT_TEST_MODE_DEFAULT);
494 },
495 Q_FUNC_INFO);
496}
497
498void QNativeNode::setNodeAreaChangeHandler(QOhosConsumer<QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo> areaChangeEventConsumer)
499{
500 auto selfRef = QtOhos::makeQThreadSafeRef(this);
502 m_jsStateData->embeddedWindow->setAreaChangeReceiver(
503 QtOhos::makeCompressingAsyncConsumer(
504 std::move(areaChangeEventConsumer),
505 [selfRef](auto task) {
506 selfRef.visitInQtThreadIfAlive([task = std::move(task)](QNativeNode &) {
507 task();
508 });
509 }));
510 },
511 Q_FUNC_INFO);
512}
513
514void QNativeNode::setNodeFocusChangeHandler(QOhosConsumer<bool> focusedChangedConsumer)
515{
516 auto selfRef = QtOhos::makeQThreadSafeRef(this);
517 auto sharedConsumer = QtOhos::moveToSharedPtr(std::move(focusedChangedConsumer));
519 m_jsStateData->embeddedWindow->setFocusedChangeReceiver(
520 [selfRef, sharedConsumer = std::move(sharedConsumer)](bool focused) {
521 selfRef.visitInQtThreadIfAlive([focused, sharedConsumer](QNativeNode &) {
522 (*sharedConsumer)(focused);
523 });
524 });
525 },
526 Q_FUNC_INFO);
527}
528
529void QNativeNode::setNodeVisibilityChangeHandler(QOhosConsumer<bool> visibilityChangedConsumer)
530{
531 auto selfRef = QtOhos::makeQThreadSafeRef(this);
532 auto sharedConsumer = QtOhos::moveToSharedPtr(std::move(visibilityChangedConsumer));
534 m_jsStateData->embeddedWindow->setVisibilityChangeReceiver(
535 [selfRef, sharedConsumer = std::move(sharedConsumer)](bool visibile) {
536 selfRef.visitInQtThreadIfAlive([visibile, sharedConsumer](QNativeNode &) {
537 (*sharedConsumer)(visibile);
538 });
539 });
540 },
541 Q_FUNC_INFO);
542}
543
545{
546 return QtOhos::evalInJsThread(
547 [&](QtOhos::JsState &) {
548 return m_jsStateData->embeddedWindow->nodeScreenGeometryPixels();
549 },
550 Q_FUNC_INFO);
551}
552
554{
555 return QtOhos::evalInJsThread(
556 [&](QtOhos::JsState &) {
557 return QRect(
558 m_jsStateData->embeddedWindow->parentRelativeOffsetPixels(),
559 m_jsStateData->embeddedWindow->nodeScreenGeometryPixels().size());
560 },
561 Q_FUNC_INFO);
562}
563
564QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo QNativeNode::nodeAreaInfo() const
565{
566 return QtOhos::evalInJsThread(
567 [&](QtOhos::JsState &) {
568 return m_jsStateData->embeddedWindow->nodeAreaInfo();
569 },
570 Q_FUNC_INFO);
571}
572
573QT_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)
QArkUi::QEmbeddedWindowNode & embeddedWindowNodeInJsThread()
static QOhosPlatformIntegration * instance()
QOhosInputMethodEventHandler * inputMethodEventHandler() const
void onHoverEvent(bool isHover) override
void onInputEvent(InputEventType inputEventType, ::OHNativeWindow *window) override
void onSurfaceEvent(SurfaceEventType surfaceEventType, ::OHNativeWindow *nativeWindow) override
CallbackReceiver(QXComponentRender xComponent, QtOhos::QThreadSafeRef< QWindow > windowRef, QtOhos::QThreadSafeRef< QOhosInputMethodEventHandler > imEventHandlerRef, std::function< void(SurfaceEventType, ::OHNativeWindow *, std::optional< QSize >)> surfaceEventHandler)
QArkUi::QXComponentCallbackReceiver::InputEventType InputEventType
QArkUi::QXComponentCallbackReceiver::SurfaceEventType SurfaceEventType
void runInJsThreadAndWait(const std::function< void(JsState &)> &task, std::string callerContextName={})
bool isNativeNodeApiMouseEventsEnabled()
QXComponent< QXComponentType::Render > QXComponentRender
Definition qxcomponent.h:44
QXComponent< QXComponentType::Node > QXComponentNode
Definition qxcomponent.h:45