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