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 { AlbumDefine, Constants } from '@ohos/common';
17
18export class FormConstants {
19  public static FORM_ITEM_ALBUM_URI = 'form_itemAlbumUri';
20  public static FORM_ITEM_DISPLAY_NAME = 'form_itemDisplayName';
21}
22
23/**
24 * Record parameters passed from outside moduel: FA/third apps
25 * These parameters should not be modified after read from want
26 */
27export class SelectParams {
28  /* max select count */
29  maxSelectCount: number;
30  /* select media type */
31  filterMediaType: string;
32  isFromWallpaper: boolean;
33  /* whether entered from FA */
34  isFromFa: boolean;
35  /* whether entered from pick photos in FA */
36  isFromFaPhoto: boolean;
37  /* whether is multiple pick */
38  isMultiPick: boolean;
39  /* caller bundle name */
40  bundleName: string;
41  /* whether picker from Camera */
42  cameraAble: boolean;
43  /* whether picker can edit */
44  editAble: boolean;
45  preselectedUris: string[];
46  uri: string;
47  itemDisplayName: string;
48  itemId: string;
49  isFirstEnter: boolean;
50  itemCount: number;
51  itemCoverUri: string;
52  remainingOfWallpapers: number;
53
54  static defaultParam(): SelectParams {
55    return {
56      maxSelectCount: Constants.DEFAULT_MAX_THIRD_SELECT_COUNT,
57      filterMediaType: AlbumDefine.FILTER_MEDIA_TYPE_ALL,
58      isFromWallpaper: false,
59      isFromFa: false,
60      isFromFaPhoto: false,
61      isMultiPick: false,
62      bundleName: '',
63      cameraAble: true,
64      editAble: true,
65      preselectedUris: [],
66      uri: '',
67      itemDisplayName: undefined,
68      itemId: '',
69      isFirstEnter: false,
70      itemCount: 0,
71      itemCoverUri: '',
72      remainingOfWallpapers: 0
73    };
74  }
75}
76/* storage key begin */
77export const THIRD_SELECT_IS_ORIGIN = 'third_select_is_origin';
78
79export const IS_SPLIT_MODE = 'isSplitMode';
80
81export const LEFT_BLANK = 'leftBlank';
82
83export const IS_SIDE_BAR = 'isSidebar';
84
85export const IS_HORIZONTAL = 'isHorizontal';
86/* storage key end */
87
88export const THUMBNAIL_WIDTH: number = 256;