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