1 /* 2 * Copyright (c) 2021-2022 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_AGENT_H 17 #define OHOS_WINDOW_AGENT_H 18 19 #include "zidl/window_stub.h" 20 #include "window_impl.h" 21 #include "window_property.h" 22 #include "wm_common.h" 23 24 namespace OHOS { 25 namespace Rosen { 26 class WindowAgent : public WindowStub { 27 public: 28 explicit WindowAgent(sptr<WindowImpl>& window); 29 ~WindowAgent() = default; 30 WMError UpdateWindowRect(const struct Rect& rect, bool decoStatus, WindowSizeChangeReason reason) override; 31 WMError UpdateWindowMode(WindowMode mode) override; 32 WMError UpdateWindowModeSupportInfo(uint32_t modeSupportInfo) override; 33 WMError UpdateFocusStatus(bool focused) override; 34 WMError UpdateAvoidArea(const sptr<AvoidArea>& avoidArea, AvoidAreaType type) override; 35 WMError UpdateWindowState(WindowState state) override; 36 WMError UpdateWindowDragInfo(const PointInfo& point, DragEvent event) override; 37 WMError UpdateDisplayId(DisplayId from, DisplayId to) override; 38 WMError UpdateOccupiedAreaChangeInfo(const sptr<OccupiedAreaChangeInfo>& info) override; 39 WMError UpdateActiveStatus(bool isActive) override; 40 sptr<WindowProperty> GetWindowProperty() override; 41 WMError NotifyTouchOutside() override; 42 WMError NotifyScreenshot() override; 43 WMError DumpInfo(const std::vector<std::string>& params) override; 44 WMError NotifyDestroy(void) override; 45 WMError NotifyForeground(void) override; 46 WMError NotifyBackground(void) override; 47 WMError NotifyWindowClientPointUp(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) override; 48 WMError UpdateZoomTransform(const Transform& trans, bool isDisplayZoomOn) override; 49 WMError RestoreSplitWindowMode(uint32_t mode) override; 50 private: 51 sptr<WindowImpl> window_; 52 }; 53 } // namespace Rosen 54 } // namespace OHOS 55 #endif // OHOS_WINDOW_AGENT_H 56