• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_HAP_MODULE_INFO_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_HAP_MODULE_INFO_H
18 
19 #include <string>
20 
21 #include "ability_info.h"
22 #include "extension_ability_info.h"
23 #include "parcel.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 enum class ModuleColorMode {
28     AUTO = -1,
29     DARK,
30     LIGHT,
31 };
32 
33 enum class ModuleType {
34     UNKNOWN = 0,
35     ENTRY = 1,
36     FEATURE = 2,
37     HAR = 3
38 };
39 
40 // configuration information about an module
41 struct HapModuleInfo : public Parcelable {
42     std::string name;        // module.name in config.json
43     std::string package;
44     std::string moduleName;  // module.distro.moduleName in config.json
45     std::string description;
46     int32_t descriptionId = 0;
47     std::string iconPath;
48     int32_t iconId = 0;
49     std::string label;
50     int32_t labelId = 0;
51     std::string backgroundImg;
52     std::string mainAbility;
53     std::string srcPath;
54     int supportedModes = 0;
55 
56     std::vector<std::string> reqCapabilities;
57     std::vector<std::string> deviceTypes;
58     std::vector<AbilityInfo> abilityInfos;
59     ModuleColorMode colorMode = ModuleColorMode::AUTO;
60     // new version fields
61     std::string bundleName;
62     std::string mainElementName;
63     std::string pages;
64     std::string process;
65     std::string resourcePath;
66     std::string srcEntrance;
67     std::string uiSyntax;
68     std::string virtualMachine;
69     bool deliveryWithInstall = false;
70     bool installationFree = false;
71     bool isModuleJson = false;
72     bool isStageBasedModel = false;
73     ModuleType moduleType = ModuleType::UNKNOWN;
74     std::vector<ExtensionAbilityInfo> extensionInfos;
75     std::vector<Metadata> metadata;
76 
77     bool ReadFromParcel(Parcel &parcel);
78     virtual bool Marshalling(Parcel &parcel) const override;
79     static HapModuleInfo *Unmarshalling(Parcel &parcel);
80 };
81 }  // namespace AppExecFwk
82 }  // namespace OHOS
83 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_BASE_INCLUDE_HAP_MODULE_INFO_H
84