• 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
16import photoAccessHelper from '@ohos.file.photoAccessHelper';
17
18export default class SmartPickerConstants {
19  static readonly INVALID: number = -1;
20  static readonly INVALID_PHOTO_SELECT_TYPE: number = -1;
21  static readonly SMART_PICKER_MANAGER: string = 'smart_picker_manager';
22  static readonly LABEL_ID_CARD: string = '4';
23  static readonly LABEL_QR_CODE: string = '191';
24  static readonly LABEL_BAR_CODE: string = '192';
25  static readonly LABEL_AVATAR: string = '10000';
26  static readonly LABEL_ALL_PHOTO: string = '10001';
27
28  static readonly RECOMMEND_TYPE_LABEL: number = 1;
29  static readonly RECOMMEND_TYPE_PROFILE: number = 2;
30  static readonly RECOMMEND_TYPE_CONTENT: number = 3;
31  static readonly VIRTUAL_ALBUM_URI_PREFIX: string = 'file://media/SmartPickerPhotoAlbum/';
32
33  static readonly PHOTO_SELECT_TYPE_DEFAULT: number = 0;
34
35  static readonly QR_OR_BAR_CODE: number = 1;
36  static readonly QR_CODE: number = 2;
37  static readonly BAR_CODE: number = 3;
38  static readonly ID_CARD: number = 4;
39  static readonly PROFILE_PICTURE: number = 5;
40
41  static readonly NAME_ID_CARD: string = '身份证';
42  static readonly NAME_QR_CODE: string = '二维码';
43  static readonly NAME_BAR_CODE: string = '条码';
44  static readonly NAME_AVATAR: string = '头像';
45
46  static readonly LABEL_NAME_MAP: Map<string, string> = new Map([
47    [SmartPickerConstants.NAME_ID_CARD, SmartPickerConstants.LABEL_ID_CARD],
48    [SmartPickerConstants.NAME_QR_CODE, SmartPickerConstants.LABEL_QR_CODE],
49    [SmartPickerConstants.NAME_BAR_CODE, SmartPickerConstants.LABEL_BAR_CODE],
50    [SmartPickerConstants.NAME_AVATAR, SmartPickerConstants.LABEL_AVATAR],
51  ]);
52
53  static readonly LABEL_ID_KEY: string = 'album_name';
54  static readonly RECOMMEND_TAB_BORDER_RADIUS: number = 20;
55
56  static readonly ALL_IMAGE_VIDEO_FETCH_COLUMNS: Array<string> = [
57    photoAccessHelper.PhotoKeys.URI.toString(),
58    photoAccessHelper.PhotoKeys.PHOTO_TYPE.toString(),
59    photoAccessHelper.PhotoKeys.DISPLAY_NAME.toString(),
60    photoAccessHelper.PhotoKeys.DATE_ADDED.toString(),
61    photoAccessHelper.PhotoKeys.DATE_MODIFIED.toString(),
62    photoAccessHelper.PhotoKeys.TITLE.toString(),
63    photoAccessHelper.PhotoKeys.DURATION.toString(),
64    photoAccessHelper.PhotoKeys.WIDTH.toString(),
65    photoAccessHelper.PhotoKeys.HEIGHT.toString(),
66    photoAccessHelper.PhotoKeys.DATE_TAKEN.toString(),
67    photoAccessHelper.PhotoKeys.ORIENTATION.toString(),
68    photoAccessHelper.PhotoKeys.FAVORITE.toString(),
69    photoAccessHelper.PhotoKeys.POSITION.toString(),
70    photoAccessHelper.PhotoKeys.DATE_TRASHED.toString(),
71    photoAccessHelper.PhotoKeys.HIDDEN.toString(),
72    photoAccessHelper.PhotoKeys.SIZE.toString()
73  ];
74  static readonly PICKER_INIT_DATA_FIRST_QUERY_FINISH: string = 'picker_init_data_first_query_finish';
75}
76
77