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/qobject.h>
12#include <QtCore/qpoint.h>
13#include <QtCore/qpointer.h>
14#include <QtCore/qrect.h>
15#include <QtCore/qsize.h>
16#include <QtGui/qcolor.h>
17#include <QtGui/qeventpoint.h>
18#include <QtGui/qwindow.h>
19#include <functional>
20#include <cstdint>
21#include <memory>
22#include <optional>
23#include <qarkui/input.h>
24#include <qarkui/window.h>
25#include <qohosdisplayinfo.h>
26#include <qohosenums.h>
27#include <qohosplugincore.h>
28#include <qohosutils.h>
29#include <render/qohoswindowproxydatafactory.h>
30#include <render/qxcomponent.h>
31#include <set>
32
34
35class QOhosWindowProxy final
36{
37public:
39
41
43
45
47
49
54
59
61 {
62 std::optional<double> minWidth;
63 std::optional<double> minHeight;
64 std::optional<double> maxWidth;
65 std::optional<double> maxHeight;
66 };
67
76
82
87
89 {
90 std::optional<QOhosDisplayInfo::JsDisplayId> displayId;
91 };
92
102
111
113 {
114 std::optional<bool> focusOnShow;
115 };
116
118
130
135
136 static std::shared_ptr<QOhosWindowProxy> createMainWindow(const MainWindowCreateInfo &createInfo);
137 static std::shared_ptr<QOhosWindowProxy>
139 static std::shared_ptr<QOhosWindowProxy> createFloatWindow(const FloatWindowCreateInfo &createInfo);
140
141 QOhosWindowProxy(const QOhosWindowProxy &) = delete;
142 QOhosWindowProxy(QOhosWindowProxy &&) = delete;
143 QOhosWindowProxy &operator=(const QOhosWindowProxy &) = delete;
144 QOhosWindowProxy &operator=(QOhosWindowProxy &&) = delete;
145
147
149 const QPoint &position, std::optional<QOhosDisplayInfo::JsDisplayId> optDisplayId);
150
151 void setSize(const QSize &size);
152 void moveWindowToGlobal(const QPoint &position, const MoveConfiguration &moveConfiguration);
153 void setWindowBackgroundColor(const QColor &color);
154 void setCustomCursor(const QImage &customCursorImage, const QPoint &hotSpot);
155 void setPointerStyleSync(const QCursor &cursor);
156 void setWindowPrivacyMode(bool privacyMode);
157 void setWindowFocusable(bool focusable);
158 void setWindowTouchable(bool touchable);
159 void setWindowLimits(const QSize &minSize, const QSize &maxSize);
160 void setWindowMask(
161 const WindowMask &windowMask, const std::optional<QSize> &ohosMaskSizeOverride = {});
163 void setSubWindowModalEnabled(ModalityType ModalityType);
164 void setTitle(const QString &title);
165 void setWindowTitleButtonVisible(bool maximizeVisible, bool minimizeVisible, bool closeVisible);
166 void setWindowTopmost(bool topmost);
167 void setWindowDecorVisible(bool visible);
168 void setWindowTitleMoveEnabled(bool enabled);
169 void setWindowShadowRadius(double radius);
170 void setWindowCornerRadius(double radius);
171 void setWindowRectAutoSave(bool enabed);
172 bool isWindowRectAutoSave() const;
173 void setFollowParentMultiScreenPolicy(bool enabled);
174 void setWindowKeepScreenOn(bool keepScreenOn);
175
176 void setSupportedWindowModes(const std::set<SupportWindowMode> &supportedWindowModes);
177
178 void setSubWindowCloseHandler(std::function<void()> handler, bool handlerReturnValue);
180
181 void raiseToAppTop();
182 void showWindow(const ShowWindowOptions &options = ShowWindowOptions());
183 void recover();
184 void restore();
185 void maximize(MaximizePresentation maximizePresentation);
186 void minimize();
187 void setWindowLayoutFullScreen(bool isLayoutFullScreen);
188 void setWindowSystemBarEnable(const QStringList &names);
189 void showAbility();
190 bool tryHideAbility();
193 QPixmap snapshot() const;
194 bool startMoving();
195 void enableDrag(bool enable);
196
197 std::optional<bool> isFocused() const;
198
200 void setWindowCallbackReceiver(std::unique_ptr<WindowCallbacks> receiver);
202 QObject *contextObject, QOhosConsumer<std::vector<NonClientAreaMouseEvent>> mouseEventBatchConsumer);
204 QObject *contextObject, QOhosConsumer<std::vector<NonClientAreaTouchEvent>> touchEventBatchConsumer);
205
206 std::shared_ptr<QOhosWindowProxy> createSubWindow(const SubWindowCreateInfo &createInfo);
207
208 bool qtIsMainWindow() const;
211 std::shared_ptr<QXComponentNode> nodeXComponent() const;
212 std::string qAbilityInstanceId() const;
213
215 QOhosDisplayInfo::JsDisplayId displayId, const QPoint &queryLocation,
216 std::uint32_t queryLimit = 0);
218 const std::function<bool(QtOhos::JsState &jsState, const QArkUi::JsWindowRef &)> &predicate);
219
220 std::optional<QOhosDisplayInfo::JsDisplayId> tryGetMainWindowJsDisplayId() const;
221 void shiftAppWindowFocus(QOhosWindowProxy &targetProxy);
222
223private:
224 static std::shared_ptr<QOhosWindowProxy> create(QtOhos::JsState &jsState, QOhosWindowProxyData data);
225
226 enum class EventHandlerFlagBits
227 {
228 allowCallWhenAbilityIsTerminating = 1 << 0,
229 allowEventHandlerRegistrationFailure = 1 << 1,
230 };
231
232 struct JsScopeData : public std::enable_shared_from_this<JsScopeData>
233 {
234 JsScopeData(
235 WindowProxyType windowProxyType, QNapi::Reference<QNapi::Object> jsWindow,
236 std::shared_ptr<void> optKeepAliveData,
237 std::shared_ptr<QtOhos::QAbilityPeer> qAbilityPeer,
238 QtOhos::QObjectThreadSafeRef owningQWindowRef);
239 ~JsScopeData();
240
241 std::shared_ptr<void> registerEventListener(
242 const std::string &eventName,
243 void (JsScopeData::*handleFunctions)(const QtOhos::CallbackInfo &),
244 QFlags<EventHandlerFlagBits> eventHandlerFlags);
245 std::shared_ptr<void> registerSubWindowCloseHandler(
246 QtOhos::JsState &jsState,
247 std::function<bool()> handler);
248 void handleWindowEventCallback(const QtOhos::CallbackInfo &cbInfo);
249 void handleWindowStatusCallback(const QtOhos::CallbackInfo &cbInfo);
250 void handleWindowVisibilityCallback(const QtOhos::CallbackInfo &cbInfo);
251 void handleWindowSizeChangeCallback(const QtOhos::CallbackInfo &cbInfo);
252 void handleWindowTouchOutsideCallback(const QtOhos::CallbackInfo &cbInfo);
253 void handleAvoidAreaChangeCallback(const QtOhos::CallbackInfo &cbInfo);
254 void handleWindowRectChangeCallback(const QtOhos::CallbackInfo &cbInfo);
255 void handleWindowRectChangeInGlobalDisplayCallback(const QtOhos::CallbackInfo &cbInfo);
256 void handleWindowDisplayIdChangeCallback(const QtOhos::CallbackInfo &cbInfo);
257 void onWindowEvent(QtOhos::JsState &jsState, const WindowEvent &windowEvent);
258 bool isWindowClosing() const;
259 void onMouseEventFromArkUi(const QArkUi::MouseEvent &event);
260 void onTouchEventFromArkUi(const QArkUi::TouchEvent &event);
261
262 WindowProxyType windowProxyType;
263 std::shared_ptr<WindowCallbacks> windowCallbackReceiver;
264 bool windowDestroyedFromSystem;
265 std::shared_ptr<void> optKeepAliveData;
266 std::shared_ptr<QtOhos::QAbilityPeer> qAbilityPeer;
267 std::shared_ptr<void> m_windowFrameMouseFilterHandle;
268 std::shared_ptr<void> m_windowFrameTouchFilterHandle;
269 std::shared_ptr<void> m_eventListenersHandle;
270 QOhosConsumer<NonClientAreaMouseEvent> nonClientAreaMouseEventConsumer;
271 QOhosConsumer<NonClientAreaTouchEvent> nonClientAreaTouchEventConsumer;
272 std::shared_ptr<QArkUi::JsWindowRef> jsWindowRef;
273 };
274
275 struct EventHandlerDescriptor
276 {
277 const char *eventName;
278 void (JsScopeData::*eventHandler)(const QtOhos::CallbackInfo &);
279 QFlags<EventHandlerFlagBits> eventHandlerFlags;
280 };
281
282 QOhosWindowProxy(QOhosWindowProxyData data);
283
284 std::shared_ptr<void> registerSubWindowCloseHandler(
285 std::function<void()> handler,
286 bool handlerReturnValue);
287
288 static const EventHandlerDescriptor eventHandlerDescriptors[];
289
290 std::shared_ptr<JsScopeData> m_jsScopeData;
291 WindowProxyType m_windowProxyType;
292 std::shared_ptr<QXComponentNode> m_nodeXComponent;
293 std::string m_qAbilityInstanceId;
294 std::shared_ptr<void> m_subWindowCloseRegistrationHandle;
295 std::shared_ptr<void> m_qtWindowCallbacksReceiverHandle;
296 std::shared_ptr<void> m_qtNonClientAreaMouseWindowCallbackReceiverHandle;
297 std::shared_ptr<void> m_qtNonClientAreaTouchWindowCallbackReceiverHandle;
298};
299
301
304Q_DECLARE_METATYPE(QOhosWindowProxy::AvoidArea);
306
307#endif
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 startDrag(const std::vector< QImage > &images, const QPointF &hotspot, const QMimeData &mimeData, QOhosConsumer< Qt::DropAction > dropActionConsumer)
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)
void externalContentClickDetected()
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)
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.
QOhosPlatformScreen * platformScreen() const
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
static const QOhosPropertyDescriptor< int > windowSaturationProperty
void setExposedFromOhos(bool exposed)
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
QMargins frameMargins() const override
void initialize() override
Called as part of QWindow::create(), after constructing the window.
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
QWindow * validSubWindowOfTagValueOrNull() const
Qt::WindowFlags windowFlags() const
static void setWindowOrWidgetProperty(QObject *windowOrWidget, T propertyValue)
bool shouldShowWindowWithoutActivating() const
virtual QOhosView * ownedViewOrNull() const
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()
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)
void setPositionOnScreenImmediate(const QPoint &position, QOhosDisplayInfo::JsDisplayId jsDisplayId)
void setTransparentBackground(bool transparent)
void setModality(Qt::WindowModality modality)
WId viewWindowId() const
bool isFullscreenImmersiveModeEnabled()
void setFramelessWindow(bool frameless)
QPixmap makeSnapshot() const
void setWindowShadowDisabled()
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:88
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
void windowTouchOutside()
void nodeAreaChanged(QArkUi::QQtEmbeddedWindowNode::NodeAreaInfo areaChangeEvt)
void handlePaletteChange()
void lower()
void windowDisplayIdChanged(QOhosDisplayInfo::JsDisplayId)
static std::unique_ptr< QOhosView > createForWindow(QOhosPlatformWindow *window, QOhosPropertiesProvider windowPropertiesProvider)
void minimize()
void setOpacity(qreal opacity)
void setNativeNodeVisibility(bool visible)
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)
QOhosView(QWindow *ownerWindow, QSharedPointer< QNativeNode > nativeNode, QOhosPropertiesProvider propertiesProvider)
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 setWindowRectAutoSave(bool enabed)
void setSubWindowModalEnabled(ModalityType ModalityType)
void setWindowKeepScreenOn(bool keepScreenOn)
void moveWindowToGlobal(const QPoint &position, const MoveConfiguration &moveConfiguration)
static std::shared_ptr< QOhosWindowProxy > createFloatWindow(const FloatWindowCreateInfo &createInfo)
void setWindowMask(const WindowMask &windowMask, const std::optional< QSize > &ohosMaskSizeOverride={})
QArkUi::WindowProperties getWindowProperties() const
void moveWindowToGlobalOrGlobalDisplay(const QPoint &position, std::optional< QOhosDisplayInfo::JsDisplayId > optDisplayId)
void setWindowPrivacyMode(bool privacyMode)
QOhosWindowProxy(const QOhosWindowProxy &)=delete
QOhosWindowProxy(QOhosWindowProxy &&)=delete
AvoidArea getWindowAvoidArea(AvoidAreaType type) const
QtOhos::enums::ohos::window::ModalityType ModalityType
void setWindowLayoutFullScreen(bool isLayoutFullScreen)
std::optional< QOhosDisplayInfo::JsDisplayId > tryGetMainWindowJsDisplayId() const
QtOhos::enums::ohos::window::AvoidAreaType AvoidAreaType
void enableDrag(bool enable)
void setWindowCornerRadius(double radius)
QOhosWindowProxyExistingMainWindowCreateInfo ExistingMainWindowCreateInfo
void setSupportedWindowModes(const std::set< SupportWindowMode > &supportedWindowModes)
void setWindowSystemBarEnable(const QStringList &names)
std::shared_ptr< QOhosWindowProxy > createSubWindow(const SubWindowCreateInfo &createInfo)
QPixmap snapshot() const
static std::shared_ptr< QOhosWindowProxy > createForExistingMainWindow(const ExistingMainWindowCreateInfo &createInfo)
QtOhos::enums::ohos::window::MaximizePresentation MaximizePresentation
void setWindowTouchable(bool touchable)
void setTitle(const QString &title)
void setFollowParentMultiScreenPolicy(bool enabled)
void setWindowTopmost(bool topmost)
std::shared_ptr< QXComponentNode > nodeXComponent() const
QtOhos::enums::ohos::window::RectChangeReason RectChangeReason
void setWindowCallbackReceiver(std::unique_ptr< WindowCallbacks > receiver)
static std::vector< QArkUi::JsWindowId > queryWindowIdsByCoordinate(QOhosDisplayInfo::JsDisplayId displayId, const QPoint &queryLocation, std::uint32_t queryLimit=0)
void setSubWindowCloseHandler(std::function< void()> handler, bool handlerReturnValue)
std::optional< bool > isFocused() const
void setWindowLimits(const QSize &minSize, const QSize &maxSize)
bool isWindowRectAutoSave() const
void setWindowDecorVisible(bool visible)
void showWindow(const ShowWindowOptions &options=ShowWindowOptions())
void shiftAppWindowFocus(QOhosWindowProxy &targetProxy)
QOhosWindowProxySubWindowCreateInfo SubWindowCreateInfo
void setNonClientAreaMouseWindowCallbackReceiver(QObject *contextObject, QOhosConsumer< std::vector< NonClientAreaMouseEvent > > mouseEventBatchConsumer)
void setCustomCursor(const QImage &customCursorImage, const QPoint &hotSpot)
QtOhos::enums::ohos::window::WindowEventType WindowEventType
void setWindowTitleMoveEnabled(bool enabled)
void setWindowFocusable(bool focusable)
void setWindowBackgroundColor(const QColor &color)
void setSize(const QSize &size)
QOhosWindowProxyMainWindowCreateInfo MainWindowCreateInfo
void setWindowShadowRadius(double radius)
bool qtIsMainWindow() const
QOhosWindowProxyFloatWindowCreateInfo FloatWindowCreateInfo
void setWindowTitleButtonVisible(bool maximizeVisible, bool minimizeVisible, bool closeVisible)
void setPointerStyleSync(const QCursor &cursor)
QtOhos::enums::ohos::bundle::bundleManager::SupportWindowMode SupportWindowMode
QOhosWindowProxy & operator=(const QOhosWindowProxy &)=delete
QOhosWindowProxy & operator=(QOhosWindowProxy &&)=delete
WindowLimits getWindowLimits() const
static std::vector< QArkUi::JsWindowId > queryQtManagedWindowIdsByPredicate(const std::function< bool(QtOhos::JsState &jsState, const QArkUi::JsWindowRef &)> &predicate)
std::string qAbilityInstanceId() const
void maximize(MaximizePresentation maximizePresentation)
void setNonClientAreaTouchWindowCallbackReceiver(QObject *contextObject, QOhosConsumer< std::vector< NonClientAreaTouchEvent > > touchEventBatchConsumer)
QtOhos::enums::ohos::window::WindowStatusType WindowStatusType
static std::shared_ptr< QOhosWindowProxy > createMainWindow(const MainWindowCreateInfo &createInfo)
bool sendEvent(WindowSystemEvent *event) override
Combined button and popup list for selecting options.
QOhosView * mapQWindowToViewOrNull(QWindow *window)
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:45
bool disableWindowFocusableBeforeLoadContent
Definition qohosview.h:62
std::optional< QOhosDisplayInfo::JsDisplayId > displayId
Definition qohosview.h:73
bool operator==(const WindowMinMaxCloseButtonsState &other) const
bool operator!=(const WindowMinMaxCloseButtonsState &other) const
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< QOhosWindowProxy::WindowEvent > onWindowEvent
QOhosConsumer< bool > onWindowVisibilityChange
std::optional< double > maxWidth
std::optional< double > minWidth
std::optional< double > minHeight
std::optional< double > maxHeight