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
qohosplugincore.h
Go to the documentation of this file.
1// Copyright (C) 2026 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 QOHOSPLUGINCORE_H
5#define QOHOSPLUGINCORE_H
6
7#include <QtCore/private/qcore_ohos_p.h>
8#include <QtCore/private/qnapi_p.h>
9#include <QtCore/private/qohoscommon_p.h>
10#include <QtCore/qobject.h>
11#include <array>
12#include <atomic>
13#include <chrono>
14#include <cstdlib>
15#include <functional>
16#include <map>
17#include <memory>
18#include <optional>
19#ifndef QT_NO_EXCEPTIONS
20#include <stdexcept>
21#endif
22#include <string>
23#include <type_traits>
24#include <typeinfo>
25#include <utility>
26#include <vector>
27
28QT_BEGIN_NAMESPACE
29
30template<typename T>
31class QOhosOptional;
32
34
35template<typename A, typename B, typename = void>
37
38template<typename A, typename B>
39struct HasEqualityComparatorT<A, B, decltype(void(std::declval<A>() == std::declval<B>()))>
40 : std::true_type {};
41
42template<typename A, typename B>
44
45template<typename>
47
48template<typename T>
50
51template<typename T>
53
54}
55
56template<typename T>
58{
59 static_assert(
60 std::is_copy_constructible<T>::value && std::is_copy_assignable<T>::value,
61 "Only copyable types are supported");
62
63public:
64 explicit QOhosOptional(const T &value);
65 QOhosOptional(const QOhosOptional<void> &empty);
66 template<typename U, std::enable_if_t<std::is_same_v<U, T>, int> = 0>
67 QOhosOptional(const std::optional<U> &other);
68
69 QOhosOptional() = default;
70 QOhosOptional(const QOhosOptional<T> &other);
71 QOhosOptional<T> &operator=(const QOhosOptional<T> &other);
72 QOhosOptional<T> &operator=(const T &value);
73 QOhosOptional<T> &operator=(const QOhosOptional<void> &empty);
74 template<typename U, std::enable_if_t<std::is_same_v<U, T>, int> = 0>
75 QOhosOptional<T> &operator=(const std::optional<U> &other);
76
78
79 bool hasValue() const;
80 T valueOr(const T &fallback) const;
81
82 const T &value() const;
83 T &value();
84
85 void reset();
86
87 template<typename... Args>
88 T &emplace(Args &&...args);
89
90
91 template<typename Func>
95 andThen(Func &&func) const;
96
97 template<typename Func>
99
100private:
101 T &storedValueRef();
102 const T &storedValueRef() const;
103 template<typename... InitArgs>
104 void initializeStoredValue(InitArgs &&...initArgs);
105
106 std::aligned_storage_t<sizeof(T), alignof(T)> m_rawStoredValue;
107 bool m_hasValue = false;
108};
109
110template<typename T, typename U>
112operator==(const QOhosOptional<T> &lhs, const QOhosOptional<U> &rhs);
113
114template<typename T, typename U>
116operator!=(const QOhosOptional<T> &lhs, const QOhosOptional<U> &rhs);
117
118template<typename T, typename U>
120operator==(const QOhosOptional<T> &lhs, const U &rhs);
121
122template<typename T, typename U>
124operator!=(const QOhosOptional<T> &lhs, const U &rhs);
125
126template<typename T, typename U>
128operator==(const T &lhs, const QOhosOptional<U> &rhs);
129
130template<typename T, typename U>
132operator!=(const T &lhs, const QOhosOptional<U> &rhs);
133
134template<>
135class QOhosOptional<void>
136{
137};
138
139template<typename T>
140QOhosOptional<T> makeQOhosOptional(const T &value);
141
143
144namespace QtOhos {
145
147{
148public:
149 static void tagWindowAsClosing(QNapi::Object jsWindow, const char *logContext);
150 static bool isWindowClosing(QNapi::Object jsWindow);
151
153};
154
156{
157public:
158 virtual ~QAbilityPeer();
159
160 virtual std::string instanceId() = 0;
161 virtual QNapi::Object uiContext() = 0;
162 virtual QNapi::Object qAbility() = 0;
163 virtual QNapi::Object launchWant() = 0;
166 virtual std::shared_ptr<std::atomic_bool> destroyAllowedFlag() = 0;
167 virtual bool isTerminating() = 0;
168
169 virtual void setQWindow(Napi::Env env, QObjectThreadSafeRef qwindow) = 0;
170
171 virtual void *tryCastWithTypeIdObject(const void *matchTypeIdObject) = 0;
172
173protected:
175};
176
178{
179 std::string name;
182};
183
185{
186public:
187 virtual ~QAbilityEngine();
188
189 virtual QAbilityInfo readAbilityInfo(const QNapi::Object &ability) const = 0;
190
191protected:
193};
194
195class JsState;
196
198{
199public:
200 virtual ~AppFunctions();
201
203 QNapi::Object baseQAbility, QObjectThreadSafeRef qwindow,
204 QNapi::Object optStartOptions,
205 std::function<void(JsState &, std::shared_ptr<QAbilityPeer>)> startupNotifyFunc) = 0;
206
207 virtual void startAppProcess(
208 QNapi::Object baseQAbility, const std::string &processId, QNapi::Object want,
209 QNapi::Object optStartOptions) = 0;
210
211 virtual void startAppProcess(
212 QNapi::Object baseQAbility, const std::string &processId, QNapi::Object want,
213 QNapi::Object optStartOptions, std::function<void(JsState &)> continueFunc) = 0;
214
215 virtual void startNoUiChildProcess(JsState &jsState, const std::string &libraryName, const std::vector<std::string> &args) = 0;
216
217 virtual void tagWidgetOrWindowAsFloatWindow(QObject *widgetOrWindow, bool floatWindowEnabled) = 0;
218};
219
225
226class JsState : public QOhosJsState
227{
228public:
229 JsState(const JsState &) = delete;
230 JsState &operator=(const JsState &) = delete;
231
233
235
236 virtual QNapi::Object appLaunchWant() = 0;
238
239 virtual std::shared_ptr<QAbilityPeer> defaultQAbilityPeer() = 0;
240 virtual std::shared_ptr<QAbilityPeer> tryGetQAbilityPeerByInstanceId(const std::string &instanceId) = 0;
241 virtual std::shared_ptr<QAbilityPeer> tryGetQAbilityPeerByInstance(QNapi::Object qAbility) = 0;
242 virtual std::shared_ptr<QAbilityPeer> tryGetQAbilityPeerByQWindow(QObjectThreadSafeRef qwindow) = 0;
243
244 virtual void visitEachQAbilityPeer(const std::function<void(std::shared_ptr<QAbilityPeer>)> &visitor) = 0;
245
247 std::shared_ptr<QAbilityPeer> baseQAbilityPeer, QObjectThreadSafeRef qwindow,
248 QNapi::Object optStartOptions,
249 std::function<void(JsState &, std::shared_ptr<QAbilityPeer>)> startupNotifyFunc) = 0;
250
251 virtual void startAppProcess(
252 const std::string &processId, QNapi::Object requestWant,
253 QNapi::Object optStartOptions = {}) = 0;
254
255 virtual void startAppProcess(
256 const std::string &processId, QNapi::Object requestWant,
257 QNapi::Object optStartOptions, std::function<void(JsState &)> continueFunc) = 0;
258
259 virtual void addNewWantConsumer(QOhosConsumer<JsState &, QNapi::Object, QNapi::Object> wantConsumer) = 0;
260
261 virtual void startNoUiChildProcess(const std::string &libraryName, const std::vector<std::string> &args) = 0;
262
263 virtual QtRunMode qtRunMode() = 0;
264
265 template<typename T>
267
268 template<typename T>
270
271protected:
273
274private:
276 const std::type_info &objectTypeInfo, QOhosSupplier<std::shared_ptr<void>> objectFactory) = 0;
277
278 virtual QNapi::Symbol getJsSymbolForType(const std::type_info &typeInfo) = 0;
279};
280
287
289{
290public:
291 static std::shared_ptr<QUiAbilityPeer> tryCastFromQAbilityPeerOrNull(std::shared_ptr<QAbilityPeer> qAbilityPeer);
292
293 ~QUiAbilityPeer() override;
294
295 virtual QNapi::Object launchParam() = 0;
296
297 virtual QNapi::Object windowStage() = 0;
298 virtual QNapi::Object window() = 0;
299
301 std::function<void(JsState &, QNapi::Object, QOhosConsumer<JsState &, QOhosAbilityOnContinueResult>)> requestsHandler) = 0;
302
303protected:
305
306private:
307 static const nullptr_t typeIdObject;
308
309 void *tryCastWithTypeIdObject(const void *matchTypeIdObject) final;
310};
311
313{
314public:
316
317 JsState &jsState() const;
318};
319
320// this function should be called once from JS thread at some point during startup
324
325// this function should be called from JS thread for each UIAbility when it's ready
326void addJsQAbilityPeer(std::shared_ptr<QAbilityPeer> qAbilityPeer);
327
328// this function should be called from JS thread when WindowStage of UIAbility is destroyed
329void removeMatchingJsQAbilityPeer(QNapi::Object qAbility);
330
331// this function should be called from JS thread when new Want object is received
332void dispatchNewWant(QNapi::Object want, QNapi::Object launchParam);
333
334// invokes the task inside the JS thread, can be called from Qt thread at any time
335void invokeInJsThread(std::function<void(JsState &)> task);
336
337// Invokes the task inside the JS thread and blocks the caller's thread until
338// the "continue" function (std::function<void()>, passed as second argument to
339// the task) is called on the JS side.
340// It can be called from the Qt thread at any time, calling it from the JS
341// thread is illegal.
343 std::function<void(JsState &, std::function<void()>)> &&task);
344
345// Runs the task inside the JS thread and waits until its execution ends.
346// When called from the JS thread, it calls the task directly. For other threads
347// it behaves like a wrapper around the invokeInJsThreadAndWaitForContinue().
348void runInJsThreadAndWait(const std::function<void(JsState &)> &task);
349
350template<typename Func>
351auto evalInJsThread(Func &&func) -> decltype(func(std::declval<JsState &>()));
352
353template<typename T>
354T evalInJsThreadWithConsumer(std::function<void(QtOhos::JsState &, std::function<void(T)>)> evalFunc);
355
356// Invokes the task inside the Qt thread and blocks the caller's thread until either:
357// - the "continue" function (std::function<void()>, passed as second argument to
358// the task) is called on the Qt side and returns,
359// - timeout occurs (we don't receive response from the finished task within the
360// specified time limit),
361// - deadlock is detected (both Qt and JS thread use synchronous calls at the same
362// time).
363// It can be called from the JS thread. Calling it from the Qt thread is illegal.
364//
365// Returns true iff the caller receives confirmation about finishing the task within
366// the time limit.
367//
368// Note:
369// If the function returns false then:
370// - either the task wasn't started at all (timeout or deadlock)
371// - or the task was still running (and may be still running!) in the Qt thread
372// after reaching the timeout.
374 std::function<void(std::function<void()>)> &&task,
375 std::chrono::nanoseconds timeout);
376
377template<typename T>
379{
380 auto *objectPtr = reinterpret_cast<T *>(
381 getAttachedObjectWithLazyCreate(typeid(T), &std::make_shared<T>));
382 return *objectPtr;
383}
384
385template<typename T>
387{
388 return getJsSymbolForType(typeid(T));
389}
390
391template<typename Func>
392auto evalInJsThread(Func &&func) -> decltype(func(std::declval<JsState &>()))
393{
394 return QOhosJsThreadGateway::eval(
395 [&func](QOhosJsState &jsState) {
396 return func(static_cast<JsState &>(jsState));
397 });
398}
399
400template<typename T>
401T evalInJsThreadWithConsumer(std::function<void(QtOhos::JsState &, std::function<void(T)>)> evalFunc)
402{
403 return QOhosJsThreadGateway::evalWithConsumer<T>(
404 [evalFunc = std::move(evalFunc)](QOhosJsState &jsState, std::function<void(T)> consumer) {
405 evalFunc(static_cast<JsState &>(jsState), std::move(consumer));
406 });
407}
408
409template<>
411{
412 static constexpr const char *fullTypeName = "@ohos.app.ability.AbilityConstant.OnContinueResult";
413 static constexpr std::array<std::pair<QOhosAbilityOnContinueResult, const char *>, 3> enumeratorsNames = {{
417 }};
418};
419
420}
421
422template<typename T>
423QOhosOptional<T>::QOhosOptional(const T &value)
424{
425 initializeStoredValue(value);
426}
427
428template<typename T>
430{
431}
432
433template<typename T>
435{
436 if (other.m_hasValue)
437 initializeStoredValue(other.storedValueRef());
438}
439
440template<typename T>
441template<typename U, std::enable_if_t<std::is_same_v<U, T>, int>>
442QOhosOptional<T>::QOhosOptional(const std::optional<U> &other)
443{
444 if (other.has_value())
445 initializeStoredValue(*other);
446}
447
448template<typename T>
450{
451 if (&other == this)
452 return *this;
453
454 if (other.m_hasValue) {
455 if (m_hasValue)
456 storedValueRef() = other.storedValueRef();
457 else
458 initializeStoredValue(other.storedValueRef());
459 } else {
460 reset();
461 }
462
463 return *this;
464}
465
466template<typename T>
467QOhosOptional<T> &QOhosOptional<T>::operator=(const T &value)
468{
469 *this = QOhosOptional<T>(value);
470 return *this;
471}
472
473template<typename T>
475{
476 reset();
477 return *this;
478}
479
480template<typename T>
481template<typename U, std::enable_if_t<std::is_same_v<U, T>, int>>
482QOhosOptional<T> &QOhosOptional<T>::operator=(const std::optional<U> &other)
483{
484 if (other.has_value()) {
485 if (m_hasValue)
486 storedValueRef() = *other;
487 else
488 initializeStoredValue(*other);
489 } else {
490 reset();
491 }
492 return *this;
493}
494
495template<typename T>
497{
498 reset();
499}
500
501template<typename T>
503{
504 if (m_hasValue) {
505 m_hasValue = false;
506 storedValueRef().~T();
507 }
508}
509
510template<typename T>
511T &QOhosOptional<T>::storedValueRef()
512{
513 return *reinterpret_cast<T *>(&m_rawStoredValue);
514}
515
516template<typename T>
517const T &QOhosOptional<T>::storedValueRef() const
518{
519 return *reinterpret_cast<const T *>(&m_rawStoredValue);
520}
521
522template<typename T>
523template<typename... InitArgs>
524void QOhosOptional<T>::initializeStoredValue(InitArgs &&...initArgs)
525{
526 new (&m_rawStoredValue) T(std::forward<InitArgs...>(initArgs...));
527 m_hasValue = true;
528}
529
530template<typename T>
531bool QOhosOptional<T>::hasValue() const
532{
533 return m_hasValue;
534}
535
536template<typename T>
537T QOhosOptional<T>::valueOr(const T &fallback) const
538{
539 return hasValue() ? storedValueRef() : fallback;
540}
541
542template<typename T>
543const T &QOhosOptional<T>::value() const
544{
545 if (!m_hasValue) {
546#ifndef QT_NO_EXCEPTIONS
547 throw std::runtime_error("Can't access value inside empty QOhosOptional<>");
548#else
549 qFatal("Can't access value inside empty QOhosOptional<>");
550 std::abort();
551#endif
552 }
553
554 return storedValueRef();
555}
556
557template<typename T>
559{
560 if (!m_hasValue) {
561#ifndef QT_NO_EXCEPTIONS
562 throw std::runtime_error("Can't access value inside empty QOhosOptional<>");
563#else
564 qFatal("Can't access value inside empty QOhosOptional<>");
565 std::abort();
566#endif
567 }
568
569 return storedValueRef();
570}
571
572template<typename T>
573template<typename... Args>
574T &QOhosOptional<T>::emplace(Args &&...args)
575{
576 reset();
577 initializeStoredValue(std::forward<Args...>(args)...);
578 return storedValueRef();
579}
580
581template<typename T, typename U>
583operator==(const QOhosOptional<T> &lhs, const QOhosOptional<U> &rhs)
584{
585 return (lhs.hasValue() && rhs.hasValue())
586 ? lhs.value() == rhs.value()
587 : (!lhs.hasValue() && !rhs.hasValue());
588}
589
590template<typename T, typename U>
592operator!=(const QOhosOptional<T> &lhs, const QOhosOptional<U> &rhs)
593{
594 return !(lhs == rhs);
595}
596
597template<typename T, typename U>
599operator==(const QOhosOptional<T> &lhs, const U &rhs)
600{
601 return lhs.hasValue() && lhs.value() == rhs;
602}
603
604template<typename T, typename U>
606operator!=(const QOhosOptional<T> &lhs, const U &rhs)
607{
608 return !(lhs == rhs);
609}
610
611template<typename T, typename U>
613operator==(const T &lhs, const QOhosOptional<U> &rhs)
614{
615 return rhs.hasValue() && lhs == rhs.value();
616}
617
618template<typename T, typename U>
620operator!=(const T &lhs, const QOhosOptional<U> &rhs)
621{
622 return !(lhs == rhs);
623}
624
625template<typename T>
626template<typename Func>
627std::enable_if_t<
628 qohosplugincore_h_detail::isQOhosOptional<QOhosInvokeResult<Func, T>>,
629 QOhosInvokeResult<Func, T>>
630QOhosOptional<T>::andThen(Func &&func) const
631{
632 return hasValue() ? func(value()) : QOhosInvokeResult<Func, T>();
633}
634
635template<typename T>
636template<typename Func>
638{
639 using TransformedT = QOhosInvokeResult<Func, T>;
640 return hasValue()
641 ? QOhosOptional<TransformedT>(func(value()))
642 : QOhosOptional<TransformedT>();
643}
644
645template<typename T>
647{
648 return QOhosOptional<T>(value);
649}
650
652{
653 return {};
654}
655
656QT_END_NAMESPACE
657
658#endif
QNapi::Object jsObject()
Definition window.cpp:77
JsWindowRef(JsWindowRef &&)=delete
bool isFocused() const
Definition window.cpp:65
JsWindowRef(const JsWindowRef &)=delete
JsWindowRef & operator=(JsWindowRef &&)=delete
JsWindowRef(JsWindowId windowId, QNapi::Object jsWindow)
Definition window.cpp:46
Result call(const std::string &methodName, const std::vector< QNapi::ValueWrapper > &args={}) const
Definition window.h:59
bool isWindowShown() const
Definition window.cpp:52
JsWindowId id() const
Definition window.cpp:72
JsWindowRef & operator=(const JsWindowRef &)=delete
QOhosOptional()=default
QOhosOptional(const std::optional< U > &other)
T valueOr(const T &fallback) const
QOhosOptional< T > & operator=(const std::optional< U > &other)
bool hasValue() const
QOhosOptional(const QOhosOptional< void > &empty)
QOhosOptional< T > & operator=(const T &value)
std::enable_if_t< qohosplugincore_h_detail::isQOhosOptional< QOhosInvokeResult< Func, T > >, QOhosInvokeResult< Func, T > > andThen(Func &&func) const
QOhosOptional< T > & operator=(const QOhosOptional< void > &empty)
QOhosOptional(const T &value)
const T & value() const
T & emplace(Args &&...args)
QOhosOptional< T > & operator=(const QOhosOptional< T > &other)
QOhosOptional< QOhosInvokeResult< Func, T > > transform(Func &&func) const
QOhosOptional(const QOhosOptional< T > &other)
virtual void startQAbilityInstance(QNapi::Object baseQAbility, QObjectThreadSafeRef qwindow, QNapi::Object optStartOptions, std::function< void(JsState &, std::shared_ptr< QAbilityPeer >)> startupNotifyFunc)=0
virtual void tagWidgetOrWindowAsFloatWindow(QObject *widgetOrWindow, bool floatWindowEnabled)=0
virtual void startAppProcess(QNapi::Object baseQAbility, const std::string &processId, QNapi::Object want, QNapi::Object optStartOptions)=0
virtual void startAppProcess(QNapi::Object baseQAbility, const std::string &processId, QNapi::Object want, QNapi::Object optStartOptions, std::function< void(JsState &)> continueFunc)=0
virtual void startNoUiChildProcess(JsState &jsState, const std::string &libraryName, const std::vector< std::string > &args)=0
JsState & jsState() const
JsState & operator=(const JsState &)=delete
virtual void addNewWantConsumer(QOhosConsumer< JsState &, QNapi::Object, QNapi::Object > wantConsumer)=0
virtual QtRunMode qtRunMode()=0
JsState(const JsState &)=delete
virtual std::shared_ptr< QAbilityPeer > tryGetQAbilityPeerByInstanceId(const std::string &instanceId)=0
virtual void * getAttachedObjectWithLazyCreate(const std::type_info &objectTypeInfo, QOhosSupplier< std::shared_ptr< void > > objectFactory)=0
virtual void startAppProcess(const std::string &processId, QNapi::Object requestWant, QNapi::Object optStartOptions, std::function< void(JsState &)> continueFunc)=0
virtual void startNoUiChildProcess(const std::string &libraryName, const std::vector< std::string > &args)=0
~JsState() override
virtual std::shared_ptr< QAbilityPeer > tryGetQAbilityPeerByQWindow(QObjectThreadSafeRef qwindow)=0
virtual void visitEachQAbilityPeer(const std::function< void(std::shared_ptr< QAbilityPeer >)> &visitor)=0
QNapi::Symbol getJsSymbolForType()
virtual std::shared_ptr< QAbilityPeer > defaultQAbilityPeer()=0
virtual std::shared_ptr< QAbilityPeer > tryGetQAbilityPeerByInstance(QNapi::Object qAbility)=0
virtual QOhosOptional< QNapi::Object > optAppLaunchParam()=0
virtual QNapi::Object appLaunchWant()=0
std::enable_if_t< std::is_default_constructible< T >::value, T > & getAttachedObjectWithLazyCreate()
virtual QNapi::Symbol getJsSymbolForType(const std::type_info &typeInfo)=0
virtual void startNewQAbilityInstance(std::shared_ptr< QAbilityPeer > baseQAbilityPeer, QObjectThreadSafeRef qwindow, QNapi::Object optStartOptions, std::function< void(JsState &, std::shared_ptr< QAbilityPeer >)> startupNotifyFunc)=0
virtual void startAppProcess(const std::string &processId, QNapi::Object requestWant, QNapi::Object optStartOptions={})=0
static void tagWindowAsClosing(QNapi::Object jsWindow, const char *logContext)
static bool isWindowClosing(QNapi::Object jsWindow)
virtual QAbilityInfo readAbilityInfo(const QNapi::Object &ability) const =0
virtual QOhosOptional< QNapi::Promise > qWindowDestroyPromise()=0
virtual std::string instanceId()=0
virtual QObjectThreadSafeRef qWindowRef()=0
virtual QNapi::Object launchWant()=0
virtual bool isTerminating()=0
virtual void setQWindow(Napi::Env env, QObjectThreadSafeRef qwindow)=0
virtual void * tryCastWithTypeIdObject(const void *matchTypeIdObject)=0
virtual std::shared_ptr< std::atomic_bool > destroyAllowedFlag()=0
virtual QNapi::Object qAbility()=0
virtual QNapi::Object uiContext()=0
virtual void setOnContinueRequestsHandler(std::function< void(JsState &, QNapi::Object, QOhosConsumer< JsState &, QOhosAbilityOnContinueResult >)> requestsHandler)=0
virtual QNapi::Object launchParam()=0
virtual QNapi::Object windowStage()=0
void * tryCastWithTypeIdObject(const void *matchTypeIdObject) final
static std::shared_ptr< QUiAbilityPeer > tryCastFromQAbilityPeerOrNull(std::shared_ptr< QAbilityPeer > qAbilityPeer)
~QUiAbilityPeer() override
virtual QNapi::Object window()=0
QOhosOptional< WindowProperties > tryGetWindowProperties(JsWindowId jsWindowId)
Definition window.cpp:27
Combined button and popup list for selecting options.
void invokeInJsThread(std::function< void(JsState &)> task)
void dispatchNewWant(QNapi::Object want, QNapi::Object launchParam)
void removeMatchingJsQAbilityPeer(QNapi::Object qAbility)
T evalInJsThreadWithConsumer(std::function< void(QtOhos::JsState &, std::function< void(T)>)> evalFunc)
void initJsThreadState(napi_env env, std::map< std::string, QNapi::Reference< QNapi::Function > > &&jsModulesFactories, std::shared_ptr< AppFunctions > appFunctions, QtRunMode qtRunMode)
Q_REQUIRED_RESULT bool tryInvokeInQtThreadAndTryWaitForContinue(std::function< void(std::function< void()>)> &&task, std::chrono::nanoseconds timeout)
auto evalInJsThread(Func &&func) -> decltype(func(std::declval< JsState & >()))
QOhosAbilityOnContinueResult
void runInJsThreadAndWait(const std::function< void(JsState &)> &task)
void invokeInJsThreadAndWaitForContinue(std::function< void(JsState &, std::function< void()>)> &&task)
void addJsQAbilityPeer(std::shared_ptr< QAbilityPeer > qAbilityPeer)
constexpr bool isQOhosOptional
constexpr bool hasEqualityComparator
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QOhosDisplayInfo::DisplaySourceMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QOhosDisplayInfo::JsDisplayOrientation))
QT_END_NAMESPACE Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QOhosPlatformWindow::NativeNodeRenderFitPolicy))
std::enable_if_t< qohosplugincore_h_detail::hasEqualityComparator< T, U >, bool > operator!=(const QOhosOptional< T > &lhs, const U &rhs)
std::enable_if_t< qohosplugincore_h_detail::hasEqualityComparator< T, U >, bool > operator==(const QOhosOptional< T > &lhs, const QOhosOptional< U > &rhs)
std::enable_if_t< qohosplugincore_h_detail::hasEqualityComparator< T, U >, bool > operator!=(const T &lhs, const QOhosOptional< U > &rhs)
std::enable_if_t< qohosplugincore_h_detail::hasEqualityComparator< T, U >, bool > operator==(const T &lhs, const QOhosOptional< U > &rhs)
QOhosOptional< void > makeEmptyQOhosOptional()
QOhosOptional< T > makeQOhosOptional(const T &value)
std::enable_if_t< qohosplugincore_h_detail::hasEqualityComparator< T, U >, bool > operator!=(const QOhosOptional< T > &lhs, const QOhosOptional< U > &rhs)
std::enable_if_t< qohosplugincore_h_detail::hasEqualityComparator< T, U >, bool > operator==(const QOhosOptional< T > &lhs, const U &rhs)
QOhosOptional< QOhosDisplayInfo::JsDisplayId > displayId
Definition window.h:28
QSizeF physicalSize() const
QOhosOptional< QPoint > topLeftOffsetPixels
QRect displayGeometryPixels() const
static QOhosDisplayInfo makeFromOhosDisplayObject(QtOhos::JsState &jsState, QNapi::Object displayObject)
QOhosOptional< JsDisplayOrientation > orientation
QOhosOptional< DisplaySourceMode > sourceMode
static constexpr std::array< std::pair< QOhosAbilityOnContinueResult, const char * >, 3 > enumeratorsNames