• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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_ABILITY_RUNTIME_SIMULATOR_OPTIONS_H
17 #define FOUNDATION_ABILITY_RUNTIME_SIMULATOR_OPTIONS_H
18 
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 #include "ability_info.h"
24 #include "application_info.h"
25 #include "configuration.h"
26 #include "hap_module_info.h"
27 
28 namespace OHOS {
29 namespace AbilityRuntime {
30 enum class DeviceType {
31     PHONE,
32     TV,
33     WATCH,
34     CAR,
35     TABLET,
36     UNKNOWN,
37 };
38 
39 enum class DeviceOrientation : int32_t {
40     PORTRAIT,
41     LANDSCAPE,
42     ORIENTATION_UNDEFINED,
43 };
44 
45 enum class ColorMode : int32_t {
46     LIGHT = 0,
47     DARK,
48     COLOR_MODE_UNDEFINED,
49 };
50 
51 struct DeviceConfig {
52     DeviceOrientation orientation { DeviceOrientation::PORTRAIT };
53     double density { 1.0 };
54     DeviceType deviceType { DeviceType::PHONE };
55     double fontRatio { 1.0 };
56     ColorMode colorMode { ColorMode::LIGHT };
57 };
58 
59 struct DeviceResourceInfo {
60     DeviceConfig deviceConfig;
61     std::vector<int64_t> resourcehandlers;
62     std::string packagePath;
63     int32_t themeId { -1 };
64 };
65 
66 using SendCurrentRouterCallback = bool (*)(const std::string currentRouterPath);
67 
68 struct Options {
69     std::string bundleName;
70     std::string moduleName;
71     std::string modulePath;
72     std::string resourcePath;
73     int debugPort = -1;
74     std::string assetPath;
75     std::string systemResourcePath;
76     std::string appResourcePath;
77     std::string containerSdkPath;
78     std::string url;
79     std::string language;
80     std::string region;
81     std::string script;
82     uint32_t themeId;
83     int32_t deviceWidth;
84     int32_t deviceHeight;
85     bool isRound;
86     SendCurrentRouterCallback onRouterChange;
87     DeviceConfig deviceConfig;
88     int32_t compatibleVersion;
89     bool installationFree;
90     int32_t labelId;
91     std::string compileMode;
92     std::string pageProfile;
93     int32_t targetVersion;
94     std::string releaseType;
95     bool enablePartialUpdate;
96     std::string previewPath;
97     AppExecFwk::ApplicationInfo applicationInfo;
98     AppExecFwk::HapModuleInfo hapModuleInfo;
99     AppExecFwk::AbilityInfo abilityInfo;
100     std::shared_ptr<AppExecFwk::Configuration> configuration;
101 };
102 } // namespace AbilityRuntime
103 } // namespace OHOS
104 #endif // FOUNDATION_ABILITY_RUNTIME_SIMULATOR_OPTIONS_H
105