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/**
17 * Common constants for all features.
18 */
19export class CommonConstants {
20
21  /**
22   * dock space
23   */
24  static DOCK_SPACE = 0.1;
25
26  /**
27   * Bundle name of launcher
28   */
29  static LAUNCHER_BUNDLE = 'com.ohos.launcher';
30
31  /**
32  * Module name of AppCenter.
33  */
34  static MODULE_NAME = 'pad_launcher';
35
36  /**
37   * Ability name of AppCenter.
38   */
39  static APPCENTER_ABILITY = 'com.ohos.launcher.appcenter.MainAbility';
40
41  /**
42   * Ability name of launcher settings.
43   */
44  static SETTING_ABILITY = 'com.ohos.launcher.settings.MainAbility';
45
46  /**
47  * Module name of launcher settings.
48  */
49  static SETTING_MODULE = 'launcher_settings';
50
51  /**
52   * Ability name of launcher Recents.
53   */
54  static RECENT_ABILITY = 'com.ohos.launcher.recents.MainAbility';
55
56  /**
57   * Launcher Ability name.
58   */
59  static LAUNCHER_ABILITY = 'com.ohos.launcher.MainAbility';
60
61  /**
62   * Default invalid value.
63   */
64  static INVALID_VALUE = -1;
65
66  /**
67   * folder min app count
68   */
69  static FOLDER_APP_VALUE = 1;
70
71  /**
72   * Status code if uninstal succeeded, success, successful.
73   */
74  static UNINSTALL_SUCCESS = 0;
75
76  /**
77   * Status code if uninstall is forbidden.
78   */
79  static UNINSTALL_FORBID = 1;
80
81  /**
82   * Grid item type for apps.
83   */
84  static TYPE_APP = 0;
85
86  /**
87   * Grid item type for cards.
88   */
89  static TYPE_CARD = 1;
90
91  /**
92   * Grid item type for functions.
93   */
94  static TYPE_FUNCTION = 2;
95
96  /**
97   * folder type in desktop
98   */
99  static TYPE_FOLDER = 3;
100
101  /**
102   * add icon type in opening folder
103   */
104  static TYPE_ADD = 4;
105
106  /**
107   * Card dimension constants for 1 row 2 columns.
108   */
109  static CARD_DIMENSION_1x2 = 1;
110
111  /**
112   * Card dimension constants for 2 rows 2 columns.
113   */
114  static CARD_DIMENSION_2x2 = 2;
115
116  /**
117   * Card dimension constants for 2 rows 4 columns.
118   */
119  static CARD_DIMENSION_2x4 = 3;
120
121  /**
122   * Card dimension constants for 4 rows 4 columns.
123   */
124  static CARD_DIMENSION_4x4 = 4;
125
126  /**
127   * Card dimension constants for 2 rows 1 columns.
128   */
129  static CARD_DIMENSION_2x1 = 5;
130
131  /**
132   * Card dimension constants for 1 rows 1 columns.
133   */
134  static CARD_DIMENSION_1x1 = 6;
135
136  /**
137   * Card dimension constants for 6 rows 4 columns.
138   */
139  static CARD_DIMENSION_6x4 = 7;
140
141  /**
142   * Common level layout config. Default config for common components.
143   */
144  static LAYOUT_CONFIG_LEVEL_COMMON = 'common';
145
146  /**
147   * Feature level layout config. Default config for components in this feature.
148   */
149  static LAYOUT_CONFIG_LEVEL_FEATURE = 'feature';
150
151  /**
152   * Product level layout config. Custom config for this product.
153   */
154  static LAYOUT_CONFIG_LEVEL_PRODUCT = 'product';
155
156  /**
157   * Layout config type for layout mode.
158   */
159  static LAYOUT_CONFIG_TYPE_MODE = 0;
160
161  /**
162   * Layout config type for layout style.
163   */
164  static LAYOUT_CONFIG_TYPE_STYLE = 1;
165
166  /**
167   * Layout config type for layout function.
168   */
169  static LAYOUT_CONFIG_TYPE_FUNCTION = 2;
170
171  /**
172   * Default device type constant.
173   */
174  static DEFAULT_DEVICE_TYPE = 'phone';
175
176  /**
177   * Device type constant for tablet.
178   */
179  static PAD_DEVICE_TYPE = 'pad';
180
181  /**
182   * Overlay blur radius.
183   */
184  static OVERLAY_BLUR_RADIUS = 20;
185
186  /**
187   * Overlay type for hidden items.
188   */
189  static OVERLAY_TYPE_HIDE = -1;
190
191  /**
192   * Overlay type for app menus.
193   */
194  static OVERLAY_TYPE_APP_MENU = 0;
195
196  /**
197   * Overlay type for app icons.
198   */
199  static OVERLAY_TYPE_APP_ICON = 1;
200
201  /**
202   * Overlay type for folders.
203   */
204  static OVERLAY_TYPE_FOLDER = 2;
205
206  /**
207   * Overlay type for forms
208   */
209  static OVERLAY_TYPE_CARD = 3;
210
211  /**
212   * Overlay type for residential.
213   */
214  static OVERLAY_TYPE_APP_RESIDENTIAL = 4;
215
216  /**
217 * Overlay type for recentdock.
218 */
219  static OVERLAY_TYPE_APP_RECENT = 5;
220
221  /**
222   * Menu type for fixed items.
223   */
224  static MENU_TYPE_FIXED = 0;
225
226  /**
227   * Menu type for dynamic items.
228   */
229  static MENU_TYPE_DYNAMIC = 1;
230
231  /**
232   * Light mode menus.
233   */
234  static MENU_UI_MODE_LIGHT = 0;
235
236  /**
237   * Dark mode menus.
238   */
239  static MENU_UI_MODE_DARK = 1;
240
241  /**
242   * Drag item type for apps.
243   */
244  static APP_TYPE_DRAG_ITEM = 0;
245
246  /**
247   * Touch event type for down events.
248   */
249  static TOUCH_TYPE_DOWN = 0;
250
251  /**
252   * Touch event type for move events.
253   */
254  static TOUCH_TYPE_MOVE = 2;
255
256  /**
257   * Touch event type for up events.
258   */
259  static TOUCH_TYPE_UP = 1;
260
261  /**
262   * FolderComponent max show length
263   */
264  static FOLDER_STATIC_SHOW_LENGTH = 11;
265
266  /**
267   * FolderComponent superpose app length
268   */
269  static FOLDER_STATIC_SUPERPOSEAPP_LENGTH = 3;
270
271  /**
272   * folder name max length
273   */
274  static FOLDER_NAME_MAX_LENGTH = 100;
275
276  /**
277   * hide badge
278   */
279  static BADGE_DISPLAY_HIDE = 0;
280
281  /**
282   * show badge
283   */
284  static BADGE_DISPLAY_SHOW = 1;
285
286  /**
287   * default user id
288   */
289  static DEFAULT_USER_ID = 0;
290
291  /**
292   * form config ability prefix
293   */
294  static FORM_CONFIG_ABILITY_PREFIX: string = 'ability://';
295
296  /**
297   * navigationbar status settingDataKey.
298   */
299  static NAVIGATION_BAR_STATUS_KEY: string = 'settings.display.navigationbar_status';
300
301  /**
302   * setting data ability uri
303   */
304  static SETTING_DATA_ABILITY_URI: string = 'dataability:///com.ohos.settingsdata.DataAbility';
305
306  /**
307   * Drag events from the smartDock.
308   */
309  static DRAG_FROM_DOCK = 1;
310
311  /**
312   * Drag events from the workspace.
313   */
314  static DRAG_FROM_DESKTOP = 2;
315}
316