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
qohoswindowproxy.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 QOHOSWINDOWPROXY_H
5#define QOHOSWINDOWPROXY_H
6
7#include <QtCore/private/qnapi_p.h>
8#include <QtCore/private/qohoscommon_p.h>
9#include <QtCore/qflags.h>
10#include <QtCore/qglobal.h>
11#include <QtCore/qharmonyjsobjectref.h>
12#include <QtCore/qobject.h>
13#include <QtCore/qpoint.h>
14#include <QtCore/qpointer.h>
15#include <QtCore/qrect.h>
16#include <QtCore/qsize.h>
17#include <QtGui/qcolor.h>
18#include <QtGui/qeventpoint.h>
19#include <QtGui/qwindow.h>
20#include <functional>
21#include <cstdint>
22#include <memory>
23#include <optional>
24#include <qarkui/input.h>
25#include <qarkui/window.h>
26#include <qohosdisplayinfo.h>
27#include <qohosjsscopedataowner.h>
28#include <qohosplugincore.h>
29#include <qohosqpaenums.h>
30#include <qohosutils.h>
31#include <render/qohoswindowproxydatafactory.h>
32#include <render/qxcomponent.h>
33#include <set>
34
36
37class QOhosWindowProxy final
38{
39public:
41
43
45
47
49
51
53
58
63
65 {
66 std::optional<double> minWidth;
67 std::optional<double> minHeight;
68 std::optional<double> maxWidth;
69 std::optional<double> maxHeight;
70 };
71
80
86
91
93 {
94 std::optional<QOhosDisplayInfo::JsDisplayId> displayId;
95 };
96
106
116
118 {
119 std::optional<bool> focusOnShow;
120 };
121
123
137
142
143 static std::shared_ptr<QOhosWindowProxy> createMainWindow(const MainWindowCreateInfo &createInfo);
144 static std::shared_ptr<QOhosWindowProxy>
146 static std::shared_ptr<QOhosWindowProxy> createFloatWindow(const FloatWindowCreateInfo &createInfo);
147
148 QOhosWindowProxy(const QOhosWindowProxy &) = delete;
149 QOhosWindowProxy(QOhosWindowProxy &&) = delete;
150 QOhosWindowProxy &operator=(const QOhosWindowProxy &) = delete;
151 QOhosWindowProxy &operator=(QOhosWindowProxy &&) = delete;
152
154
156 const QPoint &position, std::optional<QOhosDisplayInfo::JsDisplayId> optDisplayId,
158
159 void setSize(const QSize &size, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
161 const QPoint &position, const MoveConfiguration &moveConfiguration,
163 void setWindowBackgroundColor(const QColor &color, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
164 void setCustomCursor(
165 const QImage &customCursorImage, const QPoint &hotSpot, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
166 void setPointerStyleSync(const QCursor &cursor, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
167 void setWindowPrivacyMode(bool privacyMode, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
168 void setWindowFocusable(bool focusable, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
169 void setWindowTouchable(bool touchable, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
170 void setWindowLimits(
171 const QSize &minSize, const QSize &maxSize, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
172 void setWindowMask(
173 const WindowMask &windowMask, const std::optional<QSize> &ohosMaskSizeOverride = {},
177 void setTitle(const QString &title, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
179 bool maximizeVisible, bool minimizeVisible, bool closeVisible,
181 void setWindowTopmost(bool topmost, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
182 void setWindowDecorVisible(bool visible, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
183 void setWindowTitleMoveEnabled(bool enabled, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
184 void setWindowShadowRadius(double radius, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
185 void setWindowCornerRadius(double radius, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
186 void setWindowRectAutoSave(bool enabed, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
187 bool isWindowRectAutoSave() const;
189 void setWindowKeepScreenOn(bool keepScreenOn, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
190
192 const std::set<SupportWindowMode> &supportedWindowModes, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
193
194 void setSubWindowCloseHandler(std::function<void()> handler, bool handlerReturnValue);
196
198 void showWindow(
200 void recover(JsCallBatch &jsCallBatch = JsCallBatch::immediate());
201 void restore(JsCallBatch &jsCallBatch = JsCallBatch::immediate());
202 bool tryMaximize(MaximizePresentation maximizePresentation);
203 void minimize(JsCallBatch &jsCallBatch = JsCallBatch::immediate());
204 void setWindowLayoutFullScreen(bool isLayoutFullScreen, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
205 void setWindowSystemBarEnable(const QStringList &names, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
208 bool tryHideAbility();
211 QPixmap snapshot() const;
212 bool startMoving();
213 void enableDrag(bool enable, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
214
215 std::optional<bool> isFocused() const;
216
219 std::unique_ptr<WindowCallbacks> receiver, JsCallBatch &jsCallBatch = JsCallBatch::immediate());
221 QObject *contextObject, QOhosConsumer<std::vector<NonClientAreaMouseEvent>> mouseEventBatchConsumer,
224 QObject *contextObject, QOhosConsumer<std::vector<NonClientAreaTouchEvent>> touchEventBatchConsumer,
226
227 std::shared_ptr<QOhosWindowProxy> createSubWindow(const SubWindowCreateInfo &createInfo);
228
229 bool qtIsMainWindow() const;
230 bool isSubWindowMaximizeSupported() const;
233 std::shared_ptr<QXComponentNode> nodeXComponent() const;
234 std::string qAbilityInstanceId() const;
237
239 QOhosDisplayInfo::JsDisplayId displayId, const QPoint &queryLocation,
240 std::uint32_t queryLimit = 0);
242 const std::function<bool(QOhosJsState &jsState, const QArkUi::JsWindowRef &)> &predicate);
243
244 std::optional<QOhosDisplayInfo::JsDisplayId> tryGetMainWindowJsDisplayId() const;
245 bool tryShiftAppWindowFocus(QOhosWindowProxy &targetProxy);
246
247private:
248 enum class EventHandlerFlagBits
249 {
250 allowCallWhenAbilityIsTerminating = 1 << 0,
251 allowEventHandlerRegistrationFailure = 1 << 1,
252 };
253
254 struct JsScopeData : public std::enable_shared_from_this<JsScopeData>
255 {
264
265 JsScopeData();
266 JsScopeData(
267 WindowProxyType windowProxyType, QNapi::Reference<QNapi::Object> jsWindow,
268 std::shared_ptr<void> optKeepAliveData,
269 std::shared_ptr<QtOhos::QAbilityPeer> qAbilityPeer,
270 QtOhos::QObjectThreadSafeRef owningQWindowRef);
271 JsScopeData(JsScopeData &&) = default;
272 JsScopeData &operator=(JsScopeData &&) = default;
273 ~JsScopeData();
274 JsScopeData(const JsScopeData &) = delete;
275 JsScopeData &operator=(const JsScopeData &) = delete;
276
277 std::shared_ptr<void> registerEventListener(
278 const std::string &eventName,
279 void (JsScopeData::*handleFunctions)(const QtOhos::CallbackInfo &),
280 QFlags<EventHandlerFlagBits> eventHandlerFlags);
281 std::shared_ptr<void> registerSubWindowCloseHandler(
282 QOhosJsState &jsState,
283 std::function<bool()> handler);
284 void handleWindowEventCallback(const QtOhos::CallbackInfo &cbInfo);
285 void handleWindowStatusCallback(const QtOhos::CallbackInfo &cbInfo);
286 void handleWindowVisibilityCallback(const QtOhos::CallbackInfo &cbInfo);
287 void handleWindowSizeChangeCallback(const QtOhos::CallbackInfo &cbInfo);
288 void handleWindowTouchOutsideCallback(const QtOhos::CallbackInfo &cbInfo);
289 void handleAvoidAreaChangeCallback(const QtOhos::CallbackInfo &cbInfo);
290 void handleWindowRectChangeCallback(const QtOhos::CallbackInfo &cbInfo);
291 void handleWindowRectChangeInGlobalDisplayCallback(const QtOhos::CallbackInfo &cbInfo);
292 void handleWindowDisplayIdChangeCallback(const QtOhos::CallbackInfo &cbInfo);
293 void onWindowEvent(QtOhos::JsState &jsState, const WindowEvent &windowEvent);
294 bool isWindowClosing() const;
295
296 WindowProxyType windowProxyType = {};
297 std::shared_ptr<WindowCallbacks> windowCallbackReceiver;
298 bool windowDestroyedFromSystem = false;
299 std::shared_ptr<void> optKeepAliveData;
300 std::shared_ptr<QtOhos::QAbilityPeer> qAbilityPeer;
301 std::shared_ptr<NonClientAreaEventsDispatcher> nonClientAreaEventsDispatcher;
302 std::shared_ptr<void> m_windowFrameMouseFilterHandle;
303 std::shared_ptr<void> m_windowFrameTouchFilterHandle;
304 std::shared_ptr<void> m_eventListenersHandle;
305 std::shared_ptr<QArkUi::JsWindowRef> jsWindowRef;
306 };
307
308 struct EventHandlerDescriptor
309 {
310 const char *eventName;
311 void (JsScopeData::*eventHandler)(const QtOhos::CallbackInfo &);
312 QFlags<EventHandlerFlagBits> eventHandlerFlags;
313 };
314
315 struct JsThreadInitResult
316 {
317 WindowProxyType windowProxyType;
318 bool subWindowMaximizeSupported;
319 std::shared_ptr<QXComponentNode> nodeXComponent;
320 std::string qAbilityInstanceId;
321 QHarmonyJsObjectRef abilityObjectRef;
322 QHarmonyJsObjectRef jsWindowObjectRef;
323 std::shared_ptr<void> jsWindowRegistrationHandle;
324 };
325
326 QOhosWindowProxy(
327 const std::function<void(QtOhos::JsState &, QOhosConsumer<QtOhos::JsState &, QOhosWindowProxyData>)> &makeWindowProxyDataInJsThread);
328 JsThreadInitResult initInJsThread(QtOhos::JsState &jsState, QOhosWindowProxyData windowProxyData);
329
330 std::shared_ptr<void> registerSubWindowCloseHandler(
331 std::function<void()> handler,
332 bool handlerReturnValue);
333
334 static const EventHandlerDescriptor eventHandlerDescriptors[];
335
336 QtOhos::JsScopeDataOwner<JsScopeData> m_jsScopeData;
337 WindowProxyType m_windowProxyType;
338 bool m_subWindowMaximizeSupported;
339 std::shared_ptr<QXComponentNode> m_nodeXComponent;
340 std::string m_qAbilityInstanceId;
341 QHarmonyJsObjectRef m_abilityObjectRef;
342 QHarmonyJsObjectRef m_jsWindowObjectRef;
343 std::shared_ptr<void> m_jsWindowRegistrationHandle;
344 std::shared_ptr<void> m_subWindowCloseRegistrationHandle;
345 std::shared_ptr<void> m_qtWindowCallbacksReceiverHandle;
346 std::shared_ptr<void> m_qtNonClientAreaMouseWindowCallbackReceiverHandle;
347 std::shared_ptr<void> m_qtNonClientAreaTouchWindowCallbackReceiverHandle;
348};
349
351
354Q_DECLARE_METATYPE(QOhosWindowProxy::AvoidArea);
356
357#endif
void setPosition(QPoint position, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setSaturation(int saturation, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setTransparentForInput(bool transparentForInput, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QRectF geometry() const
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)
WId windowId() const
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
static const QOhosPropertyDescriptor< bool > windowKeepScreenOnProperty
static const QOhosPropertyDescriptor< QColor > surfaceBackgroundColorProperty
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
bool mainWindowTagValueOrFalse() const
Qt::WindowStates windowStates() const
std::optional< QCursor > m_cursor
void setDisplayIdFromOhos(std::optional< QOhosDisplayInfo::JsDisplayId > displayId)
bool setMouseGrabEnabled(bool grab) override
static std::optional< T > tryGetWindowOrWidgetProperty(QObject *windowOrWidget)
void setWindowStateFromOhos(Qt::WindowStates state)
static const QOhosPropertyDescriptor< int > windowBrightnessProperty
static const QOhosPropertyDescriptor< bool > mainWindowTagProperty
static const QOhosPropertyDescriptor< QWindow * > subWindowOfTagProperty
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
bool setKeyboardGrabEnabled(bool grab) override
static const QOhosPropertyDescriptor< bool > windowPrivacyModeSettingProperty
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
QtOhos::InternalWindowId m_windowId
static const QOhosPropertyDescriptor< double > windowCornerRadiusProperty
static bool isWindowBeingClosedOrDestroyed(QWindow *window)
static std::shared_ptr< void > setSurfaceConsumer(QWindow *targetWindow, QObject *surfaceConsumerContext, std::function< void(std::optional< void * >)> surfaceConsumer)
QRect lastRequestedWindowFrameGeometry() const
QMargins safeAreaMargins() const override
The safe area margins of a window represent the area that is safe to place content within,...
static const QOhosPropertyDescriptor< int > windowSaturationProperty
void setExposedFromOhos(bool exposed)
const QPlatformScreen * geometryConversionScreen(const QRect &rect) const
static const QOhosPropertyDescriptor< int > windowContrastProperty
static QOhosPlatformWindow * fromQWindow(QWindow *window)
QOhosPropertiesProvider propertiesProvider()
static const QOhosPropertyDescriptor< bool > floatWindowTagProperty
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
static void tagWindowOrWidgetAsFloatWindow(QObject *windowOrWidgetToTag, bool showAsFloatWindow)
static const QOhosPropertyDescriptor< bool > windowDragResizableProperty
static void tagWindowOrWidgetAsSubWindowOf(QObject *windowOrWidgetToTag, QWindow *targetMainWindow)
virtual void onWindowFlagsChanged(Qt::WindowFlags previousWindowFlags, Qt::WindowFlags currentWindowFlags)
QtOhos::InternalWindowId internalWindowId() const
static void tagWindowOrWidgetAsMainWindow(QObject *windowOrWidgetToTag, bool forceMainWindow)
Qt::WindowFlags m_windowFlags
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
static QOhosPlatformWindow * fromQWindowOrNull(QWindow *window)
virtual QOhosSurface * ownedSurfaceOrNull() const
static QWindow * getWindowOrWidgetAsSubWindowOfTagValue(QObject *windowOrWidget)
virtual void onWindowStateChanged(Qt::WindowStates oldWindowState, Qt::WindowStates currentWindowState)
void setParent(const QPlatformWindow *newParent) override
This function is called to enable native child window in QPA.
QOhosPlatformWindow(QWindow *window)
void setCursor(const QCursor &cursor)
std::optional< Qt::WindowStates > m_lastWindowState
bool shouldDisplayAsOhosWindow() const
static const QOhosPropertyDescriptor< int > nativeNodeRenderFitPolicyHintProperty
std::unique_ptr< QMargins > m_optFrameMargins
void setWindowGeometryFromOhos(const QRect &nativeWindowDrawGeometry)
std::optional< double > windowId() const override
QHarmonyJsObjectRef ability() const override
QMargins frameMargins() const override
void initialize() override
Called as part of QWindow::create(), after constructing the window.
void setSafeAreaMarginsFromOhos(const QMargins &margins)
QPlatformScreen * screen() const override
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
bool floatWindowTagValueOrFalse() const
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void notifyInputSystemsWindowActiveStatusChanged(bool active)
static const QOhosPropertyDescriptor< bool > windowFixedSizeStateProperty
bool isExposed() const final
Returns if this window is exposed in the windowing system.
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
Qt::WindowStates m_windowState
DecorationPreset decorationPreset() const
QRect lastReportedWindowGeometry() const
QWindow * validSubWindowOfTagValueOrNull() const
Qt::WindowFlags windowFlags() const
static void setWindowOrWidgetProperty(QObject *windowOrWidget, T propertyValue)
bool shouldShowWindowWithoutActivating() const
QHarmonyJsObjectRef jsWindow() const override
virtual QOhosView * ownedViewOrNull() const
static bool isEmbeddedWindow(QWindow *window)
void setWindowMarginsFromOhos(const QMargins &margins)
static Qt::WindowFlags platformWindowFlagsForQWindow(QWindow *window)
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)
void requestActivate()
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 restoreMainWindow()
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)
WId viewWindowId() const
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 hide()
WindowStateSyncReason
Definition qohosview.h:93
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 lower()
void windowDisplayIdChanged(QOhosDisplayInfo::JsDisplayId)
static std::unique_ptr< QOhosView > createForWindow(QOhosPlatformWindow *window, QOhosPropertiesProvider windowPropertiesProvider)
void minimize()
void setOpacity(qreal opacity)
QHarmonyJsObjectRef jsWindowObjectRef() const
void windowMoveRejected(QPoint rejectedPosition)
void setWindowStaysOnTop(bool staysOnTop)
void setFullScreen()
void maximize()
ViewGeometry viewGeometry() const
void avoidAreaChanged(QOhosWindowProxy::AvoidAreaType avoidAreaType, const QOhosWindowProxy::AvoidArea &avoidArea)
void setSize(const QSize &size)
void recover()
bool startMoving()
void setPosition(const QPoint &position)
bool isSubWindowCoveringFullScreen() const
void showImmediate()
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
void raise()
void setWindowKeepScreenOn(bool keepScreenOn, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setFollowParentMultiScreenPolicy(bool enabled, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setNonClientAreaMouseWindowCallbackReceiver(QObject *contextObject, QOhosConsumer< std::vector< NonClientAreaMouseEvent > > mouseEventBatchConsumer, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QHarmonyJsObjectRef jsWindowObjectRef() const
QtOhosQpa::enums::ohos::window::MaximizePresentation MaximizePresentation
bool isSubWindowMaximizeSupported() const
void moveWindowToGlobalOrGlobalDisplay(const QPoint &position, std::optional< QOhosDisplayInfo::JsDisplayId > optDisplayId, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setTitle(const QString &title, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
static std::shared_ptr< QOhosWindowProxy > createFloatWindow(const FloatWindowCreateInfo &createInfo)
void moveWindowToGlobal(const QPoint &position, const MoveConfiguration &moveConfiguration, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QArkUi::WindowProperties getWindowProperties() const
void setWindowBackgroundColor(const QColor &color, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowRectAutoSave(bool enabed, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowMask(const WindowMask &windowMask, const std::optional< QSize > &ohosMaskSizeOverride={}, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowShadowRadius(double radius, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QOhosWindowProxy(const QOhosWindowProxy &)=delete
void recover(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QtOhosQpa::enums::ohos::window::WindowEventType WindowEventType
QOhosWindowProxy(QOhosWindowProxy &&)=delete
void minimize(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
AvoidArea getWindowAvoidArea(AvoidAreaType type) const
void setWindowTitleButtonVisible(bool maximizeVisible, bool minimizeVisible, bool closeVisible, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowLayoutFullScreen(bool isLayoutFullScreen, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
std::optional< QOhosDisplayInfo::JsDisplayId > tryGetMainWindowJsDisplayId() const
QtOhosQpa::enums::ohos::bundle::bundleManager::SupportWindowMode SupportWindowMode
void setWindowTouchable(bool touchable, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QOhosWindowProxyExistingMainWindowCreateInfo ExistingMainWindowCreateInfo
void setWindowCallbackReceiver(std::unique_ptr< WindowCallbacks > receiver, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
bool tryMaximize(MaximizePresentation maximizePresentation)
void setWindowDecorVisible(bool visible, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
std::shared_ptr< QOhosWindowProxy > createSubWindow(const SubWindowCreateInfo &createInfo)
QPixmap snapshot() const
static std::shared_ptr< QOhosWindowProxy > createForExistingMainWindow(const ExistingMainWindowCreateInfo &createInfo)
void setWindowCornerRadius(double radius, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setSupportedWindowModes(const std::set< SupportWindowMode > &supportedWindowModes, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowSystemBarEnable(const QStringList &names, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void enableDrag(bool enable, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
std::shared_ptr< QXComponentNode > nodeXComponent() const
void showWindow(const ShowWindowOptions &options=ShowWindowOptions(), JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setNonClientAreaTouchWindowCallbackReceiver(QObject *contextObject, QOhosConsumer< std::vector< NonClientAreaTouchEvent > > touchEventBatchConsumer, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowFocusable(bool focusable, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowTitleMoveEnabled(bool enabled, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setCustomCursor(const QImage &customCursorImage, const QPoint &hotSpot, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
static std::vector< QArkUi::JsWindowId > queryWindowIdsByCoordinate(QOhosDisplayInfo::JsDisplayId displayId, const QPoint &queryLocation, std::uint32_t queryLimit=0)
void restore(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setSubWindowCloseHandler(std::function< void()> handler, bool handlerReturnValue)
std::optional< bool > isFocused() const
QtOhosQpa::enums::ohos::window::ModalityType ModalityType
bool isWindowRectAutoSave() const
QtOhosQpa::enums::ohos::window::RectChangeReason RectChangeReason
QOhosWindowProxySubWindowCreateInfo SubWindowCreateInfo
QtOhosQpa::enums::ohos::window::AvoidAreaType AvoidAreaType
void raiseToAppTop(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setWindowTopmost(bool topmost, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QOhosWindowProxyMainWindowCreateInfo MainWindowCreateInfo
QtOhos::JsCallBatch JsCallBatch
bool qtIsMainWindow() const
void setWindowPrivacyMode(bool privacyMode, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QOhosWindowProxyFloatWindowCreateInfo FloatWindowCreateInfo
void setSize(const QSize &size, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setSubWindowModalDisabled(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QList< QRect > getDisplayCutoutRects() const
void setSubWindowModalEnabled(ModalityType ModalityType, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QtOhosQpa::enums::ohos::window::WindowStatusType WindowStatusType
bool tryShiftAppWindowFocus(QOhosWindowProxy &targetProxy)
QOhosWindowProxy & operator=(const QOhosWindowProxy &)=delete
static std::vector< QArkUi::JsWindowId > queryQtManagedWindowIdsByPredicate(const std::function< bool(QOhosJsState &jsState, const QArkUi::JsWindowRef &)> &predicate)
QOhosWindowProxy & operator=(QOhosWindowProxy &&)=delete
void removeStartingWindow(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
WindowLimits getWindowLimits() const
std::string qAbilityInstanceId() const
void showAbility(JsCallBatch &jsCallBatch=JsCallBatch::immediate())
QHarmonyJsObjectRef abilityObjectRef() const
void setWindowLimits(const QSize &minSize, const QSize &maxSize, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
void setPointerStyleSync(const QCursor &cursor, JsCallBatch &jsCallBatch=JsCallBatch::immediate())
static std::shared_ptr< QOhosWindowProxy > createMainWindow(const MainWindowCreateInfo &createInfo)
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.
QOhosView * mapQWindowToViewOrNull(QWindow *window)
bool isJsThread()
std::optional< T > tryMapFromQVariant(QVariant variant)
std::shared_ptr< QWindowSystemEventHandler > makeApplicationStateTracker()
bool isHandheldDeviceType()
constexpr QOhosRuntimeDeviceTypeAndMode operator|(QOhosRuntimeDeviceTypeAndMode lhs, QOhosRuntimeDeviceTypeAndMode rhs)
QOhosRuntimeDeviceTypeAndMode queryQOhosRuntimeDeviceAndMode()
void setQOhosPropertyOnQObject(QObject *qObject, T propertyValue)
std::optional< T > tryGetQOhosPropertyFromQObject(QObject *qObject)
Q_DECLARE_METATYPE(QOhosWindowProxy::RectChangeOptions)
QT_END_NAMESPACE Q_DECLARE_METATYPE(QOhosWindowProxy::WindowEvent)
Q_DECLARE_METATYPE(QOhosWindowProxy::AvoidArea)
Q_DECLARE_METATYPE(QOhosWindowProxy::WindowStatus)
QXComponent< QXComponentType::Node > QXComponentNode
Definition qxcomponent.h:44
std::optional< QNativeNode * > optParent
Definition qnativenode.h:43
std::optional<::ArkUI_RenderFit > renderFitPolicyHint
Definition qnativenode.h:45
std::optional< QColor > backgroundColor
Definition qnativenode.h:44
bool disableWindowFocusableBeforeLoadContent
Definition qohosview.h:67
std::optional< QOhosDisplayInfo::JsDisplayId > displayId
Definition qohosview.h:78
bool operator==(const WindowMinMaxCloseButtonsState &other) const
bool operator!=(const WindowMinMaxCloseButtonsState &other) const
QOhosConsumer< NonClientAreaMouseEvent > mouseEventsConsumer
void onTouchEventFromArkUi(const QArkUi::TouchEvent &event) const
void onMouseEventFromArkUi(const QArkUi::MouseEvent &event) const
QOhosConsumer< NonClientAreaTouchEvent > touchEventsConsumer
std::optional< QOhosDisplayInfo::JsDisplayId > displayId
QOhosConsumer< QOhosWindowProxy::AvoidAreaType, QOhosWindowProxy::AvoidArea > onAvoidAreaChange
QOhosConsumer< QOhosDisplayInfo::JsDisplayId > onWindowDisplayIdChange
QOhosConsumer< QOhosWindowProxy::RectChangeOptions > onWindowRectChange
QOhosConsumer< QOhosWindowProxy::RectChangeOptions > onWindowRectChangeInGlobalDisplay
std::function< void()> onTouchOutside
QOhosConsumer< QOhosWindowProxy::WindowStatus > onWindowStatusChange
QOhosConsumer< QPoint > onWindowMoveRejected
QOhosConsumer< QOhosWindowProxy::WindowEvent > onWindowEvent
QOhosConsumer< QSize > onWindowResizeRejected
QOhosConsumer< bool > onWindowVisibilityChange
std::optional< double > maxWidth
std::optional< double > minWidth
std::optional< double > minHeight
std::optional< double > maxHeight