1 /*
2  * Copyright (c) 2021-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 
16 #ifndef RS_SCREEN_MODE_INFO
17 #define RS_SCREEN_MODE_INFO
18 
19 #include <cstdint>
20 #include <parcel.h>
21 
22 #include "common/rs_macros.h"
23 
24 namespace OHOS {
25 namespace Rosen {
26 class RSB_EXPORT RSScreenModeInfo : public Parcelable {
27 public:
28     RSScreenModeInfo() = default;
29     RSScreenModeInfo(int32_t width, int32_t height, uint32_t refreshRate, int32_t id);
30     ~RSScreenModeInfo() noexcept = default;
31 
32     RSScreenModeInfo(const RSScreenModeInfo& other);
33     RSScreenModeInfo& operator=(const RSScreenModeInfo& other);
34 
35     bool Marshalling(Parcel &parcel) const override;
36     static RSScreenModeInfo *Unmarshalling(Parcel &parcel);
37 
38     int32_t GetScreenWidth() const;
39     int32_t GetScreenHeight() const;
40     uint32_t GetScreenRefreshRate() const;
41     int32_t GetScreenModeId() const;
42     void SetScreenWidth(int32_t width);
43     void SetScreenHeight(int32_t height);
44     void SetScreenRefreshRate(uint32_t refreshRate);
45     void SetScreenModeId(int32_t id);
46 
47 private:
48     int32_t width_ = -1;
49     int32_t height_ = -1;
50     uint32_t refreshRate_ = 0;
51     int32_t modeId_ = -1;
52 };
53 } // namespace Rosen
54 } // namespace OHOS
55 
56 #endif // RS_SCREEN_MODE_INFO