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/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
142 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
143 using ParentDescriptor = QArkUi::QEmbeddedWindowNode::ParentDescriptor;
144
145 std::optional<ParentDescriptor> optParentDescriptor;
146 if (nativeNodeCreateInfo.optParent.has_value()) {
147 auto *parentNode = nativeNodeCreateInfo.optParent.value()->m_jsStateData->embeddedWindow.get();
148 optParentDescriptor = ParentDescriptor(*parentNode);
149 }
150
151 QArkUi::QQtEmbeddedWindowNode::CreateInfo createInfo = {
152 .offset = nativeNodeCreateInfo.geometry.topLeft(),
153 .size = nativeNodeCreateInfo.geometry.size(),
154 .xComponentId = QXComponentId::createForRenderXComponent(windowId),
155 .xComponentType = ::ArkUI_XComponentType::ARKUI_XCOMPONENT_TYPE_SURFACE,
156 .focusOnTouch = false,
157 .focusable = focusable,
158 .optParent = optParentDescriptor,
159 .sizePolicy = QArkUi::QEmbeddedWindowNode::SizePolicy::Points,
160 .renderFit = renderFit,
161 .backgroundColor = nativeNodeCreateInfo.backgroundColor,
162 };
163
164 m_jsStateData->embeddedWindow = QArkUi::QQtEmbeddedWindowNode::createOrFail(createInfo);
165 m_jsStateData->embeddedWindow->setCallbackReceiver(
166 std::make_unique<CallbackReceiver>(
167 m_jsStateData->embeddedWindow->renderXComponent(),
168 qWindowRef, imEventHandlerRef,
169 [selfRef](SurfaceEventType type, ::OHNativeWindow *window, std::optional<QSize> optSurfaceSize) {
170 selfRef.visitInQtThreadIfAlive(
171 [type, window, optSurfaceSize](auto &self) {
172 self.handleSurfaceEvent(type, window, optSurfaceSize);
173 });
174 }));
175
176 m_jsStateData->embeddedWindow->setTouchInterceptReceiver(
177 [selfRef, embeddedWindow = m_jsStateData->embeddedWindow.get()](const ::ArkUI_UIInputEvent *event) {
178 auto eventAction = ::OH_ArkUI_UIInputEvent_GetAction(event);
179
180 if (eventAction != ::UI_MOUSE_EVENT_ACTION_PRESS && eventAction != ::UI_TOUCH_EVENT_ACTION_DOWN)
181 return;
182
183 if (!embeddedWindow->hasNonQtManagedChildren())
184 return;
185
186 selfRef.visitInQtThreadIfAlive(
187 [](QNativeNode &node) {
188 Q_EMIT node.externalContentClickDetected();
189 });
190 });
191
192 auto sharedAxisEventHandler = QtOhos::moveToSharedPtr(
193 makeQOhosNativeAxisEventHandler(qWindowRef, imEventHandlerRef));
194 m_jsStateData->embeddedWindow->setAxisEventsHandler(
195 [sharedAxisEventHandler](auto *event) {
196 (*sharedAxisEventHandler)(QOhosAxisEventType::AxisEvent, event);
197 }
198 );
199 m_jsStateData->embeddedWindow->setCoastingAxisEventsHandler(
200 [sharedAxisEventHandler](auto *event) {
201 (*sharedAxisEventHandler)(QOhosAxisEventType::CoastingAxisEvent, event);
202 });
203 m_jsStateData->embeddedWindow->setGesturesHandler(
204 makeQOhosArkUiNativeGesturesHandler(qWindowRef));
205 m_jsStateData->embeddedWindow->setDragEventsHandler(makeQOhosNativeDragEventsHandler(qWindowRef));
206 if (QtOhos::isNativeNodeApiKeyEventsEnabled())
207 m_jsStateData->embeddedWindow->setKeyEventsHandler(makeQOhosNativeKeyEventsHandler(qWindowRef, imEventHandlerRef));
208 if (QtOhos::isNativeNodeApiMouseEventsEnabled()) {
209 m_jsStateData->embeddedWindow->setMouseEventsHandler(
210 makeQOhosNativeMouseEventsHandler(qWindowRef, imEventHandlerRef));
211 m_jsStateData->embeddedWindow->setHoverEventsHandler(
212 [qWindowRef, imEventHandlerRef](QArkUi::NativeNodeHoverEvent hoverEvent) {
213 if (hoverEvent.isHovered)
214 return;
215 imEventHandlerRef.visitInQtThreadIfAlive(
216 [qWindowRef](QOhosInputMethodEventHandler &imEventHandler) {
217 QWindow *qWindow = qWindowRef.data();
218 if (qWindow)
219 imEventHandler.onHoverEvent(QOhosHoverEvent { .targetWindow = qWindow });
220 });
221 });
222 }
223 },
224 Q_FUNC_INFO);
225}
226
228{
229 return m_nodeGeometry;
230}
231
233{
234 QOhosJsThreadGateway::runAndWait(
235 [&](QOhosJsState &) {
236 m_jsStateData->embeddedWindow->setSizeParentFillPercentageNormalized(size);
237 },
238 Q_FUNC_INFO);
239}
240
241void QNativeNode::setSize(const QSizeF &size)
242{
243 m_nodeGeometry.setSize(size.toSize());
244 QOhosJsThreadGateway::runAndWait(
245 [&](QOhosJsState &) {
246 m_jsStateData->embeddedWindow->setSize(size);
247 },
248 Q_FUNC_INFO);
249}
250
251void QNativeNode::setPosition(QPoint position)
252{
253 m_nodeGeometry.setTopLeft(position);
254 QOhosJsThreadGateway::runAndWait(
255 [&](QOhosJsState &) {
256 m_jsStateData->embeddedWindow->setPosition(position);
257 },
258 Q_FUNC_INFO);
259}
260
261void QNativeNode::setVisibility(bool visible)
262{
263 QOhosJsThreadGateway::runAndWait(
264 [&](QOhosJsState &) {
265 m_jsStateData->embeddedWindow->setNodeVisibility(visible);
266 },
267 Q_FUNC_INFO);
268}
269
270QOhosSurface *QNativeNode::surfaceOrNull() const
271{
272 return m_optSurface.get();
273}
274
276{
277 QOhosJsThreadGateway::runAndWait(
278 [&](QOhosJsState &) {
279 m_jsStateData->embeddedWindow->setPosition(QPointF(0, 0));
280 m_jsStateData->embeddedWindow->setSizeParentFillPercentageNormalized(QSizeF(1.0, 1.0));
281 },
282 Q_FUNC_INFO);
283}
284
285void QNativeNode::handleSurfaceEvent(
286 SurfaceEventType surfaceEventType,
287 ::OHNativeWindow *nativeWindow,
288 const std::optional<QSize> &optSurfaceSize)
289{
290 qCDebug(QtForOhos, "Surface event: %d window: %p", surfaceEventType, nativeWindow);
291 switch (surfaceEventType) {
293 {
294 // NOTE - Its possible to receive surface changed event with null nativeWindow
295 if (nativeWindow == nullptr) {
296 m_optSurface.reset();
297 } else if (m_optSurface) {
298 m_optSurface->setNativeWindowSurface(nativeWindow, optSurfaceSize);
299 } else {
300 m_optSurface = std::make_unique<QOhosSurface>(nativeWindow);
301 }
302 break;
303 }
304 case SurfaceEventType::SurfaceCreated:
305 m_optSurface = std::make_unique<QOhosSurface>(nativeWindow);
306 break;
307 case SurfaceEventType::SurfaceDestroyed:
308 m_optSurface.reset();
309 break;
310 }
311 Q_EMIT surfaceStatusChanged(optSurfaceSize);
312}
313
315{
316 return QOhosJsThreadGateway::eval([&](QOhosJsState &) {
317 return reinterpret_cast<WId>(m_jsStateData->embeddedWindow->qtWindowId());
318 },
319 Q_FUNC_INFO);
320}
321
322void QNativeNode::setParent(std::shared_ptr<QXComponentNode> xComponent)
323{
324 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &){
325 m_jsStateData->embeddedWindow->setParentOrReparent(
326 QArkUi::QEmbeddedWindowNode::ParentDescriptor(xComponent));
327 },
328 Q_FUNC_INFO);
329}
330
332{
333 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &){
334 m_jsStateData->embeddedWindow->setParentOrReparent(
335 QArkUi::QEmbeddedWindowNode::ParentDescriptor(*other.m_jsStateData->embeddedWindow));
336 },
337 Q_FUNC_INFO);
338}
339
341{
342 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &){
343 auto &window = *m_jsStateData->embeddedWindow;
344 window.raise();
345 },
346 Q_FUNC_INFO);
347}
348
350{
351 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &){
352 auto &window = *m_jsStateData->embeddedWindow;
353 window.lower();
354 },
355 Q_FUNC_INFO);
356}
357
359{
360 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
361 auto &window = *m_jsStateData->embeddedWindow;
362 window.detachFromParentIfPresent();
363 },
364 Q_FUNC_INFO);
365}
366
367void QNativeNode::setFocused(bool focused)
368{
369 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
370 m_jsStateData->embeddedWindow->setFocused(focused);
371 },
372 Q_FUNC_INFO);
373}
374
375void QNativeNode::setFocusable(bool focusable)
376{
377 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
378 m_jsStateData->embeddedWindow->setFocusable(focusable);
379 },
380 Q_FUNC_INFO);
381}
382
383void QNativeNode::setBackgroundColor(const QColor &color)
384{
385 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
386 m_jsStateData->embeddedWindow->setBackgroundColor(color);
387 },
388 Q_FUNC_INFO);
389}
390
391void QNativeNode::setBrightness(int brightness)
392{
393 QOhosJsThreadGateway::runAndWait(
394 [&](QOhosJsState &) {
395 m_jsStateData->embeddedWindow->setBrightness(brightness);
396 },
397 Q_FUNC_INFO);
398}
399
400void QNativeNode::setContrast(int contrast)
401{
402 QOhosJsThreadGateway::runAndWait(
403 [&](QOhosJsState &) {
404 m_jsStateData->embeddedWindow->setContrast(contrast);
405 },
406 Q_FUNC_INFO);
407}
408
409void QNativeNode::setSaturation(int saturation)
410{
411 QOhosJsThreadGateway::runAndWait(
412 [&](QOhosJsState &) {
413 m_jsStateData->embeddedWindow->setSaturation(saturation);
414 },
415 Q_FUNC_INFO);
416}
417
418void QNativeNode::startDrag(
419 const std::vector<QImage> &images, const QPointF &hotspot,
420 const QMimeData &mimeData, QOhosConsumer<Qt::DropAction> dropActionConsumer)
421{
422 auto udmfDataFactory = makeUdmfDataFactoryFromQMimeData(mimeData, {});
423
424 QOhosJsThreadGateway::runAndWait(
425 [&](QOhosJsState &) {
426 qOhosPrintfDebug("%s: starting drag", Q_FUNC_INFO);
427
428 std::vector<std::shared_ptr<::OH_PixelmapNative>> pixelMaps;
429 std::transform(
430 images.begin(), images.end(), std::back_inserter(pixelMaps),
431 &makeOhosNativePixelMapFromQImage);
432
433 struct DragContext
434 {
435 QOhosConsumer<Qt::DropAction> dropActionConsumer;
436 std::shared_ptr<void> startedDragHandle;
437 };
438 auto context = std::make_shared<DragContext>();
439 context->dropActionConsumer = std::move(dropActionConsumer);
440
441 auto startedDragHandle = m_jsStateData->embeddedWindow->startDrag(
442 std::move(pixelMaps), hotspot,
443 udmfDataFactory(),
444 [context](::ArkUI_DragAndDropInfo *dragAndDropInfo) mutable {
445 auto dragStatus = QArkUi::callArkUi(
446 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragAndDropInfo_GetDragStatus),
447 dragAndDropInfo);
448 qOhosPrintfDebug("%s: drag status: %d", Q_FUNC_INFO, static_cast<int>(dragStatus));
449
450 if (dragStatus == ::ARKUI_DRAG_STATUS_ENDED && context) {
451 auto *dragEvent = QArkUi::callArkUiOrFailOnNullResult(
452 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragAndDropInfo_GetDragEvent),
453 dragAndDropInfo);
454
455 ::ArkUI_DragResult dragResult = ::ARKUI_DRAG_RESULT_FAILED;
456 QArkUi::callArkUiOrFailOnErrorResult(
457 Q_OHOS_NAMED_FUNC(::OH_ArkUI_DragEvent_GetDragResult),
458 dragEvent, &dragResult);
459
460 auto qtDropAction =
461 dragResult == ::ARKUI_DRAG_RESULT_SUCCESSFUL
462 ? mapQOhosArkUiDropOperationToQt(
463 getQOhosDragEventDropOperation(dragEvent))
464 : Qt::IgnoreAction;
465
466 qOhosPrintfDebug(
467 "%s: sending drag-end notification: %d / %d",
468 Q_FUNC_INFO, static_cast<int>(dragResult), static_cast<int>(qtDropAction));
469 QtOhos::invokeInQtThread(
470 [dropActionConsumer = std::move(context->dropActionConsumer), qtDropAction]() {
471 dropActionConsumer(qtDropAction);
472 });
473 context.reset();
474 }
475 });
476 context->startedDragHandle = startedDragHandle;
477 },
478 Q_FUNC_INFO);
479}
480
482{
483 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
484 m_jsStateData->embeddedWindow->enableDropDisallowedBadge();
485 },
486 Q_FUNC_INFO);
487}
488
489void QNativeNode::addForeignWindowChild(QOhosForeignWindow *foreignWindow)
490{
491 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
492 auto &child = foreignWindow->embeddedWindowNodeInJsThread();
493 auto parentDescriptor = QArkUi::QEmbeddedWindowNode::ParentDescriptor(*m_jsStateData->embeddedWindow);
494 child.setParentOrReparent(parentDescriptor);
495 },
496 Q_FUNC_INFO);
497}
498
499void QNativeNode::setTransparentForInput(bool transparentForInput)
500{
501 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
502 m_jsStateData->embeddedWindow->setHitTestMode(
503 transparentForInput
504 ? ::ARKUI_HIT_TEST_MODE_NONE
505 : ::ARKUI_HIT_TEST_MODE_DEFAULT);
506 },
507 Q_FUNC_INFO);
508}
509
510void QNativeNode::setNodeAreaChangeHandler(QOhosConsumer<QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo> areaChangeEventConsumer)
511{
512 auto selfRef = QtOhos::makeQThreadSafeRef(this);
513 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
514 m_jsStateData->embeddedWindow->setAreaChangeReceiver(
515 QtOhos::makeCompressingAsyncConsumer(
516 std::move(areaChangeEventConsumer),
517 [selfRef](auto task) {
518 selfRef.visitInQtThreadIfAlive([task = std::move(task)](QNativeNode &) {
519 task();
520 });
521 }));
522 },
523 Q_FUNC_INFO);
524}
525
526void QNativeNode::setNodeFocusChangeHandler(QOhosConsumer<bool> focusedChangedConsumer)
527{
528 auto selfRef = QtOhos::makeQThreadSafeRef(this);
529 auto sharedConsumer = QtOhos::moveToSharedPtr(std::move(focusedChangedConsumer));
530 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
531 m_jsStateData->embeddedWindow->setFocusedChangeReceiver(
532 [selfRef, sharedConsumer = std::move(sharedConsumer)](bool focused) {
533 selfRef.visitInQtThreadIfAlive([focused, sharedConsumer](QNativeNode &) {
534 (*sharedConsumer)(focused);
535 });
536 });
537 },
538 Q_FUNC_INFO);
539}
540
541void QNativeNode::setNodeVisibilityChangeHandler(QOhosConsumer<bool> visibilityChangedConsumer)
542{
543 auto selfRef = QtOhos::makeQThreadSafeRef(this);
544 auto sharedConsumer = QtOhos::moveToSharedPtr(std::move(visibilityChangedConsumer));
545 QOhosJsThreadGateway::runAndWait([&](QOhosJsState &) {
546 m_jsStateData->embeddedWindow->setVisibilityChangeReceiver(
547 [selfRef, sharedConsumer = std::move(sharedConsumer)](bool visibile) {
548 selfRef.visitInQtThreadIfAlive([visibile, sharedConsumer](QNativeNode &) {
549 (*sharedConsumer)(visibile);
550 });
551 });
552 },
553 Q_FUNC_INFO);
554}
555
557{
558 return QOhosJsThreadGateway::eval(
559 [&](QOhosJsState &) {
560 return m_jsStateData->embeddedWindow->nodeScreenGeometryPixels();
561 },
562 Q_FUNC_INFO);
563}
564
566{
567 return QOhosJsThreadGateway::eval(
568 [&](QOhosJsState &) {
569 return QRect(
570 m_jsStateData->embeddedWindow->parentRelativeOffsetPixels(),
571 m_jsStateData->embeddedWindow->nodeScreenGeometryPixels().size());
572 },
573 Q_FUNC_INFO);
574}
575
576QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo QNativeNode::nodeAreaInfo() const
577{
578 return QOhosJsThreadGateway::eval(
579 [&](QOhosJsState &) {
580 return m_jsStateData->embeddedWindow->nodeAreaInfo();
581 },
582 Q_FUNC_INFO);
583}
584
585QT_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