• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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
16export class MediaConstants {
17    // Media item status
18    static readonly UNDEFINED = 0;
19    static readonly PART_LOADED = 1
20    static readonly LOADED = 2;
21    static readonly TRASHED = 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
29    static readonly DEVICE_STATE_ONLINE: string = 'online';
30    static readonly DEVICE_STATE_OFFLINE: string = 'offline';
31    static readonly DEVICE_STATE_CHANGE: string = 'change';
32    static readonly ROTATE_NONE = 0;
33    static readonly ROTATE_ONCE = 90;
34    static readonly ROTATE_TWICE = 180;
35    static readonly ROTATE_THIRD = 270;
36    static readonly ROTATE_AROUND = 360;
37    static readonly DEFAULT_SIZE = 256;
38    static readonly DEFAULT_THUMBNAIL_SIZE = 1920;
39    // select type
40    static readonly SELECT_TYPE_ALL = 0;
41    static readonly SELECT_TYPE_VIDEO = 1;
42    static readonly SELECT_TYPE_IMAGE = 2;
43    // album id
44    static readonly ALBUM_ID_ALL = 'default_all';
45    static readonly ALBUM_ID_CAMERA = 'default_camera';
46    static readonly ALBUM_ID_VIDEO = 'default_video';
47    static readonly ALBUM_ID_RECYCLE = 'default_recycle';
48    static readonly ALBUM_ID_FAVOR = 'default_favor';
49    static readonly ALBUM_ID_SNAPSHOT = 'default_snapshot';
50    static readonly ALBUM_ID_REMOTE = 'default_remote';
51    static readonly ALBUM_DISABLE_COPY_LIST = new Set([
52        MediaConstants.ALBUM_ID_ALL,
53        MediaConstants.ALBUM_ID_VIDEO,
54        MediaConstants.ALBUM_ID_RECYCLE,
55        MediaConstants.ALBUM_ID_FAVOR
56    ]);
57    static readonly ALBUM_DISABLE_DELETE_LIST = new Set([
58        MediaConstants.ALBUM_ID_ALL,
59        MediaConstants.ALBUM_ID_CAMERA,
60        MediaConstants.ALBUM_ID_VIDEO,
61        MediaConstants.ALBUM_ID_RECYCLE,
62        MediaConstants.ALBUM_ID_FAVOR
63    ]);
64    static readonly ALBUM_DISABLE_NEW_LIST = new Set([
65        MediaConstants.ALBUM_ID_ALL,
66        MediaConstants.ALBUM_ID_CAMERA,
67        MediaConstants.ALBUM_ID_VIDEO,
68        MediaConstants.ALBUM_ID_RECYCLE,
69        MediaConstants.ALBUM_ID_FAVOR,
70        MediaConstants.ALBUM_ID_SNAPSHOT
71    ]);
72    static readonly ALBUM_DISABLE_RENAME_LIST = new Set([
73        MediaConstants.ALBUM_ID_ALL,
74        MediaConstants.ALBUM_ID_CAMERA,
75        MediaConstants.ALBUM_ID_VIDEO,
76        MediaConstants.ALBUM_ID_RECYCLE,
77        MediaConstants.ALBUM_ID_FAVOR,
78        MediaConstants.ALBUM_ID_SNAPSHOT
79    ]);
80    static readonly ALBUM_DEFAULT_SORT_LIST = [
81        MediaConstants.ALBUM_ID_CAMERA,
82        MediaConstants.ALBUM_ID_ALL,
83        MediaConstants.ALBUM_ID_VIDEO,
84        MediaConstants.ALBUM_ID_SNAPSHOT,
85        MediaConstants.ALBUM_ID_FAVOR
86    ];
87    static readonly CAMERA_ALBUM_PATH = 'Camera'
88    static readonly REMOTE_ALBUM_PATH = 'FromOtherDevices'
89    static readonly SNAPSHOT_ALBUM_PATH = 'Screenshots'
90
91    // 需要过滤的媒体文件类型
92    static readonly FILTER_MEDIA_TYPE_ALL: string = 'FILTER_MEDIA_TYPE_ALL';
93    static readonly FILTER_MEDIA_TYPE_IMAGE: string = 'FILTER_MEDIA_TYPE_IMAGE';
94    static readonly FILTER_MEDIA_TYPE_VIDEO: string = 'FILTER_MEDIA_TYPE_VIDEO';
95}