1e0dac50fSopenharmony_ci/*
2e0dac50fSopenharmony_ci * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3e0dac50fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4e0dac50fSopenharmony_ci * you may not use this file except in compliance with the License.
5e0dac50fSopenharmony_ci * You may obtain a copy of the License at
6e0dac50fSopenharmony_ci *
7e0dac50fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8e0dac50fSopenharmony_ci *
9e0dac50fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10e0dac50fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11e0dac50fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12e0dac50fSopenharmony_ci * See the License for the specific language governing permissions and
13e0dac50fSopenharmony_ci * limitations under the License.
14e0dac50fSopenharmony_ci */
15e0dac50fSopenharmony_ci
16e0dac50fSopenharmony_ci#ifndef OHOS_ROSEN_WINDOW_H
17e0dac50fSopenharmony_ci#define OHOS_ROSEN_WINDOW_H
18e0dac50fSopenharmony_ci
19e0dac50fSopenharmony_ci#include <parcel.h>
20e0dac50fSopenharmony_ci#include <refbase.h>
21e0dac50fSopenharmony_ci#include <pixel_map.h>
22e0dac50fSopenharmony_ci#include <iremote_object.h>
23e0dac50fSopenharmony_ci
24e0dac50fSopenharmony_ci#include "wm_common.h"
25e0dac50fSopenharmony_ci#include "window_option.h"
26e0dac50fSopenharmony_ci
27e0dac50fSopenharmony_citypedef struct napi_env__* napi_env;
28e0dac50fSopenharmony_citypedef struct napi_value__* napi_value;
29e0dac50fSopenharmony_ci
30e0dac50fSopenharmony_cinamespace OHOS::MMI {
31e0dac50fSopenharmony_ciclass PointerEvent;
32e0dac50fSopenharmony_ciclass KeyEvent;
33e0dac50fSopenharmony_ciclass AxisEvent;
34e0dac50fSopenharmony_ci}
35e0dac50fSopenharmony_ci
36e0dac50fSopenharmony_cinamespace OHOS::AppExecFwk {
37e0dac50fSopenharmony_ciclass Configuration;
38e0dac50fSopenharmony_ciclass Ability;
39e0dac50fSopenharmony_ci}
40e0dac50fSopenharmony_ci
41e0dac50fSopenharmony_cinamespace OHOS::AbilityRuntime {
42e0dac50fSopenharmony_ciclass AbilityContext;
43e0dac50fSopenharmony_ciclass Context;
44e0dac50fSopenharmony_ci}
45e0dac50fSopenharmony_ci
46e0dac50fSopenharmony_cinamespace OHOS::Ace {
47e0dac50fSopenharmony_ciclass UIContent;
48e0dac50fSopenharmony_ciclass ViewportConfig;
49e0dac50fSopenharmony_ci}
50e0dac50fSopenharmony_ci
51e0dac50fSopenharmony_cinamespace OHOS::AAFwk {
52e0dac50fSopenharmony_ciclass Want;
53e0dac50fSopenharmony_ci}
54e0dac50fSopenharmony_ci
55e0dac50fSopenharmony_cinamespace OHOS {
56e0dac50fSopenharmony_cinamespace Rosen {
57e0dac50fSopenharmony_ciclass RSSurfaceNode;
58e0dac50fSopenharmony_ciclass RSTransaction;
59e0dac50fSopenharmony_ciusing NotifyNativeWinDestroyFunc = std::function<void(std::string windowName)>;
60e0dac50fSopenharmony_ciusing SendRenderDataCallback = bool (*)(const void*, const size_t, const int32_t, const int32_t, const uint64_t);
61e0dac50fSopenharmony_ciusing ContentInfoCallback = std::function<void(std::string contentInfo)>;
62e0dac50fSopenharmony_ci
63e0dac50fSopenharmony_ciclass IWindowLifeCycle : virtual public RefBase {
64e0dac50fSopenharmony_ci};
65e0dac50fSopenharmony_ciclass IWindowChangeListener : virtual public RefBase {
66e0dac50fSopenharmony_ci};
67e0dac50fSopenharmony_ciclass IWindowSystemBarEnableListener : virtual public RefBase {
68e0dac50fSopenharmony_cipublic:
69e0dac50fSopenharmony_ci    virtual WMError OnSetSpecificBarProperty(WindowType type, const SystemBarProperty& property) = 0;
70e0dac50fSopenharmony_ci};
71e0dac50fSopenharmony_ciclass IIgnoreViewSafeAreaListener : virtual public RefBase {
72e0dac50fSopenharmony_cipublic:
73e0dac50fSopenharmony_ci    virtual void SetIgnoreViewSafeArea(bool ignoreViewSafeArea) = 0;
74e0dac50fSopenharmony_ci};
75e0dac50fSopenharmony_ciclass IAvoidAreaChangedListener : virtual public RefBase {
76e0dac50fSopenharmony_cipublic:
77e0dac50fSopenharmony_ci    virtual void OnAvoidAreaChanged(const AvoidArea avoidArea, AvoidAreaType type) {}
78e0dac50fSopenharmony_ci};
79e0dac50fSopenharmony_ciclass IWindowDragListener : virtual public RefBase {
80e0dac50fSopenharmony_ci};
81e0dac50fSopenharmony_ciclass IDisplayMoveListener : virtual public RefBase {
82e0dac50fSopenharmony_ci};
83e0dac50fSopenharmony_ciclass IDispatchInputEventListener : virtual public RefBase {
84e0dac50fSopenharmony_ci};
85e0dac50fSopenharmony_ciclass OccupiedAreaChangeInfo : public Parcelable {
86e0dac50fSopenharmony_cipublic:
87e0dac50fSopenharmony_ci    virtual bool Marshalling(Parcel& parcel) const override;
88e0dac50fSopenharmony_ci    static OccupiedAreaChangeInfo* Unmarshalling(Parcel& parcel);
89e0dac50fSopenharmony_ci};
90e0dac50fSopenharmony_ciclass IOccupiedAreaChangeListener : virtual public RefBase {
91e0dac50fSopenharmony_ci};
92e0dac50fSopenharmony_ciclass IAceAbilityHandler : virtual public RefBase {
93e0dac50fSopenharmony_ci};
94e0dac50fSopenharmony_ciclass IInputEventConsumer {
95e0dac50fSopenharmony_ci};
96e0dac50fSopenharmony_ciclass ITouchOutsideListener : virtual public RefBase {
97e0dac50fSopenharmony_ci};
98e0dac50fSopenharmony_ciclass IAnimationTransitionController : virtual public RefBase {
99e0dac50fSopenharmony_cipublic:
100e0dac50fSopenharmony_ci    virtual void AnimationForShown() = 0;
101e0dac50fSopenharmony_ci    virtual void AnimationForHidden() = 0;
102e0dac50fSopenharmony_ci};
103e0dac50fSopenharmony_ciclass IScreenshotListener : virtual public RefBase {
104e0dac50fSopenharmony_ci};
105e0dac50fSopenharmony_ciclass IDialogTargetTouchListener : virtual public RefBase {
106e0dac50fSopenharmony_ci};
107e0dac50fSopenharmony_ciclass IDialogDeathRecipientListener : virtual public RefBase {
108e0dac50fSopenharmony_ci};
109e0dac50fSopenharmony_ciclass IWindowTitleButtonRectChangedListener : virtual public RefBase {
110e0dac50fSopenharmony_ci};
111e0dac50fSopenharmony_ciclass IWindowVisibilityChangedListener : virtual public RefBase {
112e0dac50fSopenharmony_ci};
113e0dac50fSopenharmony_ci
114e0dac50fSopenharmony_ciusing WindowVisibilityListenerSptr = sptr<IWindowVisibilityChangedListener>;
115e0dac50fSopenharmony_ci
116e0dac50fSopenharmony_ciclass IWindowNoInteractionListener : virtual public RefBase {
117e0dac50fSopenharmony_ci};
118e0dac50fSopenharmony_ciusing IWindowNoInteractionListenerSptr = sptr<IWindowNoInteractionListener>;
119e0dac50fSopenharmony_ci
120e0dac50fSopenharmony_cistatic WMError DefaultCreateErrCode = WMError::WM_OK;
121e0dac50fSopenharmony_ciclass WINDOW_EXPORT Window : public RefBase {
122e0dac50fSopenharmony_cipublic:
123e0dac50fSopenharmony_ci    static sptr<Window> Create(const std::string& windowName,
124e0dac50fSopenharmony_ci    sptr<WindowOption>& option, const std::shared_ptr<AbilityRuntime::Context>& context = nullptr,
125e0dac50fSopenharmony_ci    WMError& errCode = DefaultCreateErrCode);
126e0dac50fSopenharmony_ci    static sptr<Window> Find(const std::string& windowName);
127e0dac50fSopenharmony_ci    static sptr<Window> GetTopWindowWithContext(const std::shared_ptr<AbilityRuntime::Context>& context = nullptr);
128e0dac50fSopenharmony_ci    static sptr<Window> GetTopWindowWithId(uint32_t mainWinId);
129e0dac50fSopenharmony_ci    static std::vector<sptr<Window>> GetSubWindow(uint32_t parentId);
130e0dac50fSopenharmony_ci    static void UpdateConfigurationForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration);
131e0dac50fSopenharmony_ci    virtual std::shared_ptr<RSSurfaceNode> GetSurfaceNode() const = 0;
132e0dac50fSopenharmony_ci    virtual const std::shared_ptr<AbilityRuntime::Context> GetContext() const = 0;
133e0dac50fSopenharmony_ci    virtual Rect GetRect() const = 0;
134e0dac50fSopenharmony_ci    virtual Rect GetRequestRect() const = 0;
135e0dac50fSopenharmony_ci    virtual WindowType GetType() const = 0;
136e0dac50fSopenharmony_ci    virtual WindowMode GetMode() const = 0;
137e0dac50fSopenharmony_ci    virtual float GetAlpha() const = 0;
138e0dac50fSopenharmony_ci    virtual const std::string& GetWindowName() const = 0;
139e0dac50fSopenharmony_ci    virtual uint32_t GetWindowId() const = 0;
140e0dac50fSopenharmony_ci    virtual uint64_t GetDisplayId() const = 0;
141e0dac50fSopenharmony_ci    virtual uint32_t GetWindowFlags() const = 0;
142e0dac50fSopenharmony_ci    virtual WindowState GetWindowState() const = 0;
143e0dac50fSopenharmony_ci    virtual WMError SetFocusable(bool isFocusable) = 0;
144e0dac50fSopenharmony_ci    virtual bool GetFocusable() const = 0;
145e0dac50fSopenharmony_ci    virtual WMError SetTouchable(bool isTouchable) = 0;
146e0dac50fSopenharmony_ci    virtual SystemBarProperty GetSystemBarPropertyByType(WindowType type) const = 0;
147e0dac50fSopenharmony_ci    virtual bool GetTouchable() const = 0;
148e0dac50fSopenharmony_ci    virtual bool IsLayoutFullScreen() const = 0;
149e0dac50fSopenharmony_ci    virtual bool IsFullScreen() const = 0;
150e0dac50fSopenharmony_ci    virtual WMError SetWindowMode(WindowMode mode) = 0;
151e0dac50fSopenharmony_ci    virtual WMError SetWindowType(WindowType type) = 0;
152e0dac50fSopenharmony_ci    virtual WMError SetAlpha(float alpha) = 0;
153e0dac50fSopenharmony_ci    virtual WMError SetTransform(const Transform& trans) = 0;
154e0dac50fSopenharmony_ci    virtual const Transform& GetTransform() const = 0;
155e0dac50fSopenharmony_ci    virtual WMError RemoveWindowFlag(WindowFlag flag) = 0;
156e0dac50fSopenharmony_ci    virtual WMError AddWindowFlag(WindowFlag flag) = 0;
157e0dac50fSopenharmony_ci    virtual WMError SetWindowFlags(uint32_t flags) = 0;
158e0dac50fSopenharmony_ci    virtual WMError GetAvoidAreaByType(AvoidAreaType type, AvoidArea& avoidArea) = 0;
159e0dac50fSopenharmony_ci    virtual WMError SetSystemBarProperty(WindowType type, const SystemBarProperty& property) = 0;
160e0dac50fSopenharmony_ci    virtual WMError SetSpecificBarProperty(WindowType type, const SystemBarProperty& property) = 0;
161e0dac50fSopenharmony_ci    virtual WMError SetSystemBarProperties(const std::map<WindowType, SystemBarProperty>& properties,
162e0dac50fSopenharmony_ci        const std::map<WindowType, SystemBarPropertyFlag>& propertyFlags) = 0;
163e0dac50fSopenharmony_ci    virtual WMError GetSystemBarProperties(std::map<WindowType, SystemBarProperty>& properties) = 0;
164e0dac50fSopenharmony_ci    virtual WMError SetFullScreen(bool status) = 0;
165e0dac50fSopenharmony_ci    virtual WMError SetLayoutFullScreen(bool status) = 0;
166e0dac50fSopenharmony_ci    virtual WMError SetTitleAndDockHoverShown(bool titleHoverShowEnabled = true,
167e0dac50fSopenharmony_ci        bool dockHoverShowEnabled = true)
168e0dac50fSopenharmony_ci    {
169e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
170e0dac50fSopenharmony_ci    }
171e0dac50fSopenharmony_ci    virtual WMError Destroy() = 0;
172e0dac50fSopenharmony_ci    virtual WMError Show(uint32_t reason = 0, bool withAnimation = false, bool withFocus = true) = 0;
173e0dac50fSopenharmony_ci    virtual WMError Hide(uint32_t reason = 0, bool withAnimation = false, bool isFromInnerkits = true) = 0;
174e0dac50fSopenharmony_ci    virtual WMError MoveTo(int32_t x, int32_t y, bool isMoveToGlobal = false) = 0;
175e0dac50fSopenharmony_ci    virtual WMError MoveToAsync(int32_t x, int32_t y) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
176e0dac50fSopenharmony_ci    virtual WMError Resize(uint32_t width, uint32_t height) = 0;
177e0dac50fSopenharmony_ci    virtual WMError ResizeAsync(uint32_t width, uint32_t height) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
178e0dac50fSopenharmony_ci    virtual WMError SetWindowGravity(WindowGravity gravity, uint32_t percent) = 0;
179e0dac50fSopenharmony_ci    virtual WMError SetKeepScreenOn(bool keepScreenOn) = 0;
180e0dac50fSopenharmony_ci    virtual bool IsKeepScreenOn() const = 0;
181e0dac50fSopenharmony_ci    virtual WMError SetTurnScreenOn(bool turnScreenOn) = 0;
182e0dac50fSopenharmony_ci    virtual bool IsTurnScreenOn() const = 0;
183e0dac50fSopenharmony_ci    virtual WMError SetBackgroundColor(const std::string& color) = 0;
184e0dac50fSopenharmony_ci    virtual WMError SetTransparent(bool isTransparent) = 0;
185e0dac50fSopenharmony_ci    virtual bool IsTransparent() const = 0;
186e0dac50fSopenharmony_ci    virtual WMError SetBrightness(float brightness) = 0;
187e0dac50fSopenharmony_ci    virtual float GetBrightness() const = 0;
188e0dac50fSopenharmony_ci    virtual WMError SetCallingWindow(uint32_t windowId) = 0;
189e0dac50fSopenharmony_ci    virtual WMError SetPrivacyMode(bool isPrivacyMode) = 0;
190e0dac50fSopenharmony_ci    virtual bool IsPrivacyMode() const = 0;
191e0dac50fSopenharmony_ci    virtual void SetSystemPrivacyMode(bool isSystemPrivacyMode) = 0;
192e0dac50fSopenharmony_ci    virtual WMError BindDialogTarget(sptr<IRemoteObject> targetToken) = 0;
193e0dac50fSopenharmony_ci    virtual WMError SetDialogBackGestureEnabled(bool isEnabled) = 0;
194e0dac50fSopenharmony_ci    virtual WMError RaiseToAppTop() = 0;
195e0dac50fSopenharmony_ci    virtual WMError SetSnapshotSkip(bool isSkip) = 0;
196e0dac50fSopenharmony_ci    virtual WMError SetCornerRadius(float cornerRadius) = 0;
197e0dac50fSopenharmony_ci    virtual WMError SetShadowRadius(float radius) = 0;
198e0dac50fSopenharmony_ci    virtual WMError SetShadowColor(std::string color) = 0;
199e0dac50fSopenharmony_ci    virtual WMError SetShadowOffsetX(float offsetX) = 0;
200e0dac50fSopenharmony_ci    virtual WMError SetShadowOffsetY(float offsetY) = 0;
201e0dac50fSopenharmony_ci    virtual WMError SetBlur(float radius) = 0;
202e0dac50fSopenharmony_ci    virtual WMError SetBackdropBlur(float radius) = 0;
203e0dac50fSopenharmony_ci    virtual WMError SetBackdropBlurStyle(WindowBlurStyle blurStyle) = 0;
204e0dac50fSopenharmony_ci    virtual WMError RequestFocus() const = 0;
205e0dac50fSopenharmony_ci    virtual WMError RequestFocusByClient(bool isFocused) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
206e0dac50fSopenharmony_ci    virtual bool IsFocused() const = 0;
207e0dac50fSopenharmony_ci    virtual WMError UpdateSurfaceNodeAfterCustomAnimation(bool isAdd) = 0;
208e0dac50fSopenharmony_ci    virtual void SetInputEventConsumer(const std::shared_ptr<IInputEventConsumer>& inputEventConsumer) = 0;
209e0dac50fSopenharmony_ci    virtual void ConsumeKeyEvent(const std::shared_ptr<MMI::KeyEvent>& inputEvent) = 0;
210e0dac50fSopenharmony_ci    virtual void ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent>& inputEvent) = 0;
211e0dac50fSopenharmony_ci    virtual void RequestVsync(const std::shared_ptr<VsyncCallback>& vsyncCallback) = 0;
212e0dac50fSopenharmony_ci    virtual int64_t GetVSyncPeriod() = 0;
213e0dac50fSopenharmony_ci    virtual void FlushFrameRate(uint32_t rate, int32_t animatorExpectedFrameRate, uint32_t rateType) {}
214e0dac50fSopenharmony_ci    virtual void UpdateConfiguration(const std::shared_ptr<AppExecFwk::Configuration>& configuration) = 0;
215e0dac50fSopenharmony_ci    virtual WMError RegisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener) = 0;
216e0dac50fSopenharmony_ci    virtual WMError UnregisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener) = 0;
217e0dac50fSopenharmony_ci    virtual WMError RegisterWindowChangeListener(const sptr<IWindowChangeListener>& listener) = 0;
218e0dac50fSopenharmony_ci    virtual WMError UnregisterWindowChangeListener(const sptr<IWindowChangeListener>& listener) = 0;
219e0dac50fSopenharmony_ci    virtual WMError RegisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener>& listener) = 0;
220e0dac50fSopenharmony_ci    virtual WMError UnregisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener>& listener) = 0;
221e0dac50fSopenharmony_ci    virtual WMError RegisterDragListener(const sptr<IWindowDragListener>& listener) = 0;
222e0dac50fSopenharmony_ci    virtual WMError UnregisterDragListener(const sptr<IWindowDragListener>& listener) = 0;
223e0dac50fSopenharmony_ci    virtual WMError RegisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener) = 0;
224e0dac50fSopenharmony_ci    virtual WMError UnregisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener) = 0;
225e0dac50fSopenharmony_ci    virtual void RegisterWindowDestroyedListener(const NotifyNativeWinDestroyFunc& func) = 0;
226e0dac50fSopenharmony_ci    virtual void UnregisterWindowDestroyedListener() {}
227e0dac50fSopenharmony_ci    virtual WMError RegisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener) = 0;
228e0dac50fSopenharmony_ci    virtual WMError UnregisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener) = 0;
229e0dac50fSopenharmony_ci    virtual WMError RegisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener) = 0;
230e0dac50fSopenharmony_ci    virtual WMError UnregisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener) = 0;
231e0dac50fSopenharmony_ci    virtual WMError RegisterAnimationTransitionController(const sptr<IAnimationTransitionController>& listener) = 0;
232e0dac50fSopenharmony_ci    virtual WMError RegisterScreenshotListener(const sptr<IScreenshotListener>& listener) = 0;
233e0dac50fSopenharmony_ci    virtual WMError UnregisterScreenshotListener(const sptr<IScreenshotListener>& listener) = 0;
234e0dac50fSopenharmony_ci    virtual WMError RegisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener) = 0;
235e0dac50fSopenharmony_ci    virtual WMError UnregisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener) = 0;
236e0dac50fSopenharmony_ci    virtual void RegisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener) = 0;
237e0dac50fSopenharmony_ci    virtual void UnregisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener) = 0;
238e0dac50fSopenharmony_ci    virtual WMError RegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener>& listener) = 0;
239e0dac50fSopenharmony_ci    virtual WMError UnRegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener>& listener) = 0;
240e0dac50fSopenharmony_ci    virtual WMError RegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener>& listener) = 0;
241e0dac50fSopenharmony_ci    virtual WMError UnRegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener>& listener) = 0;
242e0dac50fSopenharmony_ci    virtual void NotifyTouchDialogTarget(int32_t posX = 0, int32_t posY = 0) = 0;
243e0dac50fSopenharmony_ci    virtual void SetAceAbilityHandler(const sptr<IAceAbilityHandler>& handler) = 0;
244e0dac50fSopenharmony_ci    virtual WMError NapiSetUIContent(const std::string& contentInfo, napi_env env, napi_value storage,
245e0dac50fSopenharmony_ci        BackupAndRestoreType type = BackupAndRestoreType::NONE, sptr<IRemoteObject> token = nullptr,
246e0dac50fSopenharmony_ci        AppExecFwk::Ability* ability = nullptr) = 0;
247e0dac50fSopenharmony_ci    virtual WMError SetUIContentByName(const std::string& contentInfo, napi_env env, napi_value storage,
248e0dac50fSopenharmony_ci        AppExecFwk::Ability* ability = nullptr)
249e0dac50fSopenharmony_ci    {
250e0dac50fSopenharmony_ci        return WMError::WM_OK;
251e0dac50fSopenharmony_ci    }
252e0dac50fSopenharmony_ci    virtual WMError SetUIContentByAbc(const std::string& abcPath, napi_env env, napi_value storage,
253e0dac50fSopenharmony_ci        AppExecFwk::Ability* ability = nullptr)
254e0dac50fSopenharmony_ci    {
255e0dac50fSopenharmony_ci        return WMError::WM_OK;
256e0dac50fSopenharmony_ci    }
257e0dac50fSopenharmony_ci    virtual std::string GetContentInfo(BackupAndRestoreType type = BackupAndRestoreType::CONTINUATION) = 0;
258e0dac50fSopenharmony_ci    virtual Ace::UIContent* GetUIContent() const = 0;
259e0dac50fSopenharmony_ci    virtual void OnNewWant(const AAFwk::Want& want) = 0;
260e0dac50fSopenharmony_ci    virtual void SetRequestedOrientation(Orientation) = 0;
261e0dac50fSopenharmony_ci    virtual Orientation GetRequestedOrientation() = 0;
262e0dac50fSopenharmony_ci    virtual void SetRequestModeSupportInfo(uint32_t modeSupportInfo) = 0;
263e0dac50fSopenharmony_ci    virtual uint32_t GetRequestModeSupportInfo() const = 0;
264e0dac50fSopenharmony_ci    virtual WMError SetTouchHotAreas(const std::vector<Rect>& rects) = 0;
265e0dac50fSopenharmony_ci    virtual void GetRequestedTouchHotAreas(std::vector<Rect>& rects) const = 0;
266e0dac50fSopenharmony_ci    virtual bool IsMainHandlerAvailable() const = 0;
267e0dac50fSopenharmony_ci    virtual WMError SetAPPWindowLabel(const std::string& label) = 0;
268e0dac50fSopenharmony_ci    virtual WMError SetAPPWindowIcon(const std::shared_ptr<Media::PixelMap>& icon) = 0;
269e0dac50fSopenharmony_ci    virtual WMError DisableAppWindowDecor() = 0;
270e0dac50fSopenharmony_ci    virtual WMError Minimize() = 0;
271e0dac50fSopenharmony_ci    virtual WMError Maximize() = 0;
272e0dac50fSopenharmony_ci    virtual WMError Recover() = 0;
273e0dac50fSopenharmony_ci    virtual WMError Restore() { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
274e0dac50fSopenharmony_ci    virtual void StartMove() = 0;
275e0dac50fSopenharmony_ci    virtual WmErrorCode StartMoveSystemWindow() { return WmErrorCode::WM_OK; };
276e0dac50fSopenharmony_ci    virtual WMError Close() = 0;
277e0dac50fSopenharmony_ci    virtual void SetNeedRemoveWindowInputChannel(bool needRemoveWindowInputChannel) = 0;
278e0dac50fSopenharmony_ci    virtual bool IsSupportWideGamut() = 0;
279e0dac50fSopenharmony_ci    virtual void SetColorSpace(ColorSpace colorSpace) = 0;
280e0dac50fSopenharmony_ci    virtual ColorSpace GetColorSpace() = 0;
281e0dac50fSopenharmony_ci    virtual void DumpInfo(const std::vector<std::string>& params, std::vector<std::string>& info) = 0;
282e0dac50fSopenharmony_ci    virtual std::shared_ptr<Media::PixelMap> Snapshot() = 0;
283e0dac50fSopenharmony_ci    virtual WMError NotifyMemoryLevel(int32_t level) = 0;
284e0dac50fSopenharmony_ci    virtual bool IsAllowHaveSystemSubWindow() = 0;
285e0dac50fSopenharmony_ci    virtual WMError SetAspectRatio(float ratio) = 0;
286e0dac50fSopenharmony_ci    virtual WMError ResetAspectRatio() = 0;
287e0dac50fSopenharmony_ci    virtual KeyboardAnimationConfig GetKeyboardAnimationConfig() = 0;
288e0dac50fSopenharmony_ci    virtual void SetNeedDefaultAnimation(bool needDefaultAnimation) = 0;
289e0dac50fSopenharmony_ci
290e0dac50fSopenharmony_ci    virtual void SetViewportConfig(const Ace::ViewportConfig& config) = 0;
291e0dac50fSopenharmony_ci    virtual void UpdateViewportConfig() = 0;
292e0dac50fSopenharmony_ci    virtual void SetOrientation(Orientation orientation) = 0;
293e0dac50fSopenharmony_ci    virtual void SetSize(int32_t width, int32_t height) = 0;
294e0dac50fSopenharmony_ci    virtual void SetDensity(float density) = 0;
295e0dac50fSopenharmony_ci    virtual WMError SetDefaultDensityEnabled(bool enabled) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
296e0dac50fSopenharmony_ci    virtual bool GetDefaultDensityEnabled() { return false; }
297e0dac50fSopenharmony_ci    virtual float GetVirtualPixelRatio() { return 0.0f; }
298e0dac50fSopenharmony_ci    virtual void UpdateAvoidArea(const sptr<AvoidArea>& avoidArea, AvoidAreaType type);
299e0dac50fSopenharmony_ci    virtual void CreateSurfaceNode(const std::string name, const SendRenderDataCallback& callback) = 0;
300e0dac50fSopenharmony_ci    virtual void SetContentInfoCallback(const ContentInfoCallback& callback) = 0;
301e0dac50fSopenharmony_ci    virtual WMError SetResizeByDragEnabled(bool dragEnabled) = 0;
302e0dac50fSopenharmony_ci    virtual WMError SetRaiseByClickEnabled(bool raiseEnabled) = 0;
303e0dac50fSopenharmony_ci    virtual WMError RaiseAboveTarget(int32_t subWindowId) = 0;
304e0dac50fSopenharmony_ci    virtual WMError SetTopmost(bool topmost) { return WMError::WM_OK; }
305e0dac50fSopenharmony_ci    virtual bool IsTopmost() const { return false; }
306e0dac50fSopenharmony_ci    virtual WMError SetMainWindowTopmost(bool isTopmost) { return WMError::WM_OK; }
307e0dac50fSopenharmony_ci    virtual bool IsMainWindowTopmost() const { return false; }
308e0dac50fSopenharmony_ci    virtual WMError HideNonSystemFloatingWindows(bool shouldHide) = 0;
309e0dac50fSopenharmony_ci    virtual bool IsFloatingWindowAppType() const { return false; }
310e0dac50fSopenharmony_ci    virtual bool IsPcOrPadCapabilityEnabled() const { return false; }
311e0dac50fSopenharmony_ci    virtual bool IsPcOrPadFreeMultiWindowMode() const { return false; }
312e0dac50fSopenharmony_ci    virtual WmErrorCode KeepKeyboardOnFocus(bool keepKeyboardFlag) = 0;
313e0dac50fSopenharmony_ci    virtual WMError RegisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr& listener) = 0;
314e0dac50fSopenharmony_ci    virtual WMError UnregisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr& listener) = 0;
315e0dac50fSopenharmony_ci    virtual WMError SetWindowLimits(WindowLimits& windowLimits) { return WMError::WM_OK; };
316e0dac50fSopenharmony_ci    virtual WMError GetWindowLimits(WindowLimits& windowLimits) { return WMError::WM_OK; };
317e0dac50fSopenharmony_ci    virtual WMError EnableDrag(bool enableDrag) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; };
318e0dac50fSopenharmony_ci    virtual WMError RegisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr& listener)
319e0dac50fSopenharmony_ci    {
320e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
321e0dac50fSopenharmony_ci    }
322e0dac50fSopenharmony_ci    virtual WMError UnregisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr& listener)
323e0dac50fSopenharmony_ci    {
324e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
325e0dac50fSopenharmony_ci    }
326e0dac50fSopenharmony_ci    virtual WMError SetSingleFrameComposerEnabled(bool enable) = 0;
327e0dac50fSopenharmony_ci    virtual WMError SetLandscapeMultiWindow(bool isLandscapeMultiWindow) = 0;
328e0dac50fSopenharmony_ci    virtual WMError SetDecorVisible(bool isVisible) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
329e0dac50fSopenharmony_ci    virtual WMError SetTitleButtonVisible(bool isMaximizeVisible, bool isMinimizeVisible, bool isSplitVisible,
330e0dac50fSopenharmony_ci        bool isCloseVisible)
331e0dac50fSopenharmony_ci    {
332e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
333e0dac50fSopenharmony_ci    }
334e0dac50fSopenharmony_ci    virtual WMError SetDecorHeight(int32_t decorHeight) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
335e0dac50fSopenharmony_ci    virtual WMError GetDecorHeight(int32_t& height) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
336e0dac50fSopenharmony_ci    virtual WMError GetTitleButtonArea(TitleButtonRect& titleButtonRect)
337e0dac50fSopenharmony_ci    {
338e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
339e0dac50fSopenharmony_ci    }
340e0dac50fSopenharmony_ci    virtual WMError SetWindowContainerColor(const std::string& activeColor, const std::string& inactiveColor)
341e0dac50fSopenharmony_ci    {
342e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
343e0dac50fSopenharmony_ci    }
344e0dac50fSopenharmony_ci    virtual WMError RegisterWindowTitleButtonRectChangeListener(
345e0dac50fSopenharmony_ci        const sptr<IWindowTitleButtonRectChangedListener>& listener)
346e0dac50fSopenharmony_ci    {
347e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
348e0dac50fSopenharmony_ci    }
349e0dac50fSopenharmony_ci    virtual WMError UnregisterWindowTitleButtonRectChangeListener(
350e0dac50fSopenharmony_ci        const sptr<IWindowTitleButtonRectChangedListener>& listener)
351e0dac50fSopenharmony_ci    {
352e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
353e0dac50fSopenharmony_ci    }
354e0dac50fSopenharmony_ci    /**
355e0dac50fSopenharmony_ci     * @brief Set the modality of window.
356e0dac50fSopenharmony_ci     *
357e0dac50fSopenharmony_ci     * @param isModal bool.
358e0dac50fSopenharmony_ci     * @param modalityType ModalityType.
359e0dac50fSopenharmony_ci     * @return WMError
360e0dac50fSopenharmony_ci     */
361e0dac50fSopenharmony_ci    virtual WMError SetSubWindowModal(bool isModal, ModalityType modalityType = ModalityType::WINDOW_MODALITY)
362e0dac50fSopenharmony_ci    {
363e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
364e0dac50fSopenharmony_ci    }
365e0dac50fSopenharmony_ci    virtual WMError Recover(uint32_t reason = 0) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; };
366e0dac50fSopenharmony_ci
367e0dac50fSopenharmony_ci    virtual WMError Maximize(MaximizePresentation present) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
368e0dac50fSopenharmony_ci
369e0dac50fSopenharmony_ci    virtual WMError SetWindowMask(const std::vector<std::vector<uint32_t>>& windowMask)
370e0dac50fSopenharmony_ci    {
371e0dac50fSopenharmony_ci        return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
372e0dac50fSopenharmony_ci    }
373e0dac50fSopenharmony_ci
374e0dac50fSopenharmony_ci    virtual WMError SetGrayScale(float grayScale) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
375e0dac50fSopenharmony_ci
376e0dac50fSopenharmony_ci    /**
377e0dac50fSopenharmony_ci     * @brief Set the Dvsync object
378e0dac50fSopenharmony_ci     *
379e0dac50fSopenharmony_ci     * @param dvsyncSwitch bool.
380e0dac50fSopenharmony_ci     * @return * void
381e0dac50fSopenharmony_ci     */
382e0dac50fSopenharmony_ci    virtual void SetUiDvsyncSwitch(bool dvsyncSwitch) {}
383e0dac50fSopenharmony_ci
384e0dac50fSopenharmony_ci    virtual WMError SetImmersiveModeEnabledState(bool enable) { return WMError::WM_OK; }
385e0dac50fSopenharmony_ci
386e0dac50fSopenharmony_ci    virtual bool GetImmersiveModeEnabledState() const { return true; }
387e0dac50fSopenharmony_ci
388e0dac50fSopenharmony_ci    virtual WMError GetWindowStatus(WindowStatus& windowStatus) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
389e0dac50fSopenharmony_ci
390e0dac50fSopenharmony_ci    virtual void NotifyExtensionTimeout(int32_t errorCode) {}
391e0dac50fSopenharmony_ci
392e0dac50fSopenharmony_ci    /**
393e0dac50fSopenharmony_ci     * @brief Set whether to enable gesture back.
394e0dac50fSopenharmony_ci     * @param enable the value true means to enable gesture back, and false means the opposite.
395e0dac50fSopenharmony_ci     * @return WM_OK means set success, others means set failed.
396e0dac50fSopenharmony_ci     */
397e0dac50fSopenharmony_ci    virtual WMError SetGestureBackEnabled(bool enable) { return WMError::WM_OK; }
398e0dac50fSopenharmony_ci
399e0dac50fSopenharmony_ci    /**
400e0dac50fSopenharmony_ci     * @brief Get whether the gesture back is enabled or not.
401e0dac50fSopenharmony_ci     *
402e0dac50fSopenharmony_ci     * @return the value true means to enable gesture back, and false means the opposite.
403e0dac50fSopenharmony_ci     */
404e0dac50fSopenharmony_ci    virtual bool GetGestureBackEnabled() const { return true; }
405e0dac50fSopenharmony_ci};
406e0dac50fSopenharmony_ci}
407e0dac50fSopenharmony_ci}
408e0dac50fSopenharmony_ci#endif // OHOS_ROSEN_WINDOW_H
409