1 /* 2 * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_ABILITY_RUNTIME_JS_ABILITY_MANAGER_UTILS_H 17 #define OHOS_ABILITY_RUNTIME_JS_ABILITY_MANAGER_UTILS_H 18 19 #include "ability_running_info.h" 20 #include "ability_state_data.h" 21 #include "element_name.h" 22 #include "extension_running_info.h" 23 #include "native_engine/native_engine.h" 24 25 namespace OHOS { 26 namespace AbilityRuntime { 27 using OHOS::AppExecFwk::AbilityStateData; 28 napi_value CreateJsAbilityRunningInfoArray( 29 napi_env env, const std::vector<AAFwk::AbilityRunningInfo> &infos); 30 napi_value CreateJsExtensionRunningInfoArray( 31 napi_env env, const std::vector<AAFwk::ExtensionRunningInfo> &infos); 32 napi_value CreateJsAbilityRunningInfo(napi_env env, const AAFwk::AbilityRunningInfo &info); 33 napi_value CreateJsExtensionRunningInfo(napi_env env, const AAFwk::ExtensionRunningInfo &info); 34 napi_value AbilityStateInit(napi_env env); 35 napi_value UserStatusInit(napi_env env); 36 napi_value CreateJsElementName(napi_env env, const AppExecFwk::ElementName &elementName); 37 napi_value CreateJsAbilityStateData(napi_env env, const AbilityStateData &abilityStateData); 38 napi_value CreateJsAbilityStateDataArray( 39 napi_env env, const std::vector<AppExecFwk::AbilityStateData> &abilityStateDatas); 40 } // namespace AbilityRuntime 41 } // namespace OHOS 42 #endif // OHOS_ABILITY_RUNTIME_JS_ABILITY_MANAGER_UTILS_H 43