• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 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_ACELITE_OHOS_MODULE_CONFIG_H
17 #define OHOS_ACELITE_OHOS_MODULE_CONFIG_H
18 
19 #include "acelite_config.h"
20 #include "jsi_types.h"
21 
22 namespace OHOS {
23 namespace ACELite {
24 #if (ENABLE_MODULE_REQUIRE_TEST == 1)
25 extern void InitSampleModule(JSIValue exports);
26 #endif
27 extern void InitRouterModule(JSIValue exports);
28 extern void InitAppModule(JSIValue exports);
29 #if (FEATURE_SUPPORT_HTTP == 1)
30 extern void InitFetchModule(JSIValue exports);
31 #endif // FEATURE_SUPPORT_HTTP
32 #if (FEATURE_MODULE_AUDIO == 1)
33 extern void InitAudioModule(JSIValue exports);
34 #endif // FEATURE_MODULE_AUDIO
35 #if (FEATURE_ACELITE_DFX_MODULE == 1)
36 extern void InitDfxModule(JSIValue exports);
37 #endif // FEATURE_ACELITE_DFX_MODULE
38 #if (ENABLE_MODULE_CIPHER == 1)
39 extern void InitCipherModule(JSIValue exports);
40 #endif
41 #if (FEATURE_MODULE_DIALOG == 1)
42 extern void InitDialogModule(JSIValue exports);
43 #endif // FEATURE_MODULE_DIALOG
44 
45 #if (FEATURE_MODULE_STORAGE == 1)
46 extern void InitNativeApiFs(JSIValue exports);
47 extern void InitNativeApiKv(JSIValue exports);
48 #endif
49 
50 #if (FEATURE_MODULE_DEVICE == 1)
51 extern void InitDeviceModule(JSIValue exports);
52 #endif
53 
54 #if (FEATURE_MODULE_GEO == 1)
55 extern void InitLocationModule(JSIValue exports);
56 #endif
57 
58 #if (FEATURE_MODULE_SENSOR == 1)
59 extern void InitVibratorModule(JSIValue exports);
60 extern void InitSensorModule(JSIValue exports);
61 #endif
62 
63 #if (FEATURE_MODULE_BRIGHTNESS == 1)
64 extern void InitBrightnessModule(JSIValue exports);
65 #endif
66 
67 #if (FEATURE_MODULE_BATTERY == 1)
68 extern void InitBatteryModule(JSIValue exports);
69 #endif
70 
71 #if (FEATURE_MODULE_CONFIGURATION == 1)
72 extern void InitLocaleModule(JSIValue exports);
73 #endif
74 
75 #if (FEATURE_ACELITE_SYSTEM_CAPABILITY == 1)
76 extern void InitCapabilityModule(JSIValue exports);
77 #endif
78 
79 #if (ENABLE_MODULE_DM_LITE == 1)
80 extern void InitDeviceManagerModule(JSIValue exports);
81 #endif
82 
83 #if (FEATURE_MODULE_OHOS_HILOG == 1)
84 extern void InitHilogModule(JSIValue exports);
85 #endif
86 
87 #if (FEATURE_COMPONENT_DEVICE_ATTEST == 1)
88 extern void InitDeviceAttestModule(JSIValue exports);
89 #endif
90 
91 #if (FEATURE_ACELITE_HUKS == 1)
92 extern void InitHuksModule(JSIValue exports);
93 #endif
94 
95 // Config information for built-in JS modules of OHOS platform
96 const Module OHOS_MODULES[] = {
97 #if (ENABLE_MODULE_REQUIRE_TEST == 1)
98     {"sample", InitSampleModule},
99 #endif
100     {"app", InitAppModule},
101 #if (FEATURE_SUPPORT_HTTP == 1)
102     {"fetch", InitFetchModule},
103 #endif // FEATURE_SUPPORT_HTTP
104 #if (FEATURE_MODULE_AUDIO == 1)
105     {"audio", InitAudioModule},
106 #endif // FEATURE_MODULE_AUDIO
107 #if (FEATURE_ACELITE_DFX_MODULE == 1)
108     {"dfx", InitDfxModule},
109 #endif // FEATURE_ACELITE_DFX_MODULE
110     {"router", InitRouterModule},
111 #if (ENABLE_MODULE_CIPHER == 1)
112     {"cipher", InitCipherModule},
113 #endif
114 #if (FEATURE_MODULE_DIALOG == 1)
115     {"prompt", InitDialogModule},
116 #endif // FEATURE_MODULE_DIALOG
117 
118 #if (FEATURE_MODULE_STORAGE == 1)
119     {"file", InitNativeApiFs},
120     {"storage", InitNativeApiKv},
121 #endif
122 #if (FEATURE_MODULE_DEVICE == 1)
123     {"device", InitDeviceModule},
124 #endif
125 #if (FEATURE_MODULE_GEO == 1)
126     {"geolocation", InitLocationModule},
127 #endif
128 #if (FEATURE_MODULE_SENSOR == 1)
129     {"vibrator", InitVibratorModule},
130     {"sensor", InitSensorModule},
131 #endif
132 #if (FEATURE_MODULE_BRIGHTNESS == 1)
133     {"brightness", InitBrightnessModule},
134 #endif
135 #if (FEATURE_MODULE_BATTERY == 1)
136     {"battery", InitBatteryModule},
137 #endif
138 #if (FEATURE_MODULE_CONFIGURATION == 1)
139     {"configuration", InitLocaleModule},
140 #endif
141 #if (FEATURE_ACELITE_SYSTEM_CAPABILITY == 1)
142     {"capability", InitCapabilityModule},
143 #endif
144 #if (ENABLE_MODULE_DM_LITE == 1)
145     {"devicemanager", InitDeviceManagerModule},
146 #endif
147 #if (FEATURE_MODULE_OHOS_HILOG == 1)
148     {"hilog", InitHilogModule},
149 #endif
150 #if (FEATURE_COMPONENT_DEVICE_ATTEST == 1)
151     {"deviceAttest", InitDeviceAttestModule},
152 #endif
153 #if (FEATURE_ACELITE_HUKS == 1)
154     {"security.huks", InitHuksModule},
155 #endif
156 };
157 } // namespace ACELite
158 } // namespace OHOS
159 
160 #endif // OHOS_ACELITE_OHOS_MODULE_CONFIG_H
161