• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 MOCK_FOUNDATION_ABILITY_RUNTIME_SIMULATOR_COMMON_ABILITY_INFO_H
17 #define MOCK_FOUNDATION_ABILITY_RUNTIME_SIMULATOR_COMMON_ABILITY_INFO_H
18 
19 #include <string>
20 #include <vector>
21 #include "application_info.h"
22 #include "extension_ability_info.h"
23 #include "skill.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 enum class DisplayOrientation {
28     UNSPECIFIED = 0,
29     LANDSCAPE,
30     PORTRAIT,
31     FOLLOWRECENT,
32     LANDSCAPE_INVERTED,
33     PORTRAIT_INVERTED,
34     AUTO_ROTATION,
35     AUTO_ROTATION_LANDSCAPE,
36     AUTO_ROTATION_PORTRAIT,
37     AUTO_ROTATION_RESTRICTED,
38     AUTO_ROTATION_LANDSCAPE_RESTRICTED,
39     AUTO_ROTATION_PORTRAIT_RESTRICTED,
40     LOCKED,
41 };
42 
43 enum class LaunchMode {
44     SINGLETON = 0,
45     STANDARD,  // support more than one instance
46     SPECIFIED,
47 };
48 
49 struct AbilityInfo {
50     std::string name;
51     std::string label;
52     std::string description;
53     std::string iconPath;
54     int32_t labelId;
55     int32_t descriptionId;
56     int32_t iconId;
57     std::string theme;
58     ExtensionAbilityType extensionAbilityType = ExtensionAbilityType::UNSPECIFIED;
59     DisplayOrientation orientation = DisplayOrientation::UNSPECIFIED;
60     LaunchMode launchMode = LaunchMode::SINGLETON;
61     std::string srcPath;
62     std::vector<std::string> permissions;
63     std::string uri;
64     ApplicationInfo applicationInfo;
65     bool enabled = false;
66     MetaData metaData;
67     std::string bundleName;
68     std::string moduleName;       // the "module.name" in config.json
69     std::string applicationName;  // the "bundlename" in config.json
70     std::string codePath;         // ability main code path with name
71     std::string hapPath;
72     std::string srcEntrance;
73     std::vector<Metadata> metadata;
74     bool isStageBasedModel = false;
75     std::vector<Skill> skills;
76     int32_t uid = -1;
77 };
78 } // namespace AppExecFwk
79 } // namespace OHOS
80 #endif