• 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 OHOS_FILEMANAGEMENT_USERFILEMGR_URI_H
17 #define OHOS_FILEMANAGEMENT_USERFILEMGR_URI_H
18 
19 #include <string>
20 
21 namespace OHOS {
22 namespace Media {
23 const std::string MEDIALIBRARY_DATA_URI = "datashare:///media";
24 const std::string MEDIA_OPERN_KEYWORD = "operation";
25 const std::string MEDIA_QUERYOPRN = "query_operation";
26 const std::string OPRN_CREATE = "create";
27 const std::string OPRN_CREATE_COMPONENT = "create_component";
28 const std::string OPRN_CLOSE = "close";
29 const std::string OPRN_DELETE = "delete";
30 const std::string OPRN_QUERY = "query";
31 const std::string OPRN_UPDATE = "update";
32 const std::string OPRN_TRASH = "trash";
33 const std::string OPRN_PENDING = "update_pending";
34 const std::string OPRN_SCAN = "scan";
35 const std::string OPRN_INDEX = "index";
36 const std::string OPRN_ALBUM_ADD_PHOTOS = "add_photos";
37 const std::string OPRN_ALBUM_REMOVE_PHOTOS = "remove_photos";
38 const std::string OPRN_RECOVER_PHOTOS = "recover_photos";
39 const std::string OPRN_DELETE_PHOTOS = "delete_photos_permanently";   // Delete photos permanently from system
40 const std::string OPRN_DELETE_BY_TOOL = "delete_by_tool";
41 const std::string OPRN_SET_USER_COMMENT = "set_user_comment";
42 
43 // Asset operations constants
44 const std::string MEDIA_FILEOPRN = "file_operation";
45 const std::string MEDIA_PHOTOOPRN = "photo_operation";
46 const std::string MEDIA_AUDIOOPRN = "audio_operation";
47 const std::string MEDIA_DOCUMENTOPRN = "document_operation";
48 const std::string MEDIA_FILEOPRN_CREATEASSET = "create_asset";
49 const std::string MEDIA_FILEOPRN_MODIFYASSET = "modify_asset";
50 const std::string MEDIA_FILEOPRN_DELETEASSET = "delete_asset";
51 const std::string MEDIA_FILEOPRN_TRASHASSET = "trash_asset";
52 const std::string MEDIA_FILEOPRN_OPENASSET = "open_asset";
53 const std::string MEDIA_FILEOPRN_CLOSEASSET = "close_asset";
54 
55 // API9 compat photo operations constants
56 const std::string URI_CREATE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_PHOTOOPRN + "/" + MEDIA_FILEOPRN_CREATEASSET;
57 const std::string URI_CLOSE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_PHOTOOPRN + "/" + MEDIA_FILEOPRN_CLOSEASSET;
58 const std::string URI_UPDATE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_PHOTOOPRN + "/" + OPRN_UPDATE;
59 const std::string URI_QUERY_PHOTO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_PHOTOOPRN + "/" + OPRN_QUERY;
60 // API9 compat audio operations constants
61 const std::string URI_QUERY_AUDIO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_AUDIOOPRN + "/" + OPRN_QUERY;
62 const std::string URI_CLOSE_AUDIO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_AUDIOOPRN + "/" + MEDIA_FILEOPRN_CLOSEASSET;
63 const std::string URI_UPDATE_AUDIO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_AUDIOOPRN + "/" + OPRN_UPDATE;
64 const std::string URI_CREATE_AUDIO = MEDIALIBRARY_DATA_URI + "/" + MEDIA_AUDIOOPRN + "/" + MEDIA_FILEOPRN_CREATEASSET;
65 const std::string URI_CLOSE_FILE = MEDIALIBRARY_DATA_URI + "/" + MEDIA_FILEOPRN + "/" + MEDIA_FILEOPRN_CLOSEASSET;
66 const std::string URI_UPDATE_FILE = MEDIALIBRARY_DATA_URI + "/" + MEDIA_FILEOPRN + "/" + MEDIA_FILEOPRN_MODIFYASSET;
67 const std::string URI_CREATE_FILE = MEDIALIBRARY_DATA_URI + "/" + MEDIA_FILEOPRN + "/" + MEDIA_FILEOPRN_CREATEASSET;
68 
69 // Thumbnail operations constants
70 const std::string DISTRIBUTE_THU_OPRN_GENERATES = "thumbnail_distribute_generate_operation";
71 const std::string BUNDLE_PERMISSION_INSERT = "bundle_permission_insert_operation";
72 
73 // Album operations constants
74 const std::string MEDIA_ALBUMOPRN = "album_operation";
75 const std::string MEDIA_ALBUMOPRN_CREATEALBUM = "create_album";
76 const std::string MEDIA_ALBUMOPRN_MODIFYALBUM = "modify_album";
77 const std::string MEDIA_ALBUMOPRN_DELETEALBUM = "delete_album";
78 const std::string MEDIA_ALBUMOPRN_QUERYALBUM = "query_album";
79 const std::string MEDIA_FILEOPRN_GETALBUMCAPACITY = "get_album_capacity";
80 
81 // Photo album operations constants
82 const std::string PHOTO_ALBUM_OPRN = "photo_album_v10_operation";
83 const std::string URI_QUERY_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + PHOTO_ALBUM_OPRN + "/" + OPRN_QUERY;
84 const std::string URI_DELETE_PHOTOS = MEDIALIBRARY_DATA_URI + "/" + PHOTO_ALBUM_OPRN + "/" + OPRN_DELETE_PHOTOS;
85 
86 // Photo map operations constants
87 const std::string PHOTO_MAP_OPRN = "photo_map_v10_operation";
88 const std::string URI_QUERY_PHOTO_MAP = MEDIALIBRARY_DATA_URI + "/" + PHOTO_MAP_OPRN + "/" + OPRN_QUERY;
89 
90 // SmartAlbum operations constants
91 const std::string MEDIA_SMARTALBUMOPRN = "albumsmart_operation";
92 const std::string MEDIA_SMARTALBUMMAPOPRN = "smartalbummap_operation";
93 const std::string MEDIA_SMARTALBUMOPRN_CREATEALBUM = "create_smartalbum";
94 const std::string MEDIA_SMARTALBUMOPRN_MODIFYALBUM = "modify_smartalbum";
95 const std::string MEDIA_SMARTALBUMOPRN_DELETEALBUM = "delete_smartalbum";
96 const std::string MEDIA_SMARTALBUMMAPOPRN_ADDSMARTALBUM = "add_smartalbum_map";
97 const std::string MEDIA_SMARTALBUMMAPOPRN_REMOVESMARTALBUM = "remove_smartalbum_map";
98 const std::string MEDIA_SMARTALBUMMAPOPRN_AGEINGSMARTALBUM = "ageing_smartalbum_map";
99 
100 // Direcotry operations constants
101 const std::string MEDIA_DIROPRN = "dir_operation";
102 const std::string MEDIA_DIROPRN_DELETEDIR = "delete_dir";
103 const std::string MEDIA_DIROPRN_CHECKDIR_AND_EXTENSION = "check_dir_and_extension";
104 const std::string MEDIA_DIROPRN_FMS_CREATEDIR = "fms_create_dir";
105 const std::string MEDIA_DIROPRN_FMS_DELETEDIR = "fms_delete_dir";
106 const std::string MEDIA_DIROPRN_FMS_TRASHDIR = "fms_trash_dir";
107 const std::string MEDIA_QUERYOPRN_QUERYVOLUME = "query_media_volume";
108 
109 // File operations constants
110 const std::string MEDIA_FILEOPRN_COPYASSET = "copy_asset";
111 
112 // Distribution operations constants
113 const std::string MEDIA_BOARDCASTOPRN = "boardcast";
114 const std::string MEDIA_SCAN_OPERATION = "boardcast_scan";
115 const std::string MEDIA_DEVICE_QUERYALLDEVICE = "query_all_device";
116 const std::string MEDIA_DEVICE_QUERYACTIVEDEVICE = "query_active_device";
117 
118 // Scanner tool operation constants
119 const std::string SCANNER_OPRN = "scanner";
120 const std::string URI_SCANNER = MEDIALIBRARY_DATA_URI + "/" + SCANNER_OPRN + "/" + OPRN_SCAN;
121 
122 // Mediatool delete operation constants
123 const std::string DELETE_TOOL_OPRN = "delete_tool";
124 const std::string URI_DELETE_TOOL = MEDIALIBRARY_DATA_URI + "/" + DELETE_TOOL_OPRN + "/" + OPRN_DELETE_BY_TOOL;
125 
126 // UserFileManager operation constants
127 const std::string UFM_PHOTO = "userfilemgr_photo_operation";
128 const std::string UFM_AUDIO = "userfilemgr_audio_operation";
129 const std::string UFM_ALBUM = "userfilemgr_photo_album_operation";
130 const std::string UFM_MAP = "userfilemgr_photo_map_operation";
131 
132 // UserFileManager photo operation constants
133 const std::string UFM_CREATE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + UFM_PHOTO + "/" + OPRN_CREATE;
134 const std::string UFM_CREATE_PHOTO_COMPONENT = MEDIALIBRARY_DATA_URI + "/" + UFM_PHOTO + "/" + OPRN_CREATE_COMPONENT;
135 const std::string UFM_CLOSE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + UFM_PHOTO + "/" + OPRN_CLOSE;
136 const std::string UFM_UPDATE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + UFM_PHOTO + "/" + OPRN_UPDATE;
137 const std::string UFM_QUERY_PHOTO = MEDIALIBRARY_DATA_URI + "/" + UFM_PHOTO + "/" + OPRN_QUERY;
138 const std::string UFM_SET_USER_COMMENT = MEDIALIBRARY_DATA_URI + "/" + UFM_PHOTO + "/" + OPRN_SET_USER_COMMENT;
139 const std::string UFM_GET_INDEX = MEDIALIBRARY_DATA_URI + "/" + UFM_PHOTO + "/" + OPRN_INDEX;
140 
141 // UserFileManager audio operation constants
142 const std::string UFM_CREATE_AUDIO = MEDIALIBRARY_DATA_URI + "/" + UFM_AUDIO + "/" + OPRN_CREATE;
143 const std::string UFM_CREATE_AUDIO_COMPONENT = MEDIALIBRARY_DATA_URI + "/" + UFM_AUDIO + "/" + OPRN_CREATE_COMPONENT;
144 const std::string UFM_CLOSE_AUDIO = MEDIALIBRARY_DATA_URI + "/" + UFM_AUDIO + "/" + OPRN_CLOSE;
145 const std::string UFM_QUERY_AUDIO = MEDIALIBRARY_DATA_URI + "/" + UFM_AUDIO + "/" + OPRN_QUERY;
146 const std::string UFM_UPDATE_AUDIO = MEDIALIBRARY_DATA_URI + "/" + UFM_AUDIO + "/" + OPRN_UPDATE;
147 
148 // UserFileManager album operation constants
149 const std::string UFM_CREATE_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + UFM_ALBUM + "/" + OPRN_CREATE;
150 const std::string UFM_DELETE_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + UFM_ALBUM + "/" + OPRN_DELETE;
151 const std::string UFM_UPDATE_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + UFM_ALBUM + "/" + OPRN_UPDATE;
152 const std::string UFM_QUERY_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + UFM_ALBUM + "/" + OPRN_QUERY;
153 const std::string UFM_PHOTO_ALBUM_ADD_ASSET = MEDIALIBRARY_DATA_URI + "/" + UFM_MAP + "/" +
154         OPRN_ALBUM_ADD_PHOTOS;
155 const std::string UFM_PHOTO_ALBUM_REMOVE_ASSET = MEDIALIBRARY_DATA_URI + "/" + UFM_MAP + "/" +
156         OPRN_ALBUM_REMOVE_PHOTOS;
157 const std::string UFM_QUERY_PHOTO_MAP = MEDIALIBRARY_DATA_URI + "/" + UFM_MAP + "/" + OPRN_QUERY;
158 const std::string UFM_RECOVER_PHOTOS = MEDIALIBRARY_DATA_URI + "/" + UFM_ALBUM + "/" + OPRN_RECOVER_PHOTOS;
159 const std::string UFM_DELETE_PHOTOS = MEDIALIBRARY_DATA_URI + "/" + UFM_ALBUM + "/" + OPRN_DELETE_PHOTOS;
160 
161 // PhotoAccessHelper operation constants
162 const std::string PAH_PHOTO = "phaccess_photo_operation";
163 const std::string PAH_ALBUM = "phaccess_album_operation";
164 const std::string PAH_MAP = "phaccess_map_operation";
165 
166 // UserFileManager photo operation constants
167 const std::string PAH_CREATE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + PAH_PHOTO + "/" + OPRN_CREATE;
168 const std::string PAH_CREATE_PHOTO_COMPONENT = MEDIALIBRARY_DATA_URI + "/" + PAH_PHOTO + "/" + OPRN_CREATE_COMPONENT;
169 const std::string PAH_CLOSE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + PAH_PHOTO + "/" + OPRN_CLOSE;
170 const std::string PAH_UPDATE_PHOTO = MEDIALIBRARY_DATA_URI + "/" + PAH_PHOTO + "/" + OPRN_UPDATE;
171 const std::string PAH_TRASH_PHOTO = MEDIALIBRARY_DATA_URI + "/" + PAH_PHOTO + "/" + OPRN_TRASH;
172 const std::string PAH_QUERY_PHOTO = MEDIALIBRARY_DATA_URI + "/" + PAH_PHOTO + "/" + OPRN_QUERY;
173 const std::string PAH_EDIT_USER_COMMENT_PHOTO = MEDIALIBRARY_DATA_URI + "/" + PAH_PHOTO + "/" + OPRN_SET_USER_COMMENT;
174 
175 // UserFileManager album operation constants
176 const std::string PAH_CREATE_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + PAH_ALBUM + "/" + OPRN_CREATE;
177 const std::string PAH_DELETE_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + PAH_ALBUM + "/" + OPRN_DELETE;
178 const std::string PAH_UPDATE_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + PAH_ALBUM + "/" + OPRN_UPDATE;
179 const std::string PAH_QUERY_PHOTO_ALBUM = MEDIALIBRARY_DATA_URI + "/" + PAH_ALBUM + "/" + OPRN_QUERY;
180 const std::string PAH_PHOTO_ALBUM_ADD_ASSET = MEDIALIBRARY_DATA_URI + "/" + PAH_MAP + "/" +
181         OPRN_ALBUM_ADD_PHOTOS;
182 const std::string PAH_PHOTO_ALBUM_REMOVE_ASSET = MEDIALIBRARY_DATA_URI + "/" + PAH_MAP + "/" +
183         OPRN_ALBUM_REMOVE_PHOTOS;
184 const std::string PAH_QUERY_PHOTO_MAP = MEDIALIBRARY_DATA_URI + "/" + PAH_MAP + "/" + OPRN_QUERY;
185 const std::string PAH_RECOVER_PHOTOS = MEDIALIBRARY_DATA_URI + "/" + PAH_ALBUM + "/" + OPRN_RECOVER_PHOTOS;
186 const std::string PAH_DELETE_PHOTOS = MEDIALIBRARY_DATA_URI + "/" + PAH_ALBUM + "/" + OPRN_DELETE_PHOTOS;
187 } // namespace Media
188 } // namespace OHOS
189 
190 #endif // OHOS_FILEMANAGEMENT_USERFILEMGR_URI_H
191