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(QOhosJsState &jsState, CreateInfo createInfo)
QOhosDisplayInfo::JsDisplayId JsDisplayId
QPoint mapFromDisplayToGlobal(const QPoint &displayOffset, QOhosDisplayInfo::JsDisplayId jsDisplayId)
Combined button and popup list for selecting options.
std::optional< std::uint32_t > tryGetCodeFromJsBusinessError(const Napi::Error &error)
bool runIgnoringJsBusinessError(QOhosJsState &, std::uint32_t suppressedErrorCode, const char *callerContextName, const std::function< void()> &action)
QNapi::Promise adaptAsyncCallResultToJsPromise(QOhosJsState &jsState, std::function< QNapi::Value(QOhosJsState &, T)> promiseValueFactory, const QOhosConsumer< QOhosJsState &, QOhosConsumer< QOhosJsState &, T > > &asyncCallFunc)
std::optional< T > getOptionalProperty(const QNapi::Object &object, const std::string &propName)
QNapi::Promise makeResolvedPromise(QNapi::Value valueForResolve)
void rethrowUnlessJsBusinessErrorIs(const Napi::Error &error, std::uint32_t suppressedErrorCode, const char *callerContextName)
int setJsTimeout(QOhosJsState &jsState, std::function< void(const QOhosCallbackInfo &)> timeoutFunc, std::chrono::milliseconds delay)
QOhosSupplier< ConfigValue > makeOhosConfigValueDataSource(std::function< ConfigValue(QOhosJsState &)> initValueSupplier, std::function< ConfigValue(QOhosJsState &, const QNapi::Object &)> valueFetcher, QOhosConsumer< ConfigValue > valueChangedHandler)
void clearJsTimeout(QOhosJsState &jsState, int timerId)
QOhosConsumer< QOhosJsState &, JsDisplayId, QRectF > displayAvailableAreaChangedCb