• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 OHOS_WINDOW_MANAGER_INTERFACE_H
17 #define OHOS_WINDOW_MANAGER_INTERFACE_H
18 
19 #include <iremote_broker.h>
20 #include <ui/rs_surface_node.h>
21 #include "window_property.h"
22 #include "zidl/window_interface.h"
23 #include "zidl/window_manager_agent_interface.h"
24 
25 namespace OHOS {
26 namespace Rosen {
27 class IWindowManager : public IRemoteBroker {
28 public:
29     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IWindowManager");
30 
31     enum {
32         TRANS_ID_CREATE_WINDOW,
33         TRANS_ID_ADD_WINDOW,
34         TRANS_ID_REMOVE_WINDOW,
35         TRANS_ID_DESTROY_WINDOW,
36         TRANS_ID_REQUEST_FOCUS,
37         TRANS_ID_SEND_ABILITY_TOKEN,
38         TRANS_ID_REGISTER_FOCUS_CHANGED_LISTENER,
39         TRANS_ID_UNREGISTER_FOCUS_CHANGED_LISTENER,
40         TRANS_ID_REGISTER_WINDOW_MANAGER_AGENT,
41         TRANS_ID_UNREGISTER_WINDOW_MANAGER_AGENT,
42         TRANS_ID_GET_AVOID_AREA,
43         TRANS_ID_GET_TOP_WINDOW_ID,
44         TRANS_ID_PROCESS_POINT_DOWN,
45         TRANS_ID_PROCESS_POINT_UP,
46         TRANS_ID_MINIMIZE_ALL_APP_WINDOWS,
47         TRANS_ID_SET_BACKGROUND_BLUR,
48         TRANS_ID_SET_APLPHA,
49         TRANS_ID_UPDATE_LAYOUT_MODE,
50         TRANS_ID_MAXMIZE_WINDOW,
51         TRANS_ID_UPDATE_PROPERTY,
52     };
53     virtual WMError CreateWindow(sptr<IWindow>& window, sptr<WindowProperty>& property,
54         const std::shared_ptr<RSSurfaceNode>& surfaceNode, uint32_t& windowId)  = 0;
55     virtual WMError AddWindow(sptr<WindowProperty>& property) = 0;
56     virtual WMError RemoveWindow(uint32_t windowId) = 0;
57     virtual WMError DestroyWindow(uint32_t windowId, bool onlySelf = false) = 0;
58     virtual WMError RequestFocus(uint32_t windowId) = 0;
59     virtual WMError SetWindowBackgroundBlur(uint32_t windowId, WindowBlurLevel level) = 0;
60     virtual WMError SetAlpha(uint32_t windowId, float alpha) = 0;
61     virtual WMError SaveAbilityToken(const sptr<IRemoteObject>& abilityToken, uint32_t windowId) = 0;
62     virtual std::vector<Rect> GetAvoidAreaByType(uint32_t windowId, AvoidAreaType type) = 0;
63     virtual WMError GetTopWindowId(uint32_t mainWinId, uint32_t& topWinId) = 0;
64     virtual void ProcessPointDown(uint32_t windowId, bool isStartDrag) = 0;
65     virtual void ProcessPointUp(uint32_t windowId) = 0;
66     virtual void MinimizeAllAppWindows(DisplayId displayId) = 0;
67     virtual WMError MaxmizeWindow(uint32_t windowId) = 0;
68     virtual WMError SetWindowLayoutMode(DisplayId displayId, WindowLayoutMode mode) = 0;
69     virtual WMError UpdateProperty(sptr<WindowProperty>& windowProperty, PropertyChangeAction action) = 0;
70     virtual void RegisterWindowManagerAgent(WindowManagerAgentType type,
71         const sptr<IWindowManagerAgent>& windowManagerAgent) = 0;
72     virtual void UnregisterWindowManagerAgent(WindowManagerAgentType type,
73         const sptr<IWindowManagerAgent>& windowManagerAgent) = 0;
74 };
75 }
76 }
77 #endif // OHOS_WINDOW_MANAGER_INTERFACE_H
78