• 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 INTERFACES_INNERKITS_NATIVE_INCLUDE_MEDIA_LIB_SERVICE_CONST_H_
17 #define INTERFACES_INNERKITS_NATIVE_INCLUDE_MEDIA_LIB_SERVICE_CONST_H_
18 
19 #include <unordered_set>
20 
21 #include "userfile_manager_types.h"
22 
23 namespace OHOS {
24 namespace Media {
25 enum {
26     MEDIA_GET_MEDIA_ASSETS = 0,
27     MEDIA_GET_IMAGE_ASSETS = 1,
28     MEDIA_GET_AUDIO_ASSETS = 2,
29     MEDIA_GET_VIDEO_ASSETS = 3,
30     MEDIA_GET_IMAGEALBUM_ASSETS = 4,
31     MEDIA_GET_VIDEOALBUM_ASSETS = 5,
32     MEDIA_CREATE_MEDIA_ASSET = 6,
33     MEDIA_DELETE_MEDIA_ASSET = 7,
34     MEDIA_MODIFY_MEDIA_ASSET = 8,
35     MEDIA_COPY_MEDIA_ASSET   = 9,
36     MEDIA_CREATE_MEDIA_ALBUM_ASSET  = 10,
37     MEDIA_DELETE_MEDIA_ALBUM_ASSET  = 11,
38     MEDIA_MODIFY_MEDIA_ALBUM_ASSET  = 12,
39 };
40 
41 /* ENUM Asset types */
42 enum AssetType {
43     ASSET_MEDIA = 0,
44     ASSET_IMAGE,
45     ASSET_AUDIO,
46     ASSET_VIDEO,
47     ASSET_GENERIC_ALBUM,
48     ASSET_IMAGEALBUM,
49     ASSET_VIDEOALBUM,
50     ASSET_NONE
51 };
52 
53 enum DirType {
54     DIR_CAMERA = 0,
55     DIR_VIDEO,
56     DIR_IMAGE,
57     DIR_AUDIOS,
58     DIR_DOCUMENTS,
59     DIR_DOWNLOAD,
60     DIR_TYPE_MAX
61 };
62 
63 enum class CloudSyncErrType : int32_t {
64     OTHER_ERROR = 0,
65     CONTENT_NOT_FOUND,
66     THM_NOT_FOUND,
67     LCD_NOT_FOUND,
68     LCD_SIZE_IS_TOO_LARGE,
69     CONTENT_SIZE_IS_ZERO,
70     ALBUM_NOT_FOUND,
71     THM_GENERATE_FAILED,
72 };
73 
74 enum PrivateAlbumType {
75     TYPE_FAVORITE = 0,
76     TYPE_TRASH,
77     TYPE_HIDE,
78     TYPE_SMART,
79     TYPE_SEARCH
80 };
81 
82 enum class DataType : int32_t {
83     TYPE_NULL = 0,
84     TYPE_INT,
85     TYPE_LONG,
86     TYPE_DOUBLE,
87     TYPE_STRING,
88     TYPE_BOOL
89 };
90 
91 enum class FetchResType : int32_t {
92     TYPE_FILE = 1,
93     TYPE_ALBUM,
94     TYPE_SMARTALBUM,
95     TYPE_PHOTOALBUM,
96     TYPE_CUSTOMRECORD,
97     TYPE_ALBUMORDER,
98 };
99 
100 enum class DirtyType : int32_t {
101     TYPE_SYNCED,
102     TYPE_NEW,
103     TYPE_MDIRTY,
104     TYPE_FDIRTY,
105     TYPE_DELETED,
106     TYPE_RETRY,
107     TYPE_SDIRTY,
108     TYPE_COPY,
109     TYPE_TDIRTY
110 };
111 
112 enum class CloudEnhancementAvailableType : int32_t {
113     NOT_SUPPORT = 0,
114     SUPPORT,
115     PROCESSING_MANUAL,
116     FAILED_RETRY,
117     FAILED,
118     SUCCESS,
119     EDIT,
120     TRASH,
121     PROCESSING_AUTO,
122     FINISH = 120,
123 };
124 
125 enum class CloudEnhancementIsAutoType : int32_t {
126     NOT_AUTO = 0,
127     AUTO,
128 };
129 
130 enum class CloudEnhancementTriggerModeType : int32_t {
131     TRIGGER_MANUAL = 0,
132     TRIGGER_AUTO,
133 };
134 
135 enum class CEErrorCodeType : int32_t {
136     // failed retry
137     LIMIT_USAGE = 100,
138     LIMIT_REQUEST,
139     TASK_CACHE_TIMEOUT,
140     NETWORK_UNAVAILABLE,
141     TEMPERATURES_GUARD,
142     NETWORK_WEAK,
143     // failed
144     EXECUTE_FAILED,
145     // failed retry
146     DO_AUTH_FAILED,
147     TASK_CANNOT_EXECUTE,
148     // failed
149     NON_RECOVERABLE = 200,
150 };
151 
152 enum class StrongAssociationType : int32_t {
153     NORMAL = 0,
154     CLOUD_ENHANCEMENT
155 };
156 
157 enum class SyncStatusType : int32_t {
158     TYPE_BACKUP = -1, // Only for clone! Set backup data invisible before moving
159     TYPE_VISIBLE = 0,
160     TYPE_DOWNLOAD,
161     TYPE_UPLOAD,
162 };
163 
164 enum class ThumbStatus : int32_t {
165     DOWNLOADED,
166     TO_DOWNLOAD,
167 };
168 
169 enum class TableType : int32_t {
170     TYPE_FILES = 0,
171     TYPE_PHOTOS,
172     TYPE_AUDIOS,
173 };
174 
175 enum ResultSetDataType {
176     TYPE_NULL = 0,
177     TYPE_STRING,
178     TYPE_INT32,
179     TYPE_INT64,
180     TYPE_DOUBLE,
181     TYPE_BLOB
182 };
183 
184 enum class CleanType : int32_t {
185     TYPE_NOT_CLEAN = 0,
186     TYPE_NEED_CLEAN
187 };
188 
189 enum class MultiStagesPhotoQuality : int32_t {
190     FULL = 0,
191     LOW,
192 };
193 
194 enum class StageVideoTaskStatus : int32_t {
195     NO_NEED_TO_STAGE = 0,
196     NEED_TO_STAGE,
197     STAGE_TASK_TO_DELIVER,
198     STAGE_TASK_DELIVERED,
199     STAGE_TASK_FAIL,
200     STAGE_TASK_SUCCESS,
201 };
202 
203 enum class FirstStageModifyType : int32_t {
204     NOT_MODIFIED = 0,
205     EDITED,
206     TRASHED,
207 };
208 
209 constexpr int32_t DEFAULT_INT32 = 0;
210 constexpr int64_t DEFAULT_INT64 = 0;
211 constexpr int64_t DEFAULT_DOUBLE = 0;
212 const std::string DEFAULT_STR = "";
213 const bool DEFAULT_BOOL = false;
214 const std::string DEFAULT_MEDIA_PATH = "";
215 
216 const int32_t DEFAULT_ALBUM_ID = 0;
217 const std::string DEFAULT_ALBUM_NAME = "Unknown";
218 const std::string DEFAULT_ALBUM_PATH = "";
219 const std::string DEFAULT_ALBUM_URI = "";
220 const std::string DEFAULT_SMART_ALBUM_TAG = "";
221 const PrivateAlbumType DEFAULT_SMART_ALBUM_PRIVATE_TYPE = TYPE_SMART;
222 const int32_t DEFAULT_SMART_ALBUM_ALBUMCAPACITY = 0;
223 const int32_t DEFAULT_SMART_ALBUM_CATEGORYID = 0;
224 const int64_t DEFAULT_SMART_ALBUM_DATE_MODIFIED = 0;
225 const std::string DEFAULT_SMART_ALBUM_CATEGORYNAME = "";
226 const int64_t DEFAULT_ALBUM_DATE_MODIFIED = 0;
227 const int32_t DEFAULT_COUNT = 0;
228 const std::string DEFAULT_ALBUM_RELATIVE_PATH = "";
229 const std::string DEFAULT_COVERURI = "";
230 const int32_t DEFAULT_MEDIA_PARENT = 0;
231 const std::string DEFAULT_DESCRIPTION;
232 constexpr int32_t DEFAULT_EXPIREDTIME = 0;
233 const bool DEFAULT_ALBUM_VIRTUAL = false;
234 const uint64_t DEFAULT_MEDIA_DATE_TAKEN = 0;
235 const std::string DEFAULT_MEDIA_ALBUM_URI = "";
236 const bool DEFAULT_MEDIA_IS_PENDING = false;
237 const int32_t DEFAULT_DIR_TYPE = -1;
238 const std::string DEFAULT_DIRECTORY = "";
239 const std::string DEFAULT_STRING_MEDIA_TYPE = "";
240 const std::string DEFAULT_EXTENSION = "";
241 const int32_t DEFAULT_MEDIAVOLUME = 0;
242 const int32_t DEFAULT_ALBUMS_ORDER = -1;
243 const int32_t DEFAULT_ORDER_SECTION = -1;
244 const int32_t DEFAULT_ORDER_TYPE = -1;
245 const int32_t DEFAULT_ORDER_STATUS = 0;
246 const std::string ROOT_MEDIA_DIR = "/storage/cloud/files/";
247 const std::string ROOT_SANDBOX_DIR = "/storage/Share/";
248 const std::string FS_TYPE_EPFS = "epfs";
249 const std::string EPFS_MOUNT_POINT = "/storage/cloud/epfs";
250 const std::string MEDIA_CACHE_DIR = ROOT_MEDIA_DIR + ".cache/";
251 const std::string MEDIA_HIGHLIGHT_DIR = ROOT_MEDIA_DIR + "highlight/";
252 const std::string MEDIA_EDIT_DATA_DIR = ROOT_MEDIA_DIR + ".editData/";
253 const std::string META_RECOVERY_PHOTO_RELATIVE_PATH = "/Photo/";
254 const std::string META_RECOVERY_META_RELATIVE_PATH = "/.meta/Photo/";
255 const std::string META_RECOVERY_META_FILE_SUFFIX = ".json";
256 const std::string ASTC_JSON_FILE_PATH = "/data/storage/el2/base/preferences/astcphase.json";
257 const char SLASH_CHAR = '/';
258 const std::string SLASH_STR = "/";
259 const int32_t KEY_FRAME_LCD = 1;
260 const int32_t KEY_FRAME_THM = 2;
261 const int32_t KEY_FRAME_THM_ASTC = 3;
262 const std::string HIGHLIGHT_CONFIG = "/data/storage/el2/base/preferences/highlight.xml";
263 const std::string HIGHLIGHT_DIRECTORY_SIZE = "highlight_directory_size";
264 
265 const std::string SKIPLIST_FILE_PATH = "/data/SkipScanFile.txt";
266 
267 const std::string DOCS_PATH = "Docs/";
268 const int CAMERA_DIRECTORY_TYPE_VALUES = DIR_CAMERA;
269 const std::string CAMERA_DIR_VALUES = "Camera/";
270 const std::string CAMERA_TYPE_VALUES = std::to_string(MEDIA_TYPE_IMAGE) + "?" + std::to_string(MEDIA_TYPE_VIDEO);
271 const int VIDEO_DIRECTORY_TYPE_VALUES = DIR_VIDEO;
272 const std::string VIDEO_DIR_VALUES = "Videos/";
273 const std::string VIDEO_TYPE_VALUES = std::to_string(MEDIA_TYPE_VIDEO);
274 const int PIC_DIRECTORY_TYPE_VALUES = DIR_IMAGE;
275 const std::string PIC_DIR_VALUES = "Pictures/";
276 const std::string PIC_TYPE_VALUES = std::to_string(MEDIA_TYPE_IMAGE);
277 const int AUDIO_DIRECTORY_TYPE_VALUES = DIR_AUDIOS;
278 const std::string AUDIO_DIR_VALUES = "Audios/";
279 const std::string AUDIO_TYPE_VALUES = std::to_string(MEDIA_TYPE_AUDIO);
280 const int DOC_DIRECTORY_TYPE_VALUES = DIR_DOCUMENTS;
281 const std::string DOC_DIR_VALUES = "Documents/";
282 const int DOWNLOAD_DIRECTORY_TYPE_VALUES = DIR_DOWNLOAD;
283 const std::string DOWNLOAD_DIR_VALUES = "Download/";
284 const std::string DOCUMENT_BUCKET = "Document";
285 const std::string PHOTO_BUCKET = "Photo";
286 const std::string AUDIO_BUCKET = "Audio";
287 const std::string PRE_PATH_VALUES = "/storage/cloud/";
288 const std::string DOCUMENT_URI_AUTHORITY = "docs";
289 const std::string BACKUP_DATA_DIR_VALUE = "data/";
290 const std::string BACKUP_SINGLE_DATA_DIR_VALUE = ".backup/";
291 const std::string THUMB_DIR_VALUE = ".thumbs/Photo";
292 const std::string EDIT_DATA_DIR_VALUE = ".editData";
293 const std::string MEDIALIBRARY_TEMP_DIR = ".medialibrarytemp";
294 const std::string CLOUD_ENHANCEMENT_WATER_MARK_DIR = "/sys_prod/resource/camera";
295 const std::string CACHE_DIR_VALUE = ".cache";
296 const std::string HIGHLIGHT_INFO_OLD = ".thumbs/highlight";
297 const std::string HIGHLIGHT_INFO_NEW = "highlight";
298 const std::string MEDIA_PHOTO_URI = "file://media/Photo/";
299 const std::string HMDFS = "/mnt/hmdfs/";
300 const std::string CLOUD_MERGE_VIEW = "/account/cloud_merge_view/files/";
301 const std::string CUSTOM_RESTORE_VALUES = "custom_restore";
302 
303 const int TRASH_ALBUM_ID_VALUES = 2;
304 const int FAVOURITE_ALBUM_ID_VALUES = 1;
305 const int FAVOURITE_ALBUM_TYPE_VALUES = 1;
306 const std::string FAVOURTIE_ALBUM_NAME_VALUES = "FavoritAlbum";
307 
308 static constexpr int UNCREATE_FILE_TIMEPENDING = -1;
309 static constexpr int UNCLOSE_FILE_TIMEPENDING = -2;
310 static constexpr int UNOPEN_FILE_COMPONENT_TIMEPENDING = -3;
311 
312 const int32_t DEFAULT_FILE_ID = 0;
313 const int32_t DEFAULT_SHARE_COUNT = 0;
314 const int32_t DEFAULT_LCD_JUMO_COUNT = 0;
315 } // namespace OHOS
316 } // namespace Media
317 
318 #endif  // INTERFACES_INNERKITS_NATIVE_INCLUDE_MEDIA_LIB_SERVICE_CONST_H_
319