1/* 2 * Copyright (c) 2022-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 16export class MediaConstants { 17 // Media item status 18 static readonly UNDEFINED: number = 0; 19 static readonly PART_LOADED: number = 1; 20 static readonly LOADED: number = 2; 21 static readonly TRASHED: number = 3; 22 // Media type 23 static readonly MEDIA_TYPE_IMAGE: string = 'image'; 24 static readonly MEDIA_TYPE_VIDEO: string = 'video'; 25 static readonly MEDIA_TYPE_ALBUM: string = 'album'; 26 static readonly MEDIA_TYPE_DEVICE: string = 'device'; 27 static readonly MEDIA_TYPE_REMOTE: string = 'remote'; 28 static readonly DEVICE_STATE_ONLINE: string = 'online'; 29 static readonly DEVICE_STATE_OFFLINE: string = 'offline'; 30 static readonly DEVICE_STATE_CHANGE: string = 'change'; 31 static readonly ROTATE_NONE: number = 0; 32 static readonly ROTATE_ONCE: number = 90; 33 static readonly ROTATE_TWICE: number = 180; 34 static readonly ROTATE_THIRD: number = 270; 35 static readonly ROTATE_AROUND: number = 360; 36 static readonly DEFAULT_SIZE: number = 256; 37 // select type 38 static readonly SELECT_TYPE_ALL: number = 0; 39 static readonly SELECT_TYPE_VIDEO: number = 1; 40 static readonly SELECT_TYPE_IMAGE: number = 2; 41 // album id 42 static readonly ALBUM_ID_ALL: string = 'default_all'; 43 static readonly ALBUM_ID_CAMERA: string = 'default_camera'; 44 static readonly ALBUM_ID_VIDEO: string = 'default_video'; 45 static readonly ALBUM_ID_RECYCLE: string = 'default_recycle'; 46 static readonly ALBUM_ID_FAVOR: string = 'default_favor'; 47 static readonly ALBUM_ID_SNAPSHOT: string = 'default_snapshot'; 48 static readonly ALBUM_ID_REMOTE: string = 'default_remote'; 49 static readonly ALBUM_DISABLE_COPY_LIST = new Set([ 50 MediaConstants.ALBUM_ID_ALL, 51 MediaConstants.ALBUM_ID_VIDEO, 52 MediaConstants.ALBUM_ID_RECYCLE, 53 MediaConstants.ALBUM_ID_FAVOR 54 ]); 55 static readonly ALBUM_DISABLE_DELETE_LIST = new Set([ 56 MediaConstants.ALBUM_ID_ALL, 57 MediaConstants.ALBUM_ID_CAMERA, 58 MediaConstants.ALBUM_ID_VIDEO, 59 MediaConstants.ALBUM_ID_RECYCLE, 60 MediaConstants.ALBUM_ID_FAVOR 61 ]); 62 static readonly ALBUM_DISABLE_NEW_LIST = new Set([ 63 MediaConstants.ALBUM_ID_ALL, 64 MediaConstants.ALBUM_ID_CAMERA, 65 MediaConstants.ALBUM_ID_VIDEO, 66 MediaConstants.ALBUM_ID_RECYCLE, 67 MediaConstants.ALBUM_ID_FAVOR, 68 MediaConstants.ALBUM_ID_SNAPSHOT 69 ]); 70 static readonly ALBUM_DISABLE_RENAME_LIST = new Set([ 71 MediaConstants.ALBUM_ID_ALL, 72 MediaConstants.ALBUM_ID_CAMERA, 73 MediaConstants.ALBUM_ID_VIDEO, 74 MediaConstants.ALBUM_ID_RECYCLE, 75 MediaConstants.ALBUM_ID_FAVOR, 76 MediaConstants.ALBUM_ID_SNAPSHOT 77 ]); 78 static readonly ALBUM_DEFAULT_SORT_LIST = [ 79 MediaConstants.ALBUM_ID_CAMERA, 80 MediaConstants.ALBUM_ID_ALL, 81 MediaConstants.ALBUM_ID_VIDEO, 82 MediaConstants.ALBUM_ID_SNAPSHOT, 83 MediaConstants.ALBUM_ID_FAVOR 84 ]; 85 static readonly CAMERA_ALBUM_PATH: string = 'Camera'; 86 static readonly REMOTE_ALBUM_PATH: string = 'FromOtherDevices'; 87 static readonly SNAPSHOT_ALBUM_PATH: string = 'Screenshots'; 88}