• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 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 OHOS_GALLERY_CONFIG_H
17 #define OHOS_GALLERY_CONFIG_H
18 
19 namespace OHOS {
20 /** icon resource file path */
21 static const char* const BACK_ICON_PATH = "/gallery/assets/gallery/resources/drawable/ic_back.png";
22 static const char* const VIDEO_TAG_ICON_PATH = "/gallery/assets/gallery/resources/drawable/ic_gallery_video_tag.png";
23 static const char* const VIDEO_PALY_PATH = "/gallery/assets/gallery/resources/drawable/ic_gallery_play.png";
24 static const char* const VIDEO_PAUSE_PATH = "/gallery/assets/gallery/resources/drawable/ic_gallery_pause.png";
25 
26 static constexpr int16_t MAX_PICTURE_COUNT = 256;
27 static constexpr uint16_t MAX_PATH_LENGTH = 512;
28 
29 /** thumb, photo, and video folder path */
30 static const char* const THUMBNAIL_DIRECTORY = "/userdata/thumb";
31 static const char* const PHOTO_DIRECTORY = "/userdata/photo";
32 static const char* const VIDEO_SOURCE_DIRECTORY = "/userdata/video";
33 
34 /** general page configuration */
35 static constexpr int ROOT_VIEW_POSITION_X = 0;
36 static constexpr int ROOT_VIEW_POSITION_Y = 0;
37 static constexpr int ROOT_VIEW_WIDTH = 960;
38 static constexpr int ROOT_VIEW_HEIGHT = 480;
39 static constexpr uint16_t ROOT_VIEW_OPACITY = 255;
40 
41 static const char* const FONT_NAME = "SourceHanSansSC-Regular.otf";
42 
43 /** back icon 36 x 36 */
44 static constexpr int16_t BACK_ICON_POSITION_X = 38;
45 static constexpr int16_t BACK_ICON_POSITION_Y = 17;
46 
47 /** THUMBNAIL */
48 static constexpr int16_t THUMBNAIL_RESOLUTION_X = 120;
49 static constexpr int16_t THUMBNAIL_RESOLUTION_Y = 120;
50 static constexpr int16_t THUMBNAIL_SPACE = 4;
51 static constexpr int16_t THUMBNAIL_COLUMN = 3;
52 
53 static constexpr int16_t VIDEO_TAG_POSITION_X = 10;
54 static constexpr int16_t VIDEO_TAG_POSITION_Y = THUMBNAIL_RESOLUTION_Y - 37;
55 
56 /** title */
57 static constexpr int16_t LABEL_POSITION_X = BACK_ICON_POSITION_X + 60;
58 static constexpr int16_t LABEL_POSITION_Y = 0;
59 static constexpr int16_t LABEL_WIDTH = 100;
60 static constexpr int16_t LABEL_HEIGHT = 70;
61 static constexpr uint16_t GALLERY_FONT_SIZE = 25;
62 static constexpr uint16_t GALLERY_DELETE_FONT_SIZE = 22;
63 static constexpr int16_t DELETE_LABEL_WIDTH = 150;
64 
65 /** prefix and File Type */
66 static const char* const PHOTO_PREFIX = "photo";
67 static const char* const AVAILABEL_SOURCE_TYPE = ".mp4";
68 static const char* const AVAILABEL_SOURCE_TYPE_MP4 = ".MP4";
69 
70 /** playback status bar */
71 static constexpr uint16_t STATUS_BAR_GROUP_HEIGHT = 96;
72 static constexpr uint16_t TOGGLE_BUTTON_OFFSET_X = 36;
73 static constexpr uint16_t TOGGLE_BUTTON_OFFSET_Y = 18;
74 static constexpr uint16_t TOGGLE_BUTTON_WIDTH = 60;
75 static constexpr uint16_t TOGGLE_BUTTON_HEIGHT = 60;
76 
77 static constexpr uint16_t CURRENT_TIME_LABEL_X = TOGGLE_BUTTON_OFFSET_X + TOGGLE_BUTTON_WIDTH + TOGGLE_BUTTON_OFFSET_Y;
78 static constexpr uint16_t CURRENT_TIME_LABEL_Y = 0;
79 static constexpr uint16_t CURRENT_TIME_LABEL_WIDTH = 60;
80 static constexpr uint16_t CURRENT_TIME_LABEL_HEIGHT = STATUS_BAR_GROUP_HEIGHT;
81 
82 static constexpr uint16_t TOTAL_TIME_LABEL_WIDTH = 90;
83 static constexpr uint16_t TOTAL_TIME_LABEL_HEIGHT = STATUS_BAR_GROUP_HEIGHT;
84 static constexpr uint16_t TOTAL_TIME_LABEL_X = ROOT_VIEW_WIDTH - TOTAL_TIME_LABEL_WIDTH;
85 static constexpr uint16_t TOTAL_TIME_LABEL_Y = 0;
86 
87 static constexpr uint16_t SLIDER_X = CURRENT_TIME_LABEL_X + CURRENT_TIME_LABEL_WIDTH;
88 static constexpr uint16_t SLIDER_Y = 2;
89 static constexpr uint16_t SLIDER_HEIGHT = 3;
90 static constexpr uint16_t SLIDER_WIDTH = ROOT_VIEW_WIDTH - SLIDER_X - TOTAL_TIME_LABEL_WIDTH - 20;
91 static constexpr uint16_t KNOB_WIDTH = 25;
92 
93 static constexpr uint16_t PLAYER_FONT_SIZE = 18;
94 } // namespace OHOS
95 #endif // OHOS_GALLERY_CONFIG_H