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