1e0dac50fSopenharmony_ci/*
2e0dac50fSopenharmony_ci * Copyright (c) 2021 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_INPUT_WINDOW_MONITOR_H
17e0dac50fSopenharmony_ci#define OHOS_INPUT_WINDOW_MONITOR_H
18e0dac50fSopenharmony_ci
19e0dac50fSopenharmony_ci#include <input_manager.h>
20e0dac50fSopenharmony_ci#include <refbase.h>
21e0dac50fSopenharmony_ci
22e0dac50fSopenharmony_ci#include "display_info.h"
23e0dac50fSopenharmony_ci#include "window_root.h"
24e0dac50fSopenharmony_ci#include "wm_common.h"
25e0dac50fSopenharmony_ci
26e0dac50fSopenharmony_cinamespace OHOS {
27e0dac50fSopenharmony_cinamespace Rosen {
28e0dac50fSopenharmony_ciclass InputWindowMonitor : public RefBase {
29e0dac50fSopenharmony_cipublic:
30e0dac50fSopenharmony_ci    explicit InputWindowMonitor(sptr<WindowRoot>& root) : windowRoot_(root) {}
31e0dac50fSopenharmony_ci    ~InputWindowMonitor() = default;
32e0dac50fSopenharmony_ci    void UpdateInputWindow(uint32_t windowId);
33e0dac50fSopenharmony_ci    void UpdateInputWindowByDisplayId(DisplayId displayId);
34e0dac50fSopenharmony_ci
35e0dac50fSopenharmony_ciprivate:
36e0dac50fSopenharmony_ci    sptr<WindowRoot> windowRoot_;
37e0dac50fSopenharmony_ci    MMI::DisplayGroupInfo displayGroupInfo_ = {};
38e0dac50fSopenharmony_ci    void TraverseWindowNodes(const std::vector<sptr<WindowNode>>& windowNodes,
39e0dac50fSopenharmony_ci                             std::vector<MMI::WindowInfo>& windowsInfo);
40e0dac50fSopenharmony_ci    void UpdateDisplayGroupInfo(const sptr<WindowNodeContainer>& windowNodeContainer,
41e0dac50fSopenharmony_ci                                MMI::DisplayGroupInfo& displayGroupInfo);
42e0dac50fSopenharmony_ci    void UpdateDisplayInfo(const std::vector<sptr<DisplayInfo>>& displayInfos,
43e0dac50fSopenharmony_ci                           std::vector<MMI::DisplayInfo>& displayInfoVector);
44e0dac50fSopenharmony_ci    MMI::Direction GetDisplayDirectionForMmi(Rotation rotation);
45e0dac50fSopenharmony_ci    void TransformWindowRects(const sptr<WindowNode>& windowNode, Rect& areaRect,
46e0dac50fSopenharmony_ci        std::vector<Rect>& touchHotAreas, std::vector<Rect>& pointerHotAreas);
47e0dac50fSopenharmony_ci};
48e0dac50fSopenharmony_ci}
49e0dac50fSopenharmony_ci}
50e0dac50fSopenharmony_ci#endif // OHOS_INPUT_WINDOW_MONITOR_H
51