• 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_WMCLIENT_WINDOW_MANAGER_H
17 #define INTERFACES_INNERKITS_WMCLIENT_WINDOW_MANAGER_H
18 
19 #include <vector>
20 
21 #include <refbase.h>
22 
23 #include "iscreen_shot_callback.h"
24 #include "iwindow_shot_callback.h"
25 #include "subwindow.h"
26 #include "subwindow_option.h"
27 #include "window.h"
28 #include "window_manager_type.h"
29 #include "window_option.h"
30 #include "virtual_display_option.h"
31 
32 namespace OHOS {
33 class WindowManager : public RefBase {
34 public:
35     static sptr<WindowManager> GetInstance();
36 
37     virtual GSError Init() = 0;
38 
39     virtual GSError GetDisplays(std::vector<struct WMDisplayInfo> &displays) const = 0;
40     virtual sptr<Window> GetWindowByID(int32_t wid) = 0;
41 
42     virtual GSError CreateWindow(sptr<Window> &window, const sptr<WindowOption> &option) = 0;
43     virtual GSError CreateSubwindow(sptr<Subwindow> &subwindow,
44                                     const sptr<Window> &window,
45                                     const sptr<SubwindowOption> &option) = 0;
46 
47     virtual GSError ListenNextScreenShot(int32_t id, IScreenShotCallback *cb) = 0;
48     virtual GSError ListenNextWindowShot(const sptr<Window> &window, IWindowShotCallback *cb) = 0;
49 
50     virtual GSError CreateVirtualDisplay(const sptr<VirtualDisplayOption> &option) = 0;
51     virtual GSError DestroyVirtualDisplay(uint32_t did) = 0;
52     virtual GSError SetDisplayMode(WMSDisplayMode mode) = 0;
53 };
54 } // namespace OHOS
55 
56 #endif // INTERFACES_INNERKITS_WMCLIENT_WINDOW_MANAGER_H
57