1 /* 2 * Copyright (C) 2024 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 FRAMEWORKS_INNERKITSIMPL_MEDIA_LIBRARY_INCLUDE_MEDIA_OPERATION_H 17 #define FRAMEWORKS_INNERKITSIMPL_MEDIA_LIBRARY_INCLUDE_MEDIA_OPERATION_H 18 19 #include <map> 20 #include <string> 21 22 namespace OHOS { 23 namespace Media { 24 #define EXPORT __attribute__ ((visibility ("default"))) 25 enum class EXPORT OperationObject : uint32_t { 26 UNKNOWN_OBJECT = 0, 27 FILESYSTEM_ASSET, 28 FILESYSTEM_PHOTO, 29 FILESYSTEM_AUDIO, 30 FILESYSTEM_DIR, 31 FILESYSTEM_ALBUM, 32 SMART_ALBUM, 33 SMART_ALBUM_MAP, 34 THUMBNAIL, 35 THUMBNAIL_ASTC, 36 SMART_ALBUM_ASSETS, 37 ASSETMAP, 38 ALL_DEVICE, 39 ACTIVE_DEVICE, 40 MEDIA_VOLUME, 41 BUNDLE_PERMISSION, 42 PHOTO_ALBUM, 43 PHOTO_MAP, 44 UFM_PHOTO, 45 UFM_AUDIO, 46 UFM_ALBUM, 47 UFM_MAP, 48 PAH_PHOTO, 49 PAH_ALBUM, 50 PAH_MAP, 51 TOOL_PHOTO, 52 TOOL_AUDIO, 53 TOOL_ALBUM, 54 VISION_START, 55 VISION_OCR = VISION_START, 56 VISION_LABEL, 57 VISION_VIDEO_LABEL, 58 VISION_AESTHETICS, 59 VISION_VIDEO_AESTHETICS, 60 VISION_OBJECT, 61 VISION_RECOMMENDATION, 62 VISION_SEGMENTATION, 63 VISION_COMPOSITION, 64 VISION_TOTAL, 65 VISION_IMAGE_FACE, 66 VISION_VIDEO_FACE, 67 VISION_ANALYSIS_ALBUM_TOTAL, 68 VISION_FACE_TAG, 69 VISION_SALIENCY, 70 VISION_HEAD, 71 VISION_POSE, 72 VISION_END = VISION_POSE, 73 GEO_DICTIONARY, 74 GEO_KNOWLEDGE, 75 GEO_PHOTO, 76 CONVERT_PHOTO, 77 ANALYSIS_PHOTO_ALBUM, 78 ANALYSIS_PHOTO_MAP, 79 ADD_ASSET_HIGHLIGHT_ALBUM, 80 PAH_FORM_MAP, 81 SEARCH_TOTAL, // search 82 INDEX_CONSTRUCTION_STATUS, //Search Index Build Status 83 STORY_ALBUM, 84 STORY_COVER, 85 STORY_PLAY, 86 USER_PHOTOGRAPHY, 87 PAH_MULTISTAGES_CAPTURE, 88 HIGHLIGHT_COVER, 89 HIGHLIGHT_URI, 90 HIGHLIGHT_DELETE, 91 PAH_MOVING_PHOTO, 92 MISCELLANEOUS, 93 PAH_BATCH_THUMBNAIL_OPERATE, 94 APP_URI_PERMISSION_INNER, 95 MEDIA_APP_URI_PERMISSION, 96 REQUEST_PICTURE, 97 PHOTO_REQUEST_PICTURE_BUFFER, 98 PAH_CLOUD_ENHANCEMENT_OPERATE, 99 ANALYSIS_ADDRESS, 100 ANALYSIS_ADDRESS_ASSETS, 101 ANALYSIS_ADDRESS_ASSETS_ACTIVE, 102 ANALYSIS_ASSET_SD_MAP, 103 ANALYSIS_ALBUM_ASSET_MAP, 104 PAH_VIDEO, 105 KEY_FRAME, 106 TAB_OLD_PHOTO, 107 TAB_FACARD_PHOTO, 108 CLOUD_MEDIA_ASSET_OPERATE, 109 PTP_OPERATION, 110 EDIT_DATA_EXISTS, 111 MTH_AND_YEAR_ASTC, 112 ANALYSIS_FOREGROUND, 113 ASSET_ALBUM_OPERATION, 114 PTP_ALBUM_OPERATION, 115 CUSTOM_RECORDS_OPERATION, 116 MOVING_PHOTO_VIDEO_READY, 117 }; 118 119 enum class EXPORT OperationType : uint32_t { 120 UNKNOWN_TYPE = 0, 121 OPEN, 122 CLOSE, 123 CREATE, 124 DELETE, 125 DELETE_TOOL, 126 UPDATE, 127 QUERY, 128 GETCAPACITY, 129 SCAN, 130 TRASH, 131 GENERATE, 132 AGING, 133 DISTRIBUTE_AGING, 134 COPY, 135 INSERT_PERMISSION, 136 ALBUM_ADD_PHOTOS, 137 ALBUM_REMOVE_PHOTOS, 138 ALBUM_RECOVER_ASSETS, 139 ALBUM_SET_NAME, 140 ALBUM_DELETE_ASSETS, // Delete assets permanently from system 141 TRASH_PHOTO, 142 UPDATE_PENDING, 143 SET_USER_COMMENT, 144 INDEX, 145 COMPAT_ALBUM_DELETE_ASSETS, 146 COMMIT_EDIT, 147 REVERT_EDIT, 148 HIDE, 149 QUERY_HIDDEN, 150 ALBUM_ORDER, 151 OPRN_STORE_FORM_ID, 152 OPRN_REMOVE_FORM_ID, 153 PORTRAIT_DISPLAY_LEVEL, 154 PORTRAIT_IS_ME, 155 PORTRAIT_ALBUM_NAME, 156 PORTRAIT_MERGE_ALBUM, 157 HIGHLIGHT_ALBUM_NAME, 158 HIGHLIGHT_COVER_URI, 159 HIGHLIGHT_SUBTITLE, 160 DISMISS_ASSET, 161 PORTRAIT_COVER_URI, 162 DISMISS, 163 GROUP_ALBUM_NAME, 164 GROUP_COVER_URI, 165 SUBMIT_CACHE, 166 BATCH_UPDATE_FAV, 167 BATCH_UPDATE_USER_COMMENT, 168 BATCH_UPDATE_OWNER_ALBUM_ID, 169 BATCH_UPDATE_RECENT_SHOW, 170 SET_PHOTO_QUALITY, 171 ADD_IMAGE, 172 PROCESS_IMAGE, 173 SET_LOCATION, 174 ANALYSIS_INDEX, 175 CANCEL_PROCESS_IMAGE, 176 LOG_MOVING_PHOTO, 177 ADD_FILTERS, 178 DISCARD_CAMERA_PHOTO, 179 SAVE_CAMERA_PHOTO, 180 REMOVE_MSC_TASK, 181 START_GENERATE_THUMBNAILS, 182 STOP_GENERATE_THUMBNAILS, 183 GENERATE_THUMBNAILS_RESTORE, 184 LOCAL_THUMBNAIL_GENERATION, 185 TOOL_QUERY_BY_DISPLAY_NAME, 186 ADD_LOWQUALITY_IMAGE, 187 FINISH_REQUEST_PICTURE, 188 SCAN_WITHOUT_ALBUM_UPDATE, 189 ENHANCEMENT_ADD, 190 ENHANCEMENT_PRIORITIZE, 191 ENHANCEMENT_QUERY, 192 ENHANCEMENT_CANCEL, 193 ENHANCEMENT_CANCEL_ALL, 194 ENHANCEMENT_SYNC, 195 ENHANCEMENT_GET_PAIR, 196 SAVE_PICTURE, 197 CLONE_ASSET, 198 LOG_MEDIALIBRARY_API, 199 SET_VIDEO_ENHANCEMENT_ATTR, 200 FIND_DUPLICATE_ASSETS, 201 FIND_DUPLICATE_ASSETS_TO_DELETE, 202 DEGENERATE_MOVING_PHOTO, 203 CLOUD_MEDIA_ASSET_TASK_START_FORCE, 204 CLOUD_MEDIA_ASSET_TASK_START_GENTLE, 205 CLOUD_MEDIA_ASSET_TASK_PAUSE, 206 CLOUD_MEDIA_ASSET_TASK_CANCEL, 207 CLOUD_MEDIA_ASSET_TASK_RETAIN_FORCE, 208 CLOUD_MEDIA_ASSET_TASK_STATUS_QUERY, 209 SET_OWNER_ALBUM_ID, 210 UPDATE_SEARCH_INDEX, 211 EDIT_DATA_EXISTS, 212 QUERY_ORDER, 213 UPDATE_ORDER, 214 CUSTOM_RESTORE, 215 CUSTOM_RESTORE_CANCEL, 216 DELETE_LOCAL_ASSETS_PERMANENTLY, 217 MTH_AND_YEAR_ASTC, 218 UPDATE_PORTRAITS_ORDER, 219 UPDATE_SUPPORTED_WATERMARK_TYPE, 220 QUERY_HIGHLIGHT_DIRECTORY_SIZE, 221 LS_MEDIA_FILES, 222 QUERY_ACTIVE_USER_ID, 223 SET_USER_ALBUM_COVER_URI, 224 SET_SOURCE_ALBUM_COVER_URI, 225 SET_SYSTEM_ALBUM_COVER_URI, 226 RESET_COVER_URI, 227 MOVING_PHOTO_VIDEO_READY, 228 }; 229 230 #define OPRN_OBJ_MAP MediaOperation::GetOprnObjMap() 231 #define TABLE_NAME_MAP MediaOperation::GetTableNameMap() 232 #define OPRN_TYPE_MAP MediaOperation::GetOprnTypeMap() 233 #define OPRN_MAP MediaOperation::GetOprnMap() 234 235 namespace MediaOperation { 236 const std::map<std::string, OperationObject>& GetOprnObjMap(); 237 const std::map<OperationObject, std::map<OperationType, std::string>>& GetTableNameMap(); 238 const std::map<std::string, OperationType>& GetOprnTypeMap(); 239 const std::map<std::string, OperationObject>& GetOprnMap(); 240 } // namespace MediaOperation 241 242 } // namespace Media 243 } // namespace OHOS 244 245 #endif // FRAMEWORKS_INNERKITSIMPL_MEDIA_LIBRARY_INCLUDE_MEDIA_OPERATION_H 246