• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 FOUNDATION_DMSERVER_SCREEN_INFO_H
17 #define FOUNDATION_DMSERVER_SCREEN_INFO_H
18 
19 #include <parcel.h>
20 
21 #include "class_var_definition.h"
22 #include "screen.h"
23 
24 namespace OHOS::Rosen {
25 enum class ScreenType : uint32_t {
26     UNDEFINE,
27     REAL,
28     VIRTUAL
29 };
30 class ScreenInfo : public Parcelable {
31 friend class AbstractScreen;
32 public:
33     ~ScreenInfo() = default;
34     WM_DISALLOW_COPY_AND_MOVE(ScreenInfo);
35 
36     virtual bool Marshalling(Parcel& parcel) const override;
37     static ScreenInfo* Unmarshalling(Parcel& parcel);
38 
39     DEFINE_VAR_FUNC_GET(std::string, Name, name);
40     DEFINE_VAR_DEFAULT_FUNC_GET(ScreenId, ScreenId, id, SCREEN_ID_INVALID);
41     DEFINE_VAR_DEFAULT_FUNC_GET(uint32_t, VirtualWidth, virtualWidth, 0);
42     DEFINE_VAR_DEFAULT_FUNC_GET(uint32_t, VirtualHeight, virtualHeight, 0);
43     DEFINE_VAR_DEFAULT_FUNC_GET(float, VirtualPixelRatio, virtualPixelRatio, 1.0f);
44     DEFINE_VAR_DEFAULT_FUNC_GET(ScreenId, ParentId, parent, SCREEN_ID_INVALID);
45     DEFINE_VAR_DEFAULT_FUNC_GET(bool, IsScreenGroup, isScreenGroup, false);
46     DEFINE_VAR_DEFAULT_FUNC_GET(Rotation, Rotation, rotation, Rotation::ROTATION_0);
47     DEFINE_VAR_DEFAULT_FUNC_GET(Orientation, Orientation, orientation, Orientation::UNSPECIFIED);
48     DEFINE_VAR_DEFAULT_FUNC_GET(ScreenType, Type, type, ScreenType::UNDEFINE);
49     DEFINE_VAR_DEFAULT_FUNC_GET(uint32_t, ModeId, modeId, 0);
50     DEFINE_VAR_FUNC_GET(std::vector<sptr<SupportedScreenModes>>, Modes, modes);
51 protected:
52     ScreenInfo() = default;
53     bool InnerUnmarshalling(Parcel& parcel);
54 };
55 } // namespace OHOS::Rosen
56 #endif // FOUNDATION_DMSERVER_DISPLAY_INFO_H
57