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
qohosinternalwindowid_p.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 QCORE_OHOS_INTERNALWINDOWID_P_H
5#define QCORE_OHOS_INTERNALWINDOWID_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qglobal.h>
19#include <QtCore/qstring.h>
20#include <QtCore/private/qnapi_p.h>
21#include <napi.h>
22#include <string>
23
25
26namespace QtOhos {
27
28class Q_CORE_EXPORT InternalWindowId
29{
30 enum {
32 MainWindowId = 2,
33 };
34
35public:
39
40 constexpr InternalWindowId() = default;
41
42 constexpr InternalWindowId(const InternalWindowId &) = default;
43 constexpr InternalWindowId(InternalWindowId &&) = default;
44 constexpr InternalWindowId &operator=(const InternalWindowId &) = default;
45 constexpr InternalWindowId &operator=(InternalWindowId &&) = default;
46
47 bool isMainWindowId() const;
48 bool isValid() const;
49
50 bool operator==(const InternalWindowId &other) const;
51 bool operator!=(const InternalWindowId &other) const;
52
53 bool operator<(const InternalWindowId &other) const;
54
56 QString toString() const;
57 std::string toStdString() const;
58
59private:
60 constexpr explicit InternalWindowId(int value);
61
63};
64
65}
66
67QT_END_NAMESPACE
68
69#endif
static std::unique_ptr< Node > takeOwnershipOfExternalNode(::ArkUI_NodeHandle nodeHandle)
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, bool value)
static std::unique_ptr< Node > createOrFail(::ArkUI_NodeType type)
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, std::uint32_t value)
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, std::int32_t value)
static QOhosOptional<::ArkUI_NodeHandle > tryfindChild(::ArkUI_NodeHandle nodeHandle, const std::function< bool(::ArkUI_NodeHandle)> predicate)
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, const std::array< std::uint32_t, N > &value)
Node & operator=(Node &&)=delete
T getAttributeOrFail(::ArkUI_NodeAttributeType attributeType) const
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, const std::array< float, N > &value)
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, const std::string &value)
void setEventHandler(::ArkUI_NodeEventType eventType, std::function< void(::ArkUI_NodeEvent *)> eventHandler)
Node(Node &&)=delete
::ArkUI_NodeHandle handle() const
Node(const Node &)=delete
Node & operator=(const Node &)=delete
void removeChildOrFail(Node &child)
static bool isQtManagedNode(::ArkUI_NodeHandle nodeHandle)
void setLengthMetricUnitOrFail(::ArkUI_LengthMetricUnit unit)
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, const std::array< std::int32_t, N > &value)
void setAttributeOrFail(::ArkUI_NodeAttributeType attributeType, float value)
void addChildOrFail(Node &child)
std::int32_t getAttributeOrFail(::ArkUI_NodeAttributeType attributeType) const
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
static QOhosUdmfData takeOwnership(::OH_UdmfData *nativePtr)
QOhosUdmfData(QOhosUdmfData &&)=default
QOhosUdmfData(const QOhosUdmfData &)=delete
QOhosUdmfData & operator=(const QOhosUdmfData &)=delete
::OH_UdmfData * nativePtr()
std::vector< QOhosUdmfRecord > getRecords()
QOhosUdmfData & operator=(QOhosUdmfData &&)=default
void addRecord(QOhosUdmfRecord &&record)
::OH_UdmfData * release() &&
std::vector< std::string > getTypes() const
void addEntry(QOhosUdsObject< T > udsObject)
Definition qohosudmf.h:136
QOhosUdmfRecord(QOhosUdmfRecord &&)=default
void addGeneralEntry(const std::string &typeId, std::uint8_t *buff, std::uint32_t buffSize)
QOhosUdmfRecord & operator=(QOhosUdmfRecord &&)=default
QOhosUdmfRecord(const QOhosUdmfRecord &)=delete
bool isEmpty() const
QOhosOptional< QSpan< std::uint8_t > > tryGetGeneralEntry(const std::string &typeId)
QOhosUdsObject< T > getEntry()
Definition qohosudmf.h:144
QOhosUdmfRecord & operator=(const QOhosUdmfRecord &)=delete
std::vector< std::string > getTypes() const
Definition qohosudmf.cpp:80
void setProviderForDataFetchFunc(std::vector< std::string > typeIds, std::function< void *(const char *)> dataFetchFunc)
QOhosUdsObject(QOhosUdsObject< T > &&)=default
QOhosUdsObject(const QOhosUdsObject< T > &)=delete
QOhosUdsObject< T > & operator=(QOhosUdsObject< T > &&)=default
QOhosUdsObject< T > & operator=(const QOhosUdsObject< T > &)=delete
QOhosUdsObject(typename QOhosUdsMeta< T >::Content content)
static QXComponentId createForNativeNodeMainWindow(const std::string &qAbilityInstanceId)
QXComponentId & operator=(QXComponentId &&other)=default
std::string stringId() const
static QXComponentId createForNativeNodeSubWindow(QtOhos::InternalWindowId windowId)
static QXComponentId createForRenderXComponent(QtOhos::InternalWindowId windowId)
QOhosOptional< RecognizedType > recognizedType() const
static QOhosOptional< QXComponentId > tryCreateFromXComponent(::OH_NativeXComponent *xComponent)
QNapi::Value toNapiValue(napi_env env) const
bool operator!=(const QXComponentId &other) const
bool operator==(const QXComponentId &other) const
bool operator<(const QXComponentId &other) const
QXComponentId(QXComponentId &&other)=default
static QXComponentId createForNativeNodeFloatWindow(QtOhos::InternalWindowId windowId)
QXComponentId & operator=(const QXComponentId &other)=default
QXComponentId(const QXComponentId &other)=default
QXComponent & operator=(const QXComponent &)=default
bool operator<(const QXComponent< Type > &other) const
QXComponent & operator=(QXComponent &&)=default
QXComponent(::OH_NativeXComponent *xc)
Definition qxcomponent.h:87
bool operator==(const QXComponent< Type > &other) const
Definition qxcomponent.h:94
QXComponent(const QXComponent &)=default
QXComponent(QXComponent &&)=default
::OH_NativeXComponent * handle() const
Combined button and popup list for selecting options.
std::unique_ptr< T, void(*)(T *)> createUds()
QT_BEGIN_NAMESPACE QOhosOptional<::PIXEL_FORMAT > tryMapQtPixelFormatToOhosPixelFormat(QImage::Format format)
QNapi::Object createNapiPixelMapFromQImage(QtOhos::JsState &jsState, const QImage &image)
std::shared_ptr<::OH_PixelmapNative > makeEmptyNativePixelMap()
QImage createQImageFromNativePixelMap(::OH_PixelmapNative *pixelMap)
std::shared_ptr<::OH_PixelmapNative > wrapNativePixelMapPtr(::OH_PixelmapNative *pixelMap)
QT_BEGIN_NAMESPACE std::shared_ptr<::OH_PixelmapNative > createNativePixelMapFromQImage(QImage qImage)
QXComponentType
Definition qxcomponent.h:17
QXComponent< QXComponentType::Render > QXComponentRender
Definition qxcomponent.h:43
QXComponent< QXComponentType::Node > QXComponentNode
Definition qxcomponent.h:44
::ArkUI_GestureEvent * event
static constexpr const char * udmfMetaId
static QArkUi::CZString getDefaultContent()