7#include <QtCore/private/qohoscommon_p.h>
8#include <QtCore/private/qohoslogger_p.h>
9#include <QtCore/qglobal.h>
10#include <QtCore/qpoint.h>
11#include <arkui/native_type.h>
15#include <qohosutils.h>
31 const char *
value()
const;
39template<
typename Func, Func f,
typename... FuncArgs>
52template<
typename Func, Func f,
typename... FuncArgs>
63 return std::to_string(funcArg);
70 return std::to_string(funcArg) +
":enum(" +
typeid(T).name() +
"):";
77 char buffer[] =
"0xFFFFFFFFFFFFFFFF";
78 std::snprintf(buffer,
sizeof(buffer),
"%p", funcArg);
79 return std::string(buffer);
91 return '"' +
std::string(funcArg) +
'"';
94template<
typename... FuncArgs>
97 std::string allArgsString;
98 std::string argsStrings[] = {buildFuncArgString(funcArgs)...};
99 for (
const auto &argString : argsStrings) {
100 if (!allArgsString.empty())
101 allArgsString +=
", ";
102 allArgsString += argString;
105 return std::string(funcName) +
"(" + allArgsString +
")";
118 "callArkUiFunc: %s => %s",
126template<
typename Func,
typename... FuncArgs>
135 qOhosPrintfDebug(
"callArkUiFunc: %s", buildFuncCallString(funcName, funcArgs...).c_str());
142 return {
static_cast<
float>(point.x()),
static_cast<
float>(point.y())};
165template<
typename Func, Func f,
typename... FuncArgs>
175 if (funcResult != ::ARKUI_ERROR_CODE_NO_ERROR) {
176 qOhosReportFatalErrorAndAbort(
177 "ArkUi function call %s failed with error: %d",
178 buildFuncCallString(func.name(), funcArgs...).c_str(), funcResult);
193 "ArkUi function call %s failed (returned null)",
199template<
typename Func, Func f,
typename... FuncArgs>
operator std::string() const
operator const char *() const
const char * value() const
CZString(const char *value)
JsWindowRef(JsWindowRef &&)=delete
JsWindowRef(std::string owningQAbilityInstanceId, JsWindowId windowId, QNapi::Object jsWindow, QtOhos::QObjectThreadSafeRef owningQWindowRef)
JsWindowRef(const JsWindowRef &)=delete
QtOhos::QObjectThreadSafeRef owningQWindowRef() const
JsWindowRef & operator=(JsWindowRef &&)=delete
Result eval(const std::string &expr, const std::vector< QNapi::ValueWrapper > &exprArgs={}) const
bool isWindowShown() const
JsWindowRef & operator=(const JsWindowRef &)=delete
const std::string & owningQAbilityInstanceId() const
QNapi::Promise evalToPromiseOrRejectOnThrow(const std::string &expr, const std::vector< QNapi::ValueWrapper > &exprArgs={}) const
bool operator!=(const TypedId &other) const
IdValueType value() const
bool operator==(const TypedId &other) const
TypedId(IdValueType value)
TypedId(const TypedId &other)
TypedId & operator=(const TypedId &other)
TypedId & operator=(TypedId &&other)
bool operator<(const TypedId &other) const
std::string buildFuncCallString(const char *funcName, FuncArgs &&...funcArgs)
std::enable_if_t< std::is_arithmetic< T >::value, std::string > buildFuncArgString(const T &funcArg)
constexpr bool arkUiCallsLogging
std::string buildFuncArgString(CZString funcArg)
std::enable_if_t< std::is_void< QOhosInvokeResult< Func, FuncArgs... > >::value, void > callArkUiFunc(const char *funcName, Func &&func, FuncArgs &&...funcArgs)
std::array< float, 2 > toFloatArray(const QPointF &point)
QOhosInvokeResult< Func, FuncArgs... > callArkUi(QOhosNamedFunc< Func, f > func, FuncArgs &&...funcArgs)
std::optional< WindowProperties > tryGetWindowProperties(JsWindowId jsWindowId)
std::enable_if_t< std::is_same< QOhosInvokeResult< Func, FuncArgs... >, std::int32_t >::value||std::is_enum< QOhosInvokeResult< Func, FuncArgs... > >::value, void > callArkUiOrFailOnErrorResult(QOhosNamedFunc< Func, f > func, FuncArgs &&...funcArgs)
Combined button and popup list for selecting options.
@ 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
@ FLAG_AUTH_PERSISTABLE_URI_PERMISSION
@ FLAG_AUTH_READ_URI_PERMISSION
@ FLAG_ABILITY_ON_COLLABORATE
@ FLAG_START_WITHOUT_TIPS
@ FLAG_AUTH_WRITE_URI_PERMISSION
@ NOTIFICATION_CONTENT_MULTILINE
@ NOTIFICATION_CONTENT_LONG_TEXT
@ NOTIFICATION_CONTENT_CONVERSATION
@ NOTIFICATION_CONTENT_SYSTEM_LIVE_VIEW
@ NOTIFICATION_CONTENT_PICTURE
@ NOTIFICATION_CONTENT_LIVE_VIEW
@ NOTIFICATION_CONTENT_BASIC_TEXT
@ ENTER_IMMERSIVE_DISABLE_TITLE_AND_DOCK_HOVER
@ FOLLOW_APP_IMMERSIVE_SETTING
@ TYPE_NAVIGATION_INDICATOR
std::optional< QNapi::Object > tryMapOptMainWindowToQAbility(QOhosJsState &jsState, std::optional< QtOhos::QObjectThreadSafeRef > optInstanceMainWindowRef)
std::string const char * mapBoolToTrueFalseStr(bool value)
QOhosConsumer< T > makeCompressingAsyncConsumer(QOhosConsumer< T > baseConsumer, QOhosConsumer< std::function< void()> > asyncExecutor)
ForwardIt removeMatchingWithLookahead(ForwardIt firstIt, ForwardIt lastIt, Predicate &&predicate)
std::optional< double > tryParseStringAsFiniteDouble(const std::string &inputString)
void tupleForEach(const std::tuple< TupleElements... > &tuple, UnaryFunc func, std::index_sequence< TupleIndices... >)
void tupleForEach(const std::tuple< TupleElements... > &tuple, UnaryFunc func)
constexpr T makeCopyByValue(T value)
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::bundle::bundleManager::SupportWindowMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::window::WindowStatusType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::window::ModalityType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::ConfigurationConstant::ColorMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::file::picker::DocumentSelectMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::AbilityConstant::WindowMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::wantConstant::Flags))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::AbilityConstant::ContinueState))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::window::AnimationType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::window::MaximizePresentation))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::inputMethod::Direction))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::display::Orientation))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::display::DisplaySourceMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::multimodalInput::pointer::PointerStyle))
QT_END_NAMESPACE Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::kit::ShareKit::systemShare::SelectionMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::notificationManager::ContentType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::window::AvoidAreaType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::AbilityConstant::LaunchReason))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::contextConstant::ProcessMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::inputMethod::RequestKeyboardReason))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::contextConstant::StartupVisibility))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::inputMethod::EnterKeyType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::kit::ShareKit::systemShare::SharePreviewMode))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::app::ability::AbilityConstant::OnContinueResult))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::window::WindowEventType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::abilityAccessCtrl::PermissionStatus))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::graphics::text::SystemFontType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::inputMethod::TextInputType))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::ohos::window::RectChangeReason))
Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtOhosQpa::enums::kit::ShareKit::systemShare::ShareAbilityType))
std::optional< QOhosDisplayInfo::JsDisplayId > displayId
bool isDisplayMainOrExtended() const
QtOhosQpa::enums::ohos::display::Orientation JsDisplayOrientation
QtOhosQpa::enums::ohos::display::DisplaySourceMode DisplaySourceMode
std::optional< DisplaySourceMode > sourceMode
QSizeF physicalSize() const
QRect displayGeometryPixels() const
static std::optional< QNapi::Object > tryGetDisplayById(QOhosJsState &jsState, QOhosDisplayInfo::JsDisplayId displayId)
std::optional< QPoint > topLeftOffsetPixels
static QOhosDisplayInfo makeFromOhosDisplayObject(QOhosJsState &jsState, QNapi::Object displayObject)
std::optional< JsDisplayOrientation > orientation
bool shouldIgnoreDisplay() const
EvaluateSequentially(Args &&...)
static constexpr const char * fullTypeName
static constexpr std::array< std::pair< Enum, const char * >, 3 > enumeratorsNames
QtOhosQpa::enums::ohos::app::ability::contextConstant::ProcessMode Enum
static constexpr const char * fullTypeName
QtOhosQpa::enums::ohos::app::ability::contextConstant::StartupVisibility Enum
static constexpr std::array< std::pair< Enum, const char * >, 2 > enumeratorsNames
QtOhosQpa::enums::ohos::graphics::text::SystemFontType Enum
static constexpr std::array< std::pair< Enum, const char * >, 5 > enumeratorsNames
static constexpr const char * fullTypeName
static constexpr std::array< std::pair< Enum, const char * >, 15 > enumeratorsNames
QtOhosQpa::enums::ohos::inputMethod::TextInputType Enum
static constexpr const char * fullTypeName
static constexpr const char * fullTypeName
QtOhosQpa::enums::ohos::notificationManager::ContentType Enum
static constexpr std::array< std::pair< Enum, const char * >, 7 > enumeratorsNames