7#include <QtCore/private/qohoscommon_p.h>
8#include <QtCore/qglobal.h>
9#include <QtCore/qmimedata.h>
10#include <QtCore/qobject.h>
11#include <QtCore/qpoint.h>
12#include <QtCore/qrect.h>
13#include <QtGui/qcolor.h>
14#include <QtGui/qimage.h>
15#include <QtGui/qwindow.h>
16#include <arkui/native_node.h>
17#include <arkui/native_type.h>
20#include <native_window/external_window.h>
22#include <qarkui/qqtembeddedwindownode.h>
23#include <qohosforeignwindow.h>
24#include <qohosjsscopedataowner.h>
25#include <qohosplatformwindow.h>
26#include <qohosplugincore.h>
27#include <render/qohossurface.h>
28#include <render/qxcomponent.h>
69 const std::vector<QImage> &images,
const QPointF &hotspot,
70 const QMimeData &mimeData, QOhosConsumer<Qt::DropAction> dropActionConsumer,
71 JsCallBatch &jsCallBatch = JsCallBatch::immediate());
74 QOhosConsumer<QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo> areaChangeEventConsumer,
77 QOhosConsumer<
bool> focusedChangedConsumer, JsCallBatch &jsCallBatch =
JsCallBatch::
immediate());
79 QOhosConsumer<
bool> visibilityChangedConsumer, JsCallBatch &jsCallBatch =
JsCallBatch::
immediate());
97 std::shared_ptr<
QArkUi::QQtEmbeddedWindowNode> embeddedWindow;
100 void handleSurfaceEvent(
102 ::OHNativeWindow *nativeWindow,
103 const std::optional<QSize> &optSurfaceSize);
106 std::unique_ptr<QOhosSurface> m_optSurface;
107 QRectF m_nodeGeometry;
void setPosition(QPoint position, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setSaturation(int saturation, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setTransparentForInput(bool transparentForInput, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setNodeVisibilityChangeHandler(QOhosConsumer< bool > visibilityChangedConsumer, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setSize(const QSizeF &size, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QRect nodeParentRelativeGeometryPixels() const
void detachFromParentIfPresent(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QOhosSurface * surfaceOrNull() const
void setBackgroundColor(const QColor &color, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QRect nodeScreenGeometryPixels() const
void lower(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void fillToParent(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setParent(std::shared_ptr< QXComponentNode > xComponent, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setContrast(int contrast, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void enableDropDisallowedBadge(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setNodeAreaChangeHandler(QOhosConsumer< QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo > areaChangeEventConsumer, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setFocused(bool focused, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void externalContentClickDetected()
QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo nodeAreaInfo() const
void setVisibility(bool visible, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QNativeNode(const CreateInfo &nativeNodeCreateInfo)
void setFocusable(bool focusable, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setNodeFocusChangeHandler(QOhosConsumer< bool > focusedChangedConsumer, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void addForeignWindowChild(QOhosForeignWindow *foreignWindow)
void raise(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setBrightness(int brightness, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setSizeParentFillPercentNormalized(const QSizeF &size, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setParent(QNativeNode &other)
QArkUi::QEmbeddedWindowNode & embeddedWindowNodeInJsThread()
QOhosForeignWindow(QWindow *qWindow, WId windowId)
void initialize() override
Called as part of QWindow::create(), after constructing the window.
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
void setGeometry(const QRect &unscaledGeometry) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
bool isForeignWindow() const override
QMargins frameMargins() const override
QOhosPropertiesProvider(QOhosPropertiesStore &store)
std::optional< T > tryGetProperty() const
std::shared_ptr< void > addPropertyWriteCallback(QOhosConsumer< T > propertyWriteCallback)
QOhosPropertiesStore(QObject *qObject)
std::shared_ptr< void > addPropertyWriteCallback(QOhosConsumer< T > propertyWriteCallback)
std::optional< T > tryGetProperty() const
void notifyPropertyWrite(const QByteArray &propertyName)
bool isWindowPcModeEnabled() const
static QOhosSettings & instance()
double fontSizeScale() const
QOhosSettings(const QOhosSettings &)=delete
QOhosSettings(QOhosSettings &&)=delete
QOhosSettings & operator=(const QOhosSettings &)=delete
QOhosSettings & operator=(QOhosSettings &&)=delete
void setExtraUsageBitsForNativeWindowBuffer(std::uint64_t usageSetBits)
::OHNativeWindow * nativeWindow() const
static constexpr ::OH_NativeBuffer_Format bufferFormat
void paintOnNativeWindowSurface(std::function< std::vector<::Region::Rect >(QImage &, ::BufferHandle *)> paintFunc, std::function< void(::BufferHandle *)> onFlushSuccessFunc)
static std::optional< QSize > tryGetBufferGeometryForWindow(::OHNativeWindow *nativeWindow)
void setNativeWindowSurface(::OHNativeWindow *nativeWindow, const std::optional< QSize > &optSurfaceSize)
static QImage::Format mapNativeBufferFormatToQImageFormatOrFail(std::int32_t format)
std::optional< QSize > surfaceResolution() const
QOhosSurface(::OHNativeWindow *nativeWindow)
EGLSurface tryGetOrCreateEGLWindowSurface(EGLDisplay display, EGLConfig config, bool swappingBuffers)
void clearNativeWindowSurface()
void windowStatusChange(QOhosWindowProxy::WindowStatus windowStatus)
void setParentOrReparent(QOhosView &parentView)
bool consumePendingSelfMinimizeEcho()
void setCursor(const QCursor &cursor)
void handleWindowFlagsChange(Qt::WindowFlags previousWindowFlags, Qt::WindowFlags currentWindowFlags)
void addForeignWindowChild(QOhosForeignWindow *foreignWindow)
void handleWindowStateChange(Qt::WindowStates previousWindowState, Qt::WindowStates currentWindowState)
void setFocusable(bool focusable)
QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo nodeAreaInfo() const
QOhosSurface * surfaceOrNull() const
void windowVisibilityChange(bool visibility)
QList< QRect > displayCutoutRects() const
void setTransparentBackground(bool transparent)
void setModality(Qt::WindowModality modality)
bool isFullscreenImmersiveModeEnabled()
void setFramelessWindow(bool frameless)
QPixmap makeSnapshot() const
void setWindowTransparentForInput(bool transparentForInput)
void tryDetachFromEmbeddedParent()
ViewType viewType() const
QMargins avoidAreaMargins(QOhosWindowProxy::AvoidAreaType type) const
QWindow * ownerWindow() const
void handleSurfaceContentsUpdated()
void windowRectChanged(QOhosWindowProxy::RectChangeOptions rectChangeOptions)
void windowRectChangedInGlobalDisplay(QOhosWindowProxy::RectChangeOptions rectChangeOptions)
void forceGeometryUpdate()
void externalContentInteractionDetected()
void setWindowMinMaxCloseButtonState(const WindowMinMaxCloseButtonsState &state)
void setWindowMask(const QOhosWindowProxy::WindowMask &windowMask)
void setSizeLimits(const QSize &minSize, const QSize &maxSize)
std::optional< QSize > surfaceResolution() const
QHarmonyJsObjectRef abilityObjectRef() const
QOhosView(QWindow *ownerWindow, QSharedPointer< QNativeNode > nativeNode, QOhosPropertiesProvider propertiesProvider, QWindow *optLogicalParent)
void windowTouchOutside()
void nodeAreaChanged(QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo areaChangeEvt)
void handlePaletteChange()
void windowResizeRejected(QSize rejectedSize)
void windowDisplayIdChanged(QOhosDisplayInfo::JsDisplayId)
static std::unique_ptr< QOhosView > createForWindow(QOhosPlatformWindow *window, QOhosPropertiesProvider windowPropertiesProvider)
void setOpacity(qreal opacity)
QHarmonyJsObjectRef jsWindowObjectRef() const
void windowMoveRejected(QPoint rejectedPosition)
void setWindowStaysOnTop(bool staysOnTop)
ViewGeometry viewGeometry() const
void avoidAreaChanged(QOhosWindowProxy::AvoidAreaType avoidAreaType, const QOhosWindowProxy::AvoidArea &avoidArea)
void setSize(const QSize &size)
void setPosition(const QPoint &position)
bool isSubWindowCoveringFullScreen() const
void surfaceStatusChanged(const std::optional< QSize > &optSurfaceSize)
QRect nodeParentRelativeGeometryPixels() const
void setTitle(const QString &title)
void startDrag(const std::vector< QImage > &images, const QPointF &hotspot, const QMimeData &mimeData, QOhosConsumer< Qt::DropAction > dropActionConsumer)
const QOhosView * viewParentOrNull() const
QRect nodeScreenGeometryPixels() const
QtOhosQpa::enums::ohos::window::AvoidAreaType AvoidAreaType
bool sendEvent(WindowSystemEvent *event) override
static JsCallBatch & immediate()
JsScopeDataOwner(const JsScopeDataOwner &)=delete
JsScopeData & operator*() const
JsScopeData * operator->() const
JsScopeDataOwner & operator=(const JsScopeDataOwner &)=delete
void addAsyncCleanup(std::function< void(QOhosJsState &, JsScopeData &, QOhosTaskPromise<>)> cleanupFunc)
JsScopeDataOwner & operator=(JsScopeDataOwner &&)=delete
JsScopeDataOwner(JsScopeDataOwner &&)=delete
Combined button and popup list for selecting options.
@ ForwardToGuiApplication
QOhosView * mapQWindowToViewOrNull(QWindow *window)
std::optional< T > tryMapFromQVariant(QVariant variant)
const char * qObjectOhosPropertyName()
std::shared_ptr< QWindowSystemEventHandler > makeApplicationStateTracker()
bool isHandheldDeviceType()
QOhosRuntimeDeviceTypeAndMode
@ HandheldDeviceFullScreen
@ HandheldDeviceWindowPcMode
constexpr QOhosRuntimeDeviceTypeAndMode operator|(QOhosRuntimeDeviceTypeAndMode lhs, QOhosRuntimeDeviceTypeAndMode rhs)
QOhosRuntimeDeviceTypeAndMode queryQOhosRuntimeDeviceAndMode()
void setQOhosPropertyOnQObject(QObject *qObject, T propertyValue)
std::optional< T > tryGetQOhosPropertyFromQObject(QObject *qObject)
QXComponent< QXComponentType::Node > QXComponentNode
std::optional< QNativeNode * > optParent
std::optional<::ArkUI_RenderFit > renderFitPolicyHint
std::optional< QColor > backgroundColor
bool disableWindowFocusableBeforeLoadContent
std::optional< QOhosDisplayInfo::JsDisplayId > displayId