1a3e0fd82Sopenharmony_ci/*
2a3e0fd82Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3a3e0fd82Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4a3e0fd82Sopenharmony_ci * you may not use this file except in compliance with the License.
5a3e0fd82Sopenharmony_ci * You may obtain a copy of the License at
6a3e0fd82Sopenharmony_ci *
7a3e0fd82Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8a3e0fd82Sopenharmony_ci *
9a3e0fd82Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10a3e0fd82Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11a3e0fd82Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12a3e0fd82Sopenharmony_ci * See the License for the specific language governing permissions and
13a3e0fd82Sopenharmony_ci * limitations under the License.
14a3e0fd82Sopenharmony_ci */
15a3e0fd82Sopenharmony_ci
16a3e0fd82Sopenharmony_ci/**
17a3e0fd82Sopenharmony_ci * @addtogroup UI_Common
18a3e0fd82Sopenharmony_ci * @{
19a3e0fd82Sopenharmony_ci *
20a3e0fd82Sopenharmony_ci * @brief Defines common UI capabilities, such as image and text processing.
21a3e0fd82Sopenharmony_ci *
22a3e0fd82Sopenharmony_ci * @since 1.0
23a3e0fd82Sopenharmony_ci * @version 1.0
24a3e0fd82Sopenharmony_ci */
25a3e0fd82Sopenharmony_ci
26a3e0fd82Sopenharmony_ci/**
27a3e0fd82Sopenharmony_ci * @file screen.h
28a3e0fd82Sopenharmony_ci *
29a3e0fd82Sopenharmony_ci * @brief Declares the screen information.
30a3e0fd82Sopenharmony_ci *
31a3e0fd82Sopenharmony_ci * @since 1.0
32a3e0fd82Sopenharmony_ci * @version 1.0
33a3e0fd82Sopenharmony_ci */
34a3e0fd82Sopenharmony_ci
35a3e0fd82Sopenharmony_ci#ifndef GRAPHIC_LITE_SCREEN_H
36a3e0fd82Sopenharmony_ci#define GRAPHIC_LITE_SCREEN_H
37a3e0fd82Sopenharmony_ci
38a3e0fd82Sopenharmony_ci#include "gfx_utils/heap_base.h"
39a3e0fd82Sopenharmony_ci#include "gfx_utils/image_info.h"
40a3e0fd82Sopenharmony_ci
41a3e0fd82Sopenharmony_cinamespace OHOS {
42a3e0fd82Sopenharmony_ci/**
43a3e0fd82Sopenharmony_ci * @brief Represents the screen info of the device.
44a3e0fd82Sopenharmony_ci *
45a3e0fd82Sopenharmony_ci * @since 1.0
46a3e0fd82Sopenharmony_ci * @version 1.0
47a3e0fd82Sopenharmony_ci */
48a3e0fd82Sopenharmony_ciclass Screen : HeapBase {
49a3e0fd82Sopenharmony_cipublic:
50a3e0fd82Sopenharmony_ci    /**
51a3e0fd82Sopenharmony_ci     * @brief Obtains a singleton <b>Screen</b> instance.
52a3e0fd82Sopenharmony_ci     * @return Returns the <b>Screen</b> instance.
53a3e0fd82Sopenharmony_ci     */
54a3e0fd82Sopenharmony_ci    static Screen& GetInstance();
55a3e0fd82Sopenharmony_ci
56a3e0fd82Sopenharmony_ci    /**
57a3e0fd82Sopenharmony_ci     * @brief Obtains the width of this screen.
58a3e0fd82Sopenharmony_ci     *
59a3e0fd82Sopenharmony_ci     * @return Returns the screen width.
60a3e0fd82Sopenharmony_ci     * @since 1.0
61a3e0fd82Sopenharmony_ci     * @version 1.0
62a3e0fd82Sopenharmony_ci     */
63a3e0fd82Sopenharmony_ci    uint16_t GetWidth();
64a3e0fd82Sopenharmony_ci
65a3e0fd82Sopenharmony_ci    /**
66a3e0fd82Sopenharmony_ci     * @brief Obtains the height of this screen.
67a3e0fd82Sopenharmony_ci     *
68a3e0fd82Sopenharmony_ci     * @return Returns the screen height.
69a3e0fd82Sopenharmony_ci     * @since 1.0
70a3e0fd82Sopenharmony_ci     * @version 1.0
71a3e0fd82Sopenharmony_ci     */
72a3e0fd82Sopenharmony_ci    uint16_t GetHeight();
73a3e0fd82Sopenharmony_ci
74a3e0fd82Sopenharmony_ci    /**
75a3e0fd82Sopenharmony_ci     * @brief 获取当前屏幕的bitmap截图.请注意该接口会申请内存,请在需要释放时使用{@link ImageCacheFree()}接口.
76a3e0fd82Sopenharmony_ci     * @param info bitmap存储对象,获取的截图将被存到该引用中.
77a3e0fd82Sopenharmony_ci     * @return bitmap是否获取成功.
78a3e0fd82Sopenharmony_ci     * @since 5.0
79a3e0fd82Sopenharmony_ci     * @version 3.0
80a3e0fd82Sopenharmony_ci     */
81a3e0fd82Sopenharmony_ci    bool GetCurrentScreenBitmap(ImageInfo& info);
82a3e0fd82Sopenharmony_ci
83a3e0fd82Sopenharmony_ci    /**
84a3e0fd82Sopenharmony_ci     * @brief 获取当前屏幕的形状.
85a3e0fd82Sopenharmony_ci     * @return 当前屏幕形状.
86a3e0fd82Sopenharmony_ci     * @since 6
87a3e0fd82Sopenharmony_ci     */
88a3e0fd82Sopenharmony_ci    ScreenShape GetScreenShape();
89a3e0fd82Sopenharmony_ci
90a3e0fd82Sopenharmony_ciprivate:
91a3e0fd82Sopenharmony_ci    Screen() {}
92a3e0fd82Sopenharmony_ci    virtual ~Screen() {}
93a3e0fd82Sopenharmony_ci};
94a3e0fd82Sopenharmony_ci} // namespace OHOS
95a3e0fd82Sopenharmony_ci#endif // GRAPHIC_LITE_SCREEN_H
96