• 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_INTERFACE_H
17 #define OHOS_WINDOW_INTERFACE_H
18 
19 #include "iremote_broker.h"
20 #include "window.h"
21 #include "window_property.h"
22 #include "wm_common.h"
23 #include "wm_common_inner.h"
24 
25 namespace OHOS {
26 namespace Rosen {
27 class RSTransaction;
28 class IWindow : public IRemoteBroker {
29 public:
30     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IWindow");
31 
32     enum class WindowMessage : uint32_t {
33         TRANS_ID_UPDATE_WINDOW_RECT,
34         TRANS_ID_UPDATE_WINDOW_MODE,
35         TRANS_ID_UPDATE_MODE_SUPPORT_INFO,
36         TRANS_ID_UPDATE_FOCUS_STATUS,
37         TRANS_ID_UPDATE_AVOID_AREA,
38         TRANS_ID_UPDATE_WINDOW_STATE,
39         TRANS_ID_UPDATE_DRAG_EVENT,
40         TRANS_ID_UPDATE_DISPLAY_ID,
41         TRANS_ID_UPDATE_OCCUPIED_AREA,
42         TRANS_ID_UPDATE_OCCUPIED_AREA_AND_RECT,
43         TRANS_ID_UPDATE_ACTIVE_STATUS,
44         TRANS_ID_GET_WINDOW_PROPERTY,
45         TRANS_ID_NOTIFY_OUTSIDE_PRESSED,
46         TRANS_ID_NOTIFY_SCREEN_SHOT,
47         TRANS_ID_NOTIFY_SCREEN_SHOT_APP_EVENT,
48         TRANS_ID_DUMP_INFO,
49         TRANS_ID_NOTIFY_DESTROY,
50         TRANS_ID_NOTIFY_FOREGROUND,
51         TRANS_ID_NOTIFY_BACKGROUND,
52         TRANS_ID_NOTIFY_CLIENT_POINT_UP,
53         TRANS_ID_UPDATE_ZOOM_TRANSFORM,
54         TRANS_ID_RESTORE_SPLIT_WINDOW_MODE,
55         TRANS_ID_CONSUME_KEY_EVENT,
56         TRANS_ID_GET_ROUTER_STACK_INFO,
57         TRANS_ID_NOTIFY_FOREGROUND_INTERACTIVE_STATUS,
58         TRANS_ID_NOTIFY_MMI_SERVICE_ONLINE,
59     };
60 
61     virtual WMError UpdateWindowRect(const struct Rect& rect, bool decoStatus, WindowSizeChangeReason reason,
62         const std::shared_ptr<RSTransaction>& rsTransaction = nullptr) = 0;
63     virtual WMError UpdateWindowMode(WindowMode mode) = 0;
64     virtual WMError UpdateWindowModeSupportType(uint32_t windowModeSupportType) = 0;
65     virtual WMError UpdateFocusStatus(bool focused) = 0;
66     virtual WMError UpdateAvoidArea(const sptr<AvoidArea>& avoidArea, AvoidAreaType type) = 0;
67     virtual WMError UpdateWindowState(WindowState state) = 0;
68     virtual WMError UpdateWindowDragInfo(const PointInfo& point, DragEvent event) = 0;
69     virtual WMError UpdateDisplayId(DisplayId from, DisplayId to) = 0;
70     virtual WMError UpdateOccupiedAreaChangeInfo(const sptr<OccupiedAreaChangeInfo>& info,
71         const std::shared_ptr<RSTransaction>& rsTransaction = nullptr) = 0;
72     virtual WMError UpdateActiveStatus(bool isActive) = 0;
73     virtual sptr<WindowProperty> GetWindowProperty() = 0;
74     virtual WMError NotifyTouchOutside() = 0;
75     virtual WMError NotifyScreenshot() = 0;
76     virtual WMError NotifyScreenshotAppEvent(ScreenshotEventType type) = 0;
77     virtual WMError DumpInfo(const std::vector<std::string>& params) = 0;
78     virtual WMError NotifyDestroy(void) = 0;
79     virtual WMError NotifyForeground(void) = 0;
80     virtual WMError NotifyBackground(void) = 0;
81     virtual WMError NotifyWindowClientPointUp(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) = 0;
82     virtual WMError UpdateZoomTransform(const Transform& trans, bool isDisplayZoomOn) = 0;
83     virtual WMError RestoreSplitWindowMode(uint32_t mode) = 0;
84     virtual void ConsumeKeyEvent(std::shared_ptr<MMI::KeyEvent> event) = 0;
85     virtual WMError UpdateOccupiedAreaAndRect(const sptr<OccupiedAreaChangeInfo>& info, const Rect& rect,
86         const std::shared_ptr<RSTransaction>& rsTransaction = nullptr) = 0;
87     virtual void NotifyForegroundInteractiveStatus(bool interactive) = 0;
88     virtual void NotifyMMIServiceOnline(uint32_t winId) = 0;
89 };
90 } // namespace Rosen
91 } // namespace OHOS
92 #endif // OHOS_WINDOW_INTERFACE_H
93