• 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 INTERFACES_INNERKITS_WMSERVICE_IWINDOW_MANAGER_SERVICE_H
17 #define INTERFACES_INNERKITS_WMSERVICE_IWINDOW_MANAGER_SERVICE_H
18 
19 #include <vector>
20 #include <promise.h>
21 #include <refbase.h>
22 #include <window_manager_type.h>
23 
24 #include "iwindow_change_listener_clazz.h"
25 #include "iwindow_manager_display_listener_clazz.h"
26 
27 #include "window_manager_service_type.h"
28 
29 namespace OHOS {
30 class IWindowManagerService : public RefBase {
31 public:
32     virtual ~IWindowManagerService() = default;
33 
34     virtual GSError GetDisplays(std::vector<struct WMDisplayInfo> &displays) = 0;
35     virtual sptr<PromisePowerStatus> GetDisplayPower(int32_t did) = 0;
36     virtual sptr<PromiseWMError> SetDisplayPower(int32_t did, DispPowerStatus status) = 0;
37     virtual sptr<PromiseBacklight> GetDisplayBacklight(int32_t did) = 0;
38     virtual sptr<PromiseWMError> SetDisplayBacklight(int32_t did, uint32_t level) = 0;
39     virtual sptr<PromiseWMError> SetDisplayMode(WMSDisplayMode modes) = 0;
40     virtual sptr<PromiseWMError> OnWindowListChange(IWindowChangeListenerClazz *listener) = 0;
41     virtual GSError GetDisplayModes(uint32_t &displayModes) = 0;
42     virtual GSError AddDisplayChangeListener(IWindowManagerDisplayListenerClazz *listener) = 0;
43 
44     virtual GSError SetDisplayDirection(WMSDisplayDirection direction) = 0;
45     virtual GSError OnDisplayDirectionChange(DisplayDirectionChangeFunc func) = 0;
46 
47     virtual sptr<PromiseWMError> SetStatusBarVisibility(bool visibility) = 0;
48     virtual sptr<PromiseWMError> SetNavigationBarVisibility(bool visibility) = 0;
49 
50     virtual sptr<PromiseWMSImageInfo> ShotScreen(int32_t did) = 0;
51     virtual sptr<PromiseWMSImageInfo> ShotWindow(int32_t wid) = 0;
52 
53     virtual sptr<PromiseWMError> DestroyWindow(int32_t wid) = 0;
54     virtual sptr<PromiseWMError> SwitchTop(int32_t wid) = 0;
55     virtual sptr<PromiseWMError> Show(int32_t wid) = 0;
56     virtual sptr<PromiseWMError> Hide(int32_t wid) = 0;
57     virtual sptr<PromiseWMError> Move(int32_t wid, int32_t x, int32_t y) = 0;
58     virtual sptr<PromiseWMError> Resize(int32_t wid, uint32_t width, uint32_t height) = 0;
59     virtual sptr<PromiseWMError> ScaleTo(int32_t wid, uint32_t width, uint32_t height) = 0;
60     virtual sptr<PromiseWMError> SetWindowType(int32_t wid, WindowType type) = 0;
61     virtual sptr<PromiseWMError> SetWindowMode(int32_t wid, WindowMode mode) = 0;
62 
63     virtual sptr<PromiseWMError> CreateVirtualDisplay(int32_t x, int32_t y, int32_t width, int32_t height) = 0;
64     virtual sptr<PromiseWMError> DestroyVirtualDisplay(uint32_t did) = 0;
65 
StartRotationAnimation(uint32_t did,int32_t degree)66     virtual GSError StartRotationAnimation(uint32_t did, int32_t degree)
67     {
68         return GSERROR_NOT_SUPPORT;
69     }
70 
71     virtual sptr<PromiseWMError> SetSplitMode(SplitMode mode, int32_t x = 0, int32_t y = 0)
72     {
73         return nullptr;
74     }
75 
CreateLaunchPage(const std::string & filename)76     virtual GSError CreateLaunchPage(const std::string &filename)
77     {
78         return GSERROR_NOT_SUPPORT;
79     }
80 
CancelLaunchPage()81     virtual GSError CancelLaunchPage()
82     {
83         return GSERROR_NOT_SUPPORT;
84     }
85 };
86 } // namespace OHOS
87 
88 #endif // INTERFACES_INNERKITS_WMSERVICE_IWINDOW_MANAGER_SERVICE_H
89