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 IWindow : public IRemoteBroker { 28 public: 29 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.IWindow"); 30 31 enum class WindowMessage : uint32_t { 32 TRANS_ID_UPDATE_WINDOW_RECT, 33 TRANS_ID_UPDATE_WINDOW_MODE, 34 TRANS_ID_UPDATE_MODE_SUPPORT_INFO, 35 TRANS_ID_UPDATE_FOCUS_STATUS, 36 TRANS_ID_UPDATE_AVOID_AREA, 37 TRANS_ID_UPDATE_WINDOW_STATE, 38 TRANS_ID_UPDATE_DRAG_EVENT, 39 TRANS_ID_UPDATE_DISPLAY_ID, 40 TRANS_ID_UPDATE_OCCUPIED_AREA, 41 TRANS_ID_UPDATE_ACTIVE_STATUS, 42 TRANS_ID_GET_WINDOW_PROPERTY, 43 TRANS_ID_NOTIFY_OUTSIDE_PRESSED, 44 TRANS_ID_NOTIFY_SCREEN_SHOT, 45 TRANS_ID_DUMP_INFO, 46 TRANS_ID_NOTIFY_DESTROY, 47 TRANS_ID_NOTIFY_FOREGROUND, 48 TRANS_ID_NOTIFY_BACKGROUND, 49 TRANS_ID_NOTIFY_CLIENT_POINT_UP, 50 TRANS_ID_UPDATE_ZOOM_TRANSFORM, 51 TRANS_ID_RESTORE_SPLIT_WINDOW_MODE, 52 }; 53 54 virtual WMError UpdateWindowRect(const struct Rect& rect, bool decoStatus, WindowSizeChangeReason reason) = 0; 55 virtual WMError UpdateWindowMode(WindowMode mode) = 0; 56 virtual WMError UpdateWindowModeSupportInfo(uint32_t modeSupportInfo) = 0; 57 virtual WMError UpdateFocusStatus(bool focused) = 0; 58 virtual WMError UpdateAvoidArea(const sptr<AvoidArea>& avoidArea, AvoidAreaType type) = 0; 59 virtual WMError UpdateWindowState(WindowState state) = 0; 60 virtual WMError UpdateWindowDragInfo(const PointInfo& point, DragEvent event) = 0; 61 virtual WMError UpdateDisplayId(DisplayId from, DisplayId to) = 0; 62 virtual WMError UpdateOccupiedAreaChangeInfo(const sptr<OccupiedAreaChangeInfo>& info) = 0; 63 virtual WMError UpdateActiveStatus(bool isActive) = 0; 64 virtual sptr<WindowProperty> GetWindowProperty() = 0; 65 virtual WMError NotifyTouchOutside() = 0; 66 virtual WMError NotifyScreenshot() = 0; 67 virtual WMError DumpInfo(const std::vector<std::string>& params) = 0; 68 virtual WMError NotifyDestroy(void) = 0; 69 virtual WMError NotifyForeground(void) = 0; 70 virtual WMError NotifyBackground(void) = 0; 71 virtual WMError NotifyWindowClientPointUp(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) = 0; 72 virtual WMError UpdateZoomTransform(const Transform& trans, bool isDisplayZoomOn) = 0; 73 virtual WMError RestoreSplitWindowMode(uint32_t mode) = 0; 74 }; 75 } // namespace Rosen 76 } // namespace OHOS 77 #endif // OHOS_WINDOW_INTERFACE_H 78