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#include "window_manager_agent.h"
17#include "foundation/window/window_manager/interfaces/innerkits/wm/window_manager.h"
18#include "singleton_container.h"
19#include "wm_common.h"
20
21namespace OHOS {
22namespace Rosen {
23void WindowManagerAgent::UpdateFocusChangeInfo(const sptr<FocusChangeInfo>& focusChangeInfo, bool focused)
24{
25    SingletonContainer::Get<WindowManager>().UpdateFocusChangeInfo(focusChangeInfo, focused);
26}
27
28void WindowManagerAgent::UpdateWindowModeTypeInfo(WindowModeType type)
29{
30    SingletonContainer::Get<WindowManager>().UpdateWindowModeTypeInfo(type);
31}
32
33void WindowManagerAgent::UpdateSystemBarRegionTints(DisplayId displayId, const SystemBarRegionTints& tints)
34{
35    SingletonContainer::Get<WindowManager>().UpdateSystemBarRegionTints(displayId, tints);
36}
37
38void WindowManagerAgent::NotifyAccessibilityWindowInfo(const std::vector<sptr<AccessibilityWindowInfo>>& infos,
39    WindowUpdateType type)
40{
41    SingletonContainer::Get<WindowManager>().NotifyAccessibilityWindowInfo(infos, type);
42}
43
44void WindowManagerAgent::UpdateWindowVisibilityInfo(const std::vector<sptr<WindowVisibilityInfo>>& visibilityInfos)
45{
46    SingletonContainer::Get<WindowManager>().UpdateWindowVisibilityInfo(visibilityInfos);
47}
48
49void WindowManagerAgent::UpdateWindowDrawingContentInfo(
50    const std::vector<sptr<WindowDrawingContentInfo>>& windowDrawingContentInfos)
51{
52    SingletonContainer::Get<WindowManager>().UpdateWindowDrawingContentInfo(windowDrawingContentInfos);
53}
54
55void WindowManagerAgent::UpdateCameraFloatWindowStatus(uint32_t accessTokenId, bool isShowing)
56{
57    SingletonContainer::Get<WindowManager>().UpdateCameraFloatWindowStatus(accessTokenId, isShowing);
58}
59
60void WindowManagerAgent::NotifyWaterMarkFlagChangedResult(bool showWaterMark)
61{
62    SingletonContainer::Get<WindowManager>().NotifyWaterMarkFlagChangedResult(showWaterMark);
63}
64
65void WindowManagerAgent::UpdateVisibleWindowNum(
66    const std::vector<VisibleWindowNumInfo>& visibleWindowNumInfo)
67{
68    SingletonContainer::Get<WindowManager>().UpdateVisibleWindowNum(visibleWindowNumInfo);
69}
70
71void WindowManagerAgent::NotifyGestureNavigationEnabledResult(bool enable)
72{
73    SingletonContainer::Get<WindowManager>().NotifyGestureNavigationEnabledResult(enable);
74}
75
76void WindowManagerAgent::NotifyWindowStyleChange(WindowStyleType type)
77{
78    SingletonContainer::Get<WindowManager>().NotifyWindowStyleChange(type);
79}
80
81void WindowManagerAgent::NotifyWindowPidVisibilityChanged(const sptr<WindowPidVisibilityInfo>& info)
82{
83    SingletonContainer::Get<WindowManager>().NotifyWindowPidVisibilityChanged(info);
84}
85
86} // namespace Rosen
87} // namespace OHOS
88