1e0dac50fSopenharmony_ci/*
2e0dac50fSopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
3e0dac50fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4e0dac50fSopenharmony_ci * you may not use this file except in compliance with the License.
5e0dac50fSopenharmony_ci * You may obtain a copy of the License at
6e0dac50fSopenharmony_ci *
7e0dac50fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8e0dac50fSopenharmony_ci *
9e0dac50fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10e0dac50fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11e0dac50fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12e0dac50fSopenharmony_ci * See the License for the specific language governing permissions and
13e0dac50fSopenharmony_ci * limitations under the License.
14e0dac50fSopenharmony_ci */
15e0dac50fSopenharmony_ci
16e0dac50fSopenharmony_ci#ifndef OHOS_ROSEN_DISPLAY_GROUP_INFO_H
17e0dac50fSopenharmony_ci#define OHOS_ROSEN_DISPLAY_GROUP_INFO_H
18e0dac50fSopenharmony_ci
19e0dac50fSopenharmony_ci#include <map>
20e0dac50fSopenharmony_ci#include <refbase.h>
21e0dac50fSopenharmony_ci
22e0dac50fSopenharmony_ci#include "display_info.h"
23e0dac50fSopenharmony_ci#include "wm_common.h"
24e0dac50fSopenharmony_ci#include "wm_single_instance.h"
25e0dac50fSopenharmony_ci
26e0dac50fSopenharmony_cinamespace OHOS {
27e0dac50fSopenharmony_cinamespace Rosen {
28e0dac50fSopenharmony_ciclass DisplayGroupInfo : public RefBase {
29e0dac50fSopenharmony_ciWM_DECLARE_SINGLE_INSTANCE_BASE(DisplayGroupInfo);
30e0dac50fSopenharmony_cipublic:
31e0dac50fSopenharmony_ci    void Init(ScreenId displayGroupId, const sptr<DisplayInfo>& displayInfo);
32e0dac50fSopenharmony_ci    void AddDisplayInfo(const sptr<DisplayInfo>& displayInfo);
33e0dac50fSopenharmony_ci    void RemoveDisplayInfo(DisplayId displayId);
34e0dac50fSopenharmony_ci    void UpdateLeftAndRightDisplayId();
35e0dac50fSopenharmony_ci
36e0dac50fSopenharmony_ci    void SetDisplayRotation(DisplayId displayId, Rotation rotation);
37e0dac50fSopenharmony_ci    void SetDisplayOrientation(DisplayId displayId, DisplayOrientation orientation);
38e0dac50fSopenharmony_ci    void SetDisplayStateChangeType(DisplayId displayId, DisplayStateChangeType changeType);
39e0dac50fSopenharmony_ci    void SetDisplayVirtualPixelRatio(DisplayId displayId, float vpr);
40e0dac50fSopenharmony_ci    void SetDisplayRect(DisplayId displayId, Rect displayRect);
41e0dac50fSopenharmony_ci    void SetDefaultDisplayId(DisplayId defaultDisplayId);
42e0dac50fSopenharmony_ci
43e0dac50fSopenharmony_ci    Rotation GetDisplayRotation(DisplayId displayId) const;
44e0dac50fSopenharmony_ci    DisplayStateChangeType GetDisplayStateChangeType(DisplayId displayId) const;
45e0dac50fSopenharmony_ci    float GetDisplayVirtualPixelRatio(DisplayId displayId) const;
46e0dac50fSopenharmony_ci    std::map<DisplayId, Rect> GetAllDisplayRects() const;
47e0dac50fSopenharmony_ci    Rect GetDisplayRect(DisplayId displayId) const;
48e0dac50fSopenharmony_ci    sptr<DisplayInfo> GetDisplayInfo(DisplayId displayId) const;
49e0dac50fSopenharmony_ci    sptr<DisplayInfo> GetDefaultDisplayInfo() const;
50e0dac50fSopenharmony_ci    void UpdateDisplayInfo(sptr<DisplayInfo> displayInfo) const;
51e0dac50fSopenharmony_ci    std::vector<sptr<DisplayInfo>> GetAllDisplayInfo() const;
52e0dac50fSopenharmony_ci    std::vector<DisplayId> GetAllDisplayIds() const;
53e0dac50fSopenharmony_ci    DisplayId GetLeftDisplayId() const;
54e0dac50fSopenharmony_ci    DisplayId GetRightDisplayId() const;
55e0dac50fSopenharmony_ci    DisplayId GetDefaultDisplayId() const;
56e0dac50fSopenharmony_ci
57e0dac50fSopenharmony_ciprotected:
58e0dac50fSopenharmony_ci    DisplayGroupInfo() = default;
59e0dac50fSopenharmony_ci    ~DisplayGroupInfo() = default;
60e0dac50fSopenharmony_ci
61e0dac50fSopenharmony_ciprivate:
62e0dac50fSopenharmony_ci    ScreenId displayGroupId_;
63e0dac50fSopenharmony_ci    DisplayId defaultDisplayId_ { 0 };
64e0dac50fSopenharmony_ci    DisplayId leftDisplayId_ { 0 };  // the displayId at left in expand-mode
65e0dac50fSopenharmony_ci    DisplayId rightDisplayId_ { 0 }; // the displayId at right in expand-mode
66e0dac50fSopenharmony_ci    mutable std::map<DisplayId, sptr<DisplayInfo>> displayInfosMap_;
67e0dac50fSopenharmony_ci};
68e0dac50fSopenharmony_ci} // namespace Rosen
69e0dac50fSopenharmony_ci} // namespace OHOS
70e0dac50fSopenharmony_ci#endif // OHOS_ROSEN_DISPLAY_GROUP_INFO_H
71e0dac50fSopenharmony_ci
72