1600cc4afSopenharmony_ci/*
2600cc4afSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3600cc4afSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4600cc4afSopenharmony_ci * you may not use this file except in compliance with the License.
5600cc4afSopenharmony_ci * You may obtain a copy of the License at
6600cc4afSopenharmony_ci *
7600cc4afSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8600cc4afSopenharmony_ci *
9600cc4afSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10600cc4afSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11600cc4afSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12600cc4afSopenharmony_ci * See the License for the specific language governing permissions and
13600cc4afSopenharmony_ci * limitations under the License.
14600cc4afSopenharmony_ci */
15600cc4afSopenharmony_ci
16600cc4afSopenharmony_ci#ifndef FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_MODULE_PROFILE_H
17600cc4afSopenharmony_ci#define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_MODULE_PROFILE_H
18600cc4afSopenharmony_ci
19600cc4afSopenharmony_ci#include "app_privilege_capability.h"
20600cc4afSopenharmony_ci#include "appexecfwk_errors.h"
21600cc4afSopenharmony_ci#include "bundle_extractor.h"
22600cc4afSopenharmony_ci#include "inner_bundle_info.h"
23600cc4afSopenharmony_ci
24600cc4afSopenharmony_cinamespace OHOS {
25600cc4afSopenharmony_cinamespace AppExecFwk {
26600cc4afSopenharmony_cistruct OverlayMsg {
27600cc4afSopenharmony_ci    OverlayType type = NON_OVERLAY_TYPE;
28600cc4afSopenharmony_ci    bool isAppPriorityExisted = false;
29600cc4afSopenharmony_ci    bool isModulePriorityExisted = false;
30600cc4afSopenharmony_ci};
31600cc4afSopenharmony_ci
32600cc4afSopenharmony_ciclass ModuleProfile {
33600cc4afSopenharmony_cipublic:
34600cc4afSopenharmony_ci    /**
35600cc4afSopenharmony_ci     * @brief Transform the information of module.json to InnerBundleInfo object.
36600cc4afSopenharmony_ci     * @param source Indicates the std::ostringstream of module.json.
37600cc4afSopenharmony_ci     * @param bundleExtractor hold hap files.
38600cc4afSopenharmony_ci     * @param innerBundleInfo Indicates the obtained InnerBundleInfo object.
39600cc4afSopenharmony_ci     * @return Returns ERR_OK if the information transformed successfully; returns error code otherwise.
40600cc4afSopenharmony_ci     */
41600cc4afSopenharmony_ci    ErrCode TransformTo(
42600cc4afSopenharmony_ci        const std::ostringstream &source,
43600cc4afSopenharmony_ci        const BundleExtractor &bundleExtractor,
44600cc4afSopenharmony_ci        InnerBundleInfo &innerBundleInfo) const;
45600cc4afSopenharmony_ci
46600cc4afSopenharmony_ciprivate:
47600cc4afSopenharmony_ci    OverlayMsg ObtainOverlayType(const nlohmann::json &jsonObject) const;
48600cc4afSopenharmony_ci};
49600cc4afSopenharmony_ci}  // namespace AppExecFwk
50600cc4afSopenharmony_ci}  // namespace OHOS
51600cc4afSopenharmony_ci#endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_MODULE_PROFILE_H
52