18#include <QtCore/private/qnapi_p.h>
19#include <QtCore/private/qohoslogger_p.h>
20#include <QtCore/qjsonarray.h>
21#include <QtCore/qjsonobject.h>
22#include <QtCore/qjsonvalue.h>
23#include <QtCore/qstring.h>
32#include <napi/native_api.h>
42 template <
typename T,
typename Enable =
void>
45 static_assert(
sizeof(T) == 0,
"Unsupported type - provide proper QOhosJsEnv::QNapiValue"
49 static_assert(
sizeof(T) == 0,
"Unsupported type - provide proper QOhosJsEnv::QNapiValue"
56 return QNapiValue<
typename std::decay<T>::type>::create(env, std::forward<T>(value));
59 template<
typename ReturnType>
62 return QNapiValue<
typename std::decay<ReturnType>::type>::get(value).UnwrapOr(ReturnType());
155 throw Napi::
Error::
New(
env,
"Got unsupported (impossible) QJsonValue");
Combined button and popup list for selecting options.
std::shared_ptr< OperationStatus > startAbility(const Want &want, std::shared_ptr< StartOptions > options)
Starts an Ability for a given want and options; pass a null options to start without any start option...
void startNewAbilityInstance(QWidget *instanceWidget)
Starts another instance of the UIAbility used by the Qt app with specified widget inside.
void setAbilityInstanceDestroyEnabled(QWindow *instanceWindow, bool destroyEnabled)
Sets whether the Ability related with instanceWindow can be automatically destroyed by the system whe...
std::shared_ptr< OperationStatus > startAbilityByType(const QString &appType, const QJsonObject &wantParameters)
Starts an Ability for a given appType and wantParameters.
void startAppProcess(const QString &processId, const Want &requestWant, std::shared_ptr< StartOptions > options)
Starts application process for a given processId, requestWant and options; pass a null options to sta...
std::optional< QByteArray > tryGetOnContinueData(const Want &want)
Tries to get continuation / migration related data that was provided on the source device.
std::shared_ptr< OpenLinkOptions > createOpenLinkOptions()
@ WINDOW_MODE_SPLIT_PRIMARY
@ WINDOW_MODE_SPLIT_SECONDARY
@ NEW_PROCESS_ATTACH_TO_PARENT
@ NEW_PROCESS_ATTACH_TO_STATUS_BAR_ITEM
@ ATTACH_TO_STATUS_BAR_ITEM
static Napi::Maybe< T > get(const QNapi::Value &)
static QNapi::Value create(napi_env, T)
static QNapi::Value toNapiValue(napi_env env, T &&value)
static ReturnType fromNapiValue(const QNapi::Value &value)
std::optional< Want > want
static constexpr std::array< std::pair< Enum, const char * >, 3 > enumeratorsNames
static constexpr const char * fullTypeName
enums::ohos::app::ability::contextConstant::ProcessMode Enum
enums::ohos::app::ability::contextConstant::StartupVisibility Enum
static constexpr const char * fullTypeName
static constexpr std::array< std::pair< Enum, const char * >, 2 > enumeratorsNames