4#ifndef QOHOSCLOSEEVENTCONTEXT_P_H
5#define QOHOSCLOSEEVENTCONTEXT_P_H
18#include <QtCore/private/qohoscommon_p.h>
19#include <QtCore/qcoreevent.h>
20#include <QtCore/qglobal.h>
26class QOhosCloseEventContext
29 enum class CloseRootCause
37 enum class CloseResolution
43 static CloseRootCause getCloseRootCauseForEventOrDefault(QEvent *event);
44 static void runWithCloseRootCauseSet(CloseRootCause rootCause,
const std::function<
void()> &task);
45 static void runWithCloseRootCauseAndCloseResolutionConsumerSet(
46 CloseRootCause rootCause, QOhosConsumer<CloseResolution> closeResolutionConsumer,
const std::function<
void()> &task);
47 static void notifyCloseResolutionFromEventIfValid(QEvent *event);
std::vector< QOhosDisplayInfo > getRegisteredDisplayInfos()
static std::shared_ptr< QOhosDisplayManager > create(QtOhos::JsState &jsState, CreateInfo createInfo)
QOhosDisplayInfo::JsDisplayId JsDisplayId
JsState & jsState() const
QPoint mapFromDisplayToGlobal(const QPoint &displayOffset, QOhosDisplayInfo::JsDisplayId jsDisplayId)
Combined button and popup list for selecting options.
void clearJsTimeout(JsState &jsState, int timerId)
std::optional< std::uint32_t > tryGetCodeFromJsBusinessError(const Napi::Error &error)
int setJsTimeout(JsState &jsState, std::function< void(const CallbackInfo &)> timeoutFunc, std::chrono::milliseconds delay)
bool runIgnoringJsBusinessError(JsState &, std::uint32_t suppressedErrorCode, const char *callerContextName, const std::function< void()> &action)
QNapi::Promise adaptAsyncCallResultToJsPromise(JsState &jsState, std::function< QNapi::Value(JsState &, T)> promiseValueFactory, const QOhosConsumer< JsState &, QOhosConsumer< JsState &, T > > &asyncCallFunc)
std::optional< T > getOptionalProperty(const QNapi::Object &object, const std::string &propName)
QNapi::Promise makeResolvedPromise(QNapi::Value valueForResolve)
QOhosSupplier< T > makeDataSource(std::function< T(JsState &)> initialValueReader, std::function< std::shared_ptr< void >(JsState &, QOhosConsumer< T >)> changeListenerFactory, QOhosConsumer< T > valueChangedHandler, QOhosConsumer< std::function< void()> > targetThreadExecutor, std::string callerContextName={})
void rethrowUnlessJsBusinessErrorIs(const Napi::Error &error, std::uint32_t suppressedErrorCode, const char *callerContextName)
QOhosSupplier< ConfigValue > makeOhosConfigValueDataSource(std::function< ConfigValue(QtOhos::JsState &)> initValueSupplier, std::function< ConfigValue(QtOhos::JsState &, const QNapi::Object &)> valueFetcher, QOhosConsumer< ConfigValue > valueChangedHandler)
QOhosConsumer< QtOhos::JsState &, JsDisplayId, QRectF > displayAvailableAreaChangedCb
QOhosConsumer< QtOhos::JsState &, std::vector< QOhosDisplayInfo > > displaysUpdatedCb