• 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 enum class SupportWindowMode;
40 }
41 
42 namespace OHOS::Global::Resource {
43 class ResourceManager;
44 } // namespace OHOS::Global::Resource
45 
46 namespace OHOS::AbilityRuntime {
47 class AbilityContext;
48 class Context;
49 }
50 
51 namespace OHOS::Ace {
52 class UIContent;
53 class ViewportConfig;
54 }
55 
56 namespace OHOS::AAFwk {
57 class Want;
58 }
59 
60 namespace OHOS {
61 namespace Rosen {
62 class RSSurfaceNode;
63 class RSTransaction;
64 class RSUIContext;
65 class RSUIDirector;
66 using NotifyNativeWinDestroyFunc = std::function<void(std::string windowName)>;
67 using SendRenderDataCallback = bool (*)(const void*, const size_t, const int32_t, const int32_t, const uint64_t);
68 using ContentInfoCallback = std::function<void(std::string contentInfo)>;
69 enum class ImageFit;
70 
71 class IWindowLifeCycle : virtual public RefBase {
72 };
73 class IWindowChangeListener : virtual public RefBase {
74 };
75 class IWindowSystemBarEnableListener : virtual public RefBase {
76 public:
77     virtual WMError OnSetSpecificBarProperty(WindowType type, const SystemBarProperty& property) = 0;
78 };
79 class IIgnoreViewSafeAreaListener : virtual public RefBase {
80 public:
81     virtual void SetIgnoreViewSafeArea(bool ignoreViewSafeArea) = 0;
82 };
83 class IAvoidAreaChangedListener : virtual public RefBase {
84 public:
OnAvoidAreaChanged(const AvoidArea avoidArea,AvoidAreaType type)85     virtual void OnAvoidAreaChanged(const AvoidArea avoidArea, AvoidAreaType type) {}
86 };
87 class IWindowDragListener : virtual public RefBase {
88 };
89 class IDisplayMoveListener : virtual public RefBase {
90 };
91 class IDispatchInputEventListener : virtual public RefBase {
92 };
93 class OccupiedAreaChangeInfo : public Parcelable {
94 public:
95     virtual bool Marshalling(Parcel& parcel) const override;
96     static OccupiedAreaChangeInfo* Unmarshalling(Parcel& parcel);
97 };
98 class IOccupiedAreaChangeListener : virtual public RefBase {
99 };
100 class IAceAbilityHandler : virtual public RefBase {
101 };
102 class IInputEventConsumer {
103 };
104 class ITouchOutsideListener : virtual public RefBase {
105 };
106 class IAnimationTransitionController : virtual public RefBase {
107 public:
108     virtual void AnimationForShown() = 0;
109     virtual void AnimationForHidden() = 0;
110 };
111 class ISystemBarPropertyListener : virtual public RefBase {
112 public:
OnSystemBarPropertyUpdate(WindowType type,const SystemBarProperty & property)113     virtual void OnSystemBarPropertyUpdate(WindowType type, const SystemBarProperty& property) {}
114 };
115 class IScreenshotListener : virtual public RefBase {
116 };
117 class IScreenshotAppEventListener : virtual public RefBase {
118 };
119 class IDialogTargetTouchListener : virtual public RefBase {
120 };
121 class IDialogDeathRecipientListener : virtual public RefBase {
122 };
123 class IWindowTitleButtonRectChangedListener : virtual public RefBase {
124 };
125 class IWindowVisibilityChangedListener : virtual public RefBase {
126 };
127 
128 using WindowVisibilityListenerSptr = sptr<IWindowVisibilityChangedListener>;
129 
130 class IWindowNoInteractionListener : virtual public RefBase {
131 };
132 using IWindowNoInteractionListenerSptr = sptr<IWindowNoInteractionListener>;
133 
134 static WMError DefaultCreateErrCode = WMError::WM_OK;
135 class WINDOW_EXPORT Window : public RefBase {
136 public:
137     static sptr<Window> Create(const std::string& windowName,
138     sptr<WindowOption>& option, const std::shared_ptr<AbilityRuntime::Context>& context = nullptr,
139     WMError& errCode = DefaultCreateErrCode);
140     static sptr<Window> Find(const std::string& windowName);
141     static sptr<Window> GetTopWindowWithContext(const std::shared_ptr<AbilityRuntime::Context>& context = nullptr);
142     static sptr<Window> GetTopWindowWithId(uint32_t mainWinId);
143     static std::vector<sptr<Window>> GetSubWindow(uint32_t parentId);
144     static void UpdateConfigurationForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration,
145        const std::vector<std::shared_ptr<AbilityRuntime::Context>>& ignoreWindowContexts = {});
146     static void UpdateConfigurationSyncForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration);
147     virtual std::shared_ptr<RSSurfaceNode> GetSurfaceNode() const = 0;
148 
149     /**
150      * @brief Get the associated RSUIDirector instance
151      *
152      * @return std::shared_ptr<RSUIDirector> Shared pointer to the RSUIDirector instance,
153      *         or nullptr if RS client multi-instance is disabled.
154      */
GetRSUIDirector()155     virtual std::shared_ptr<RSUIDirector> GetRSUIDirector() const { return nullptr; }
156 
157     /**
158      * @brief Get the associated RSUIContext instance
159      *
160      * @return std::shared_ptr<RSUIContext> Shared pointer to the RSUIContext instance,
161      *         or nullptr if RS client multi-instance is disabled.
162      */
GetRSUIContext()163     virtual std::shared_ptr<RSUIContext> GetRSUIContext() const { return nullptr; }
164 
165     virtual const std::shared_ptr<AbilityRuntime::Context> GetContext() const = 0;
166     virtual Rect GetRect() const = 0;
167     virtual Rect GetRequestRect() const = 0;
168 
169     /**
170      * @brief Get the window rectangle in global coordinates.
171      *
172      * @return The rectangle (position and size) of the window in global coordinates.
173      */
GetGlobalDisplayRect()174     virtual Rect GetGlobalDisplayRect() const { return { 0, 0, 0, 0 }; }
175 
176     /**
177      * @brief Convert a position from client (window-relative) coordinates to global coordinates.
178      *
179      * @param inPosition The position relative to the window.
180      * @param outPosition [out] The corresponding position in global coordinates.
181      * @return WMError::WM_OK on success, or appropriate error code on failure.
182      */
ClientToGlobalDisplay(const Position & inPosition,Position & outPosition)183     virtual WMError ClientToGlobalDisplay(const Position& inPosition, Position& outPosition) const
184     {
185         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
186     }
187 
188     /**
189      * @brief Convert a position from global coordinates to client (window-relative) coordinates.
190      *
191      * @param inPosition The position in global coordinates.
192      * @param outPosition [out] The corresponding position relative to the window.
193      * @return WMError::WM_OK on success, or appropriate error code on failure.
194      */
GlobalDisplayToClient(const Position & inPosition,Position & outPosition)195     virtual WMError GlobalDisplayToClient(const Position& inPosition, Position& outPosition) const
196     {
197         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
198     }
199 
200     virtual WindowType GetType() const = 0;
201     virtual WindowMode GetWindowMode() const = 0;
202     virtual float GetAlpha() const = 0;
203     virtual const std::string& GetWindowName() const = 0;
204     virtual uint32_t GetWindowId() const = 0;
205     virtual uint64_t GetDisplayId() const = 0;
206     virtual uint32_t GetWindowFlags() const = 0;
207     virtual WindowState GetWindowState() const = 0;
208     virtual WMError SetFocusable(bool isFocusable) = 0;
209     virtual bool GetFocusable() const = 0;
210     virtual WMError SetTouchable(bool isTouchable) = 0;
211     virtual SystemBarProperty GetSystemBarPropertyByType(WindowType type) const = 0;
212     virtual bool GetTouchable() const = 0;
213     virtual bool IsLayoutFullScreen() const = 0;
214     virtual bool IsFullScreen() const = 0;
215     virtual WMError SetWindowMode(WindowMode mode) = 0;
216     virtual WMError SetWindowType(WindowType type) = 0;
SetFollowScreenChange(bool isFollowScreenChange)217     virtual WMError SetFollowScreenChange(bool isFollowScreenChange) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
218     virtual WMError SetAlpha(float alpha) = 0;
219     virtual WMError SetTransform(const Transform& trans) = 0;
220     virtual const Transform& GetTransform() const = 0;
221     virtual WMError RemoveWindowFlag(WindowFlag flag) = 0;
222     virtual WMError AddWindowFlag(WindowFlag flag) = 0;
223     virtual WMError SetWindowFlags(uint32_t flags) = 0;
IsWindowRectAutoSave(bool & enabled)224     virtual WMError IsWindowRectAutoSave(bool& enabled) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
225     virtual WMError GetAvoidAreaByType(AvoidAreaType type, AvoidArea& avoidArea) = 0;
SetAvoidAreaOption(uint32_t avoidAreaOption)226     virtual WMError SetAvoidAreaOption(uint32_t avoidAreaOption) { return WMError::WM_OK; }
GetAvoidAreaOption(uint32_t & avoidAreaOption)227     virtual WMError GetAvoidAreaOption(uint32_t& avoidAreaOption) { return WMError::WM_OK; }
UpdateSystemBarProperties(const std::unordered_map<WindowType,SystemBarProperty> & systemBarProperties,const std::unordered_map<WindowType,SystemBarPropertyFlag> & systemBarPropertyFlags)228     virtual WMError UpdateSystemBarProperties(
229         const std::unordered_map<WindowType, SystemBarProperty>& systemBarProperties,
230         const std::unordered_map<WindowType, SystemBarPropertyFlag>& systemBarPropertyFlags)
231         { return WMError::WM_OK; }
UpdateSpecificSystemBarEnabled(bool systemBarEnable,bool systemBarEnableAnimation,SystemBarProperty & property)232     virtual void UpdateSpecificSystemBarEnabled(bool systemBarEnable, bool systemBarEnableAnimation,
233         SystemBarProperty& property) {}
234     virtual WMError SetSystemBarProperty(WindowType type, const SystemBarProperty& property) = 0;
235     virtual WMError SetSpecificBarProperty(WindowType type, const SystemBarProperty& property) = 0;
236     virtual WMError SetSystemBarProperties(const std::map<WindowType, SystemBarProperty>& properties,
237         const std::map<WindowType, SystemBarPropertyFlag>& propertyFlags) = 0;
238     virtual WMError GetSystemBarProperties(std::map<WindowType, SystemBarProperty>& properties) = 0;
239     virtual WMError SetFullScreen(bool status) = 0;
240     virtual WMError SetLayoutFullScreen(bool status) = 0;
SetIgnoreSafeArea(bool isIgnoreSafeArea)241     virtual WMError SetIgnoreSafeArea(bool isIgnoreSafeArea) { return WMError::WM_OK; }
242     virtual WMError SetTitleAndDockHoverShown(bool titleHoverShowEnabled = true,
243         bool dockHoverShowEnabled = true) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
244     virtual WMError Destroy() = 0;
SetShowWithOptions(bool showWithOptions)245     virtual void SetShowWithOptions(bool showWithOptions) {}
IsShowWithOptions()246     virtual bool IsShowWithOptions() const { return false; }
247     virtual WMError Show(uint32_t reason = 0, bool withAnimation = false, bool withFocus = true) = 0;
248     virtual WMError Show(uint32_t reason, bool withAnimation, bool withFocus, bool waitAttach) = 0;
249     virtual WMError Hide(uint32_t reason = 0, bool withAnimation = false, bool isFromInnerkits = true) = 0;
250     virtual WMError Hide(uint32_t reason, bool withAnimation, bool isFromInnerkits, bool waitDetach) = 0;
251     virtual WMError MoveTo(int32_t x, int32_t y, bool isMoveToGlobal = false,
252         MoveConfiguration moveConfiguration = {}) = 0;
253     virtual WMError MoveToAsync(int32_t x, int32_t y,
254         MoveConfiguration moveConfiguration = {}) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
MoveWindowToGlobal(int32_t x,int32_t y,MoveConfiguration moveConfiguration)255     virtual WMError MoveWindowToGlobal(int32_t x, int32_t y,
256         MoveConfiguration moveConfiguration) { return WMError::WM_OK; }
257 
258     /**
259      * @brief Move the window to the specified position in global coordinates.
260      *
261      * @param x The target X-coordinate in global coordinates.
262      * @param y The target Y-coordinate in global coordinates.
263      * @param moveConfiguration Optional move configuration parameters.
264      * @return WMError WM_OK if the move operation succeeds; otherwise, an error code is returned.
265      */
266     virtual WMError MoveWindowToGlobalDisplay(int32_t x, int32_t y, MoveConfiguration moveConfiguration = {})
267     {
268         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
269     }
270 
GetGlobalScaledRect(Rect & globalScaledRect)271     virtual WMError GetGlobalScaledRect(Rect& globalScaledRect) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
272     virtual WMError Resize(uint32_t width, uint32_t height, const RectAnimationConfig& rectAnimationConfig = {}) = 0;
273     virtual WMError ResizeAsync(uint32_t width, uint32_t height,
274         const RectAnimationConfig& rectAnimationConfig = {}) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
275     virtual WMError SetWindowGravity(WindowGravity gravity, uint32_t percent) = 0;
276     virtual WMError SetKeepScreenOn(bool keepScreenOn) = 0;
277     virtual bool IsKeepScreenOn() const = 0;
278     virtual WMError SetTurnScreenOn(bool turnScreenOn) = 0;
279     virtual bool IsTurnScreenOn() const = 0;
280     virtual WMError SetBackgroundColor(const std::string& color) = 0;
281     virtual WMError SetTransparent(bool isTransparent) = 0;
282     virtual bool IsTransparent() const = 0;
283     virtual WMError SetBrightness(float brightness) = 0;
284     virtual float GetBrightness() const = 0;
285     virtual WMError SetCallingWindow(uint32_t windowId) = 0;
286     virtual WMError SetPrivacyMode(bool isPrivacyMode) = 0;
287     virtual bool IsPrivacyMode() const = 0;
288     virtual void SetSystemPrivacyMode(bool isSystemPrivacyMode) = 0;
289     virtual WMError BindDialogTarget(sptr<IRemoteObject> targetToken) = 0;
290     virtual WMError SetDialogBackGestureEnabled(bool isEnabled) = 0;
291     virtual WMError RaiseToAppTop() = 0;
292     virtual WMError SetSnapshotSkip(bool isSkip) = 0;
293     virtual WMError SetCornerRadius(float cornerRadius) = 0;
SetWindowCornerRadius(float radius)294     virtual WMError SetWindowCornerRadius(float radius) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetWindowCornerRadius(float & radius)295     virtual WMError GetWindowCornerRadius(float& radius) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
296     virtual WMError SetShadowRadius(float radius) = 0;
SetWindowShadowRadius(float radius)297     virtual WMError SetWindowShadowRadius(float radius) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
298     virtual WMError SetShadowColor(std::string color) = 0;
299     virtual WMError SetShadowOffsetX(float offsetX) = 0;
300     virtual WMError SetShadowOffsetY(float offsetY) = 0;
SyncShadowsToComponent(const ShadowsInfo & shadowsInfo)301     virtual WMError SyncShadowsToComponent(const ShadowsInfo& shadowsInfo)
302     {
303         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
304     }
305     virtual WMError SetBlur(float radius) = 0;
306     virtual WMError SetBackdropBlur(float radius) = 0;
307     virtual WMError SetBackdropBlurStyle(WindowBlurStyle blurStyle) = 0;
308     virtual WMError RequestFocus() const = 0;
RequestFocusByClient(bool isFocused)309     virtual WMError RequestFocusByClient(bool isFocused) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
310     virtual bool IsFocused() const = 0;
311     virtual WMError UpdateSurfaceNodeAfterCustomAnimation(bool isAdd) = 0;
312     virtual void SetInputEventConsumer(const std::shared_ptr<IInputEventConsumer>& inputEventConsumer) = 0;
313     virtual void ConsumeKeyEvent(const std::shared_ptr<MMI::KeyEvent>& inputEvent) = 0;
ConsumeBackEvent()314     virtual void ConsumeBackEvent() {}
315     virtual void ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent>& inputEvent) = 0;
IsDialogSessionBackGestureEnabled()316     virtual bool IsDialogSessionBackGestureEnabled() { return false; }
317     virtual void RequestVsync(const std::shared_ptr<VsyncCallback>& vsyncCallback) = 0;
318     virtual int64_t GetVSyncPeriod() = 0;
FlushFrameRate(uint32_t rate,int32_t animatorExpectedFrameRate,uint32_t rateType)319     virtual void FlushFrameRate(uint32_t rate, int32_t animatorExpectedFrameRate, uint32_t rateType) {}
320     virtual void UpdateConfiguration(const std::shared_ptr<AppExecFwk::Configuration>& configuration) = 0;
321     virtual void UpdateConfigurationForSpecified(const std::shared_ptr<AppExecFwk::Configuration>& configuration,
322         const std::shared_ptr<Global::Resource::ResourceManager>& resourceManager) = 0;
323     virtual void UpdateConfigurationSync(const std::shared_ptr<AppExecFwk::Configuration>& configuration) = 0;
324     virtual WMError RegisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener) = 0;
325     virtual WMError UnregisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener) = 0;
326     virtual WMError RegisterWindowChangeListener(const sptr<IWindowChangeListener>& listener) = 0;
327     virtual WMError UnregisterWindowChangeListener(const sptr<IWindowChangeListener>& listener) = 0;
328     virtual WMError RegisterAvoidAreaChangeListener(const sptr<IAvoidAreaChangedListener>& listener) = 0;
329     virtual WMError UnregisterAvoidAreaChangeListener(const sptr<IAvoidAreaChangedListener>& listener) = 0;
330     virtual WMError RegisterDragListener(const sptr<IWindowDragListener>& listener) = 0;
331     virtual WMError UnregisterDragListener(const sptr<IWindowDragListener>& listener) = 0;
332     virtual WMError RegisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener) = 0;
333     virtual WMError UnregisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener) = 0;
334     virtual void RegisterWindowDestroyedListener(const NotifyNativeWinDestroyFunc& func) = 0;
UnregisterWindowDestroyedListener()335     virtual void UnregisterWindowDestroyedListener() {}
336     virtual WMError RegisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener) = 0;
337     virtual WMError UnregisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener) = 0;
338     virtual WMError RegisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener) = 0;
339     virtual WMError UnregisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener) = 0;
340     virtual WMError RegisterAnimationTransitionController(const sptr<IAnimationTransitionController>& listener) = 0;
341     virtual WMError RegisterScreenshotListener(const sptr<IScreenshotListener>& listener) = 0;
342     virtual WMError UnregisterScreenshotListener(const sptr<IScreenshotListener>& listener) = 0;
RegisterScreenshotAppEventListener(const sptr<IScreenshotAppEventListener> & listener)343     virtual WMError RegisterScreenshotAppEventListener(
344         const sptr<IScreenshotAppEventListener>& listener) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; };
UnregisterScreenshotAppEventListener(const sptr<IScreenshotAppEventListener> & listener)345     virtual WMError UnregisterScreenshotAppEventListener(
346         const sptr<IScreenshotAppEventListener>& listener) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; };
347     virtual WMError RegisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener) = 0;
348     virtual WMError UnregisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener) = 0;
349     virtual void RegisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener) = 0;
350     virtual void UnregisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener) = 0;
351     virtual WMError RegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener>& listener) = 0;
352     virtual WMError UnRegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener>& listener) = 0;
353     virtual WMError RegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener>& listener) = 0;
354     virtual WMError UnRegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener>& listener) = 0;
355     virtual void NotifyTouchDialogTarget(int32_t posX = 0, int32_t posY = 0) = 0;
356     virtual void SetAceAbilityHandler(const sptr<IAceAbilityHandler>& handler) = 0;
357     virtual WMError NapiSetUIContent(const std::string& contentInfo, napi_env env, napi_value storage,
358         BackupAndRestoreType type = BackupAndRestoreType::NONE, sptr<IRemoteObject> token = nullptr,
359         AppExecFwk::Ability* ability = nullptr) = 0;
360     virtual WMError NapiSetUIContentByName(const std::string& contentName, napi_env env, napi_value storage,
361         BackupAndRestoreType type = BackupAndRestoreType::NONE, sptr<IRemoteObject> token = nullptr,
362         AppExecFwk::Ability* ability = nullptr) { return WMError::WM_OK; }
363     virtual WMError SetUIContentByName(const std::string& contentInfo, napi_env env, napi_value storage,
364         AppExecFwk::Ability* ability = nullptr)
365     {
366         return WMError::WM_OK;
367     }
368     virtual WMError SetUIContentByAbc(const std::string& abcPath, napi_env env, napi_value storage,
369         AppExecFwk::Ability* ability = nullptr)
370     {
371         return WMError::WM_OK;
372     }
373     virtual std::string GetContentInfo(BackupAndRestoreType type = BackupAndRestoreType::CONTINUATION) = 0;
374     virtual Ace::UIContent* GetUIContent() const = 0;
375     virtual void OnNewWant(const AAFwk::Want& want) = 0;
376     virtual void SetRequestedOrientation(Orientation) = 0;
377     virtual void NotifyPreferredOrientationChange(Orientation orientation) = 0;
378     virtual void SetUserRequestedOrientation(Orientation orientation) = 0;
379     virtual Orientation GetRequestedOrientation() = 0;
380     virtual void SetRequestWindowModeSupportType(uint32_t windowModeSupportType) = 0;
381     virtual uint32_t GetRequestWindowModeSupportType() const = 0;
382     virtual WMError SetTouchHotAreas(const std::vector<Rect>& rects) = 0;
383     virtual void GetRequestedTouchHotAreas(std::vector<Rect>& rects) const = 0;
384     virtual bool IsMainHandlerAvailable() const = 0;
385     virtual WMError SetAPPWindowLabel(const std::string& label) = 0;
386     virtual WMError SetAPPWindowIcon(const std::shared_ptr<Media::PixelMap>& icon) = 0;
387     virtual WMError DisableAppWindowDecor() = 0;
388     virtual WMError Minimize() = 0;
389     virtual WMError Maximize() = 0;
390     virtual WMError Recover() = 0;
Restore()391     virtual WMError Restore() { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
392     virtual WMError SetWindowRectAutoSave(bool enabled,
393         bool isSaveBySpecifiedFlag = false) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
394     virtual WMError SetSupportedWindowModes(const std::vector<AppExecFwk::SupportWindowMode>& supportedWindowModes,
395         bool grayOutMaximizeButton = false)
396     {
397         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
398     }
SetImageForRecent(uint32_t imgResourceId,OHOS::Rosen::ImageFit ImageFit)399     virtual WMError SetImageForRecent(uint32_t imgResourceId, OHOS::Rosen::ImageFit ImageFit)
400     {
401         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
402     }
SetFollowParentMultiScreenPolicy(bool enabled)403     virtual WMError SetFollowParentMultiScreenPolicy(bool enabled) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
404     virtual void StartMove() = 0;
StartMoveWindow()405     virtual WmErrorCode StartMoveWindow() { return WmErrorCode::WM_OK; }
StartMoveWindowWithCoordinate(int32_t offsetX,int32_t offsetY)406     virtual WmErrorCode StartMoveWindowWithCoordinate(int32_t offsetX,
407         int32_t offsetY) { return WmErrorCode::WM_OK; }
StopMoveWindow()408     virtual WmErrorCode StopMoveWindow() { return WmErrorCode::WM_OK; }
409     virtual WMError Close() = 0;
410     virtual void SetNeedRemoveWindowInputChannel(bool needRemoveWindowInputChannel) = 0;
411     virtual bool IsSupportWideGamut() = 0;
412     virtual void SetColorSpace(ColorSpace colorSpace) = 0;
413     virtual ColorSpace GetColorSpace() = 0;
414     virtual void DumpInfo(const std::vector<std::string>& params, std::vector<std::string>& info) = 0;
415     virtual std::shared_ptr<Media::PixelMap> Snapshot() = 0;
Snapshot(std::shared_ptr<Media::PixelMap> & pixelMap)416     virtual WMError Snapshot(
417         std::shared_ptr<Media::PixelMap>& pixelMap) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
418     virtual WMError SnapshotIgnorePrivacy(std::shared_ptr<Media::PixelMap>& pixelMap) = 0;
419     virtual WMError NotifyMemoryLevel(int32_t level) = 0;
420     virtual bool IsAllowHaveSystemSubWindow() = 0;
421     virtual WMError SetAspectRatio(float ratio) = 0;
422     virtual WMError ResetAspectRatio() = 0;
423     virtual KeyboardAnimationConfig GetKeyboardAnimationConfig() = 0;
424     virtual void SetNeedDefaultAnimation(bool needDefaultAnimation) = 0;
425 
426     virtual void SetViewportConfig(const Ace::ViewportConfig& config) = 0;
427     virtual void UpdateViewportConfig() = 0;
428     virtual void SetOrientation(Orientation orientation) = 0;
429     virtual void SetSize(int32_t width, int32_t height) = 0;
430     virtual void SetDensity(float density) = 0;
SetDefaultDensityEnabled(bool enabled)431     virtual WMError SetDefaultDensityEnabled(bool enabled) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetDefaultDensityEnabled()432     virtual bool GetDefaultDensityEnabled() { return false; }
SetCustomDensity(float density,bool applyToSubWindow)433     virtual WMError SetCustomDensity(
434         float density, bool applyToSubWindow) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetCustomDensity()435     virtual float GetCustomDensity() const { return UNDEFINED_DENSITY; }
SetWindowShadowEnabled(bool isEnabled)436     virtual WMError SetWindowShadowEnabled(bool isEnabled) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetWindowShadowEnabled()437     virtual bool GetWindowShadowEnabled() const { return true; }
SetWindowDefaultDensityEnabled(bool enabled)438     virtual WMError SetWindowDefaultDensityEnabled(bool enabled) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetWindowDensityInfo(WindowDensityInfo & densityInfo)439     virtual WMError GetWindowDensityInfo(
440         WindowDensityInfo& densityInfo) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
IsMainWindowFullScreenAcrossDisplays(bool & isAcrossDisplays)441     virtual WMError IsMainWindowFullScreenAcrossDisplays(
442         bool& isAcrossDisplays) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetVirtualPixelRatio()443     virtual float GetVirtualPixelRatio() { return 1.0f; }
444     virtual void UpdateAvoidArea(const sptr<AvoidArea>& avoidArea, AvoidAreaType type);
445     virtual void CreateSurfaceNode(const std::string name, const SendRenderDataCallback& callback) = 0;
446     virtual void SetContentInfoCallback(const ContentInfoCallback& callback) = 0;
447     virtual WMError SetResizeByDragEnabled(bool dragEnabled) = 0;
448     virtual WMError SetRaiseByClickEnabled(bool raiseEnabled) = 0;
449     virtual WMError RaiseAboveTarget(int32_t subWindowId) = 0;
SetTopmost(bool topmost)450     virtual WMError SetTopmost(bool topmost) { return WMError::WM_OK; }
IsTopmost()451     virtual bool IsTopmost() const { return false; }
SetMainWindowTopmost(bool isTopmost)452     virtual WMError SetMainWindowTopmost(bool isTopmost) { return WMError::WM_OK; }
IsMainWindowTopmost()453     virtual bool IsMainWindowTopmost() const { return false; }
454     virtual WMError HideNonSystemFloatingWindows(bool shouldHide) = 0;
IsFloatingWindowAppType()455     virtual bool IsFloatingWindowAppType() const { return false; }
IsPcWindow()456     virtual bool IsPcWindow() const { return false; }
IsPadWindow()457     virtual bool IsPadWindow() const { return false; }
IsPcOrFreeMultiWindowCapabilityEnabled()458     virtual bool IsPcOrFreeMultiWindowCapabilityEnabled() const { return false; }
IsPcOrPadFreeMultiWindowMode()459     virtual bool IsPcOrPadFreeMultiWindowMode() const { return false; }
IsPadAndNotFreeMutiWindowCompatibleMode()460     virtual bool IsPadAndNotFreeMutiWindowCompatibleMode() const { return false; }
IsSceneBoardEnabled()461     virtual bool IsSceneBoardEnabled() const { return false; }
GetCompatibleModeInPc()462     virtual bool GetCompatibleModeInPc() const { return false; }
463     virtual WmErrorCode KeepKeyboardOnFocus(bool keepKeyboardFlag) = 0;
464     virtual WMError RegisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr& listener) = 0;
465     virtual WMError UnregisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr& listener) = 0;
466     virtual WMError SetWindowLimits(WindowLimits& windowLimits, bool isForcible = false) { return WMError::WM_OK; }
GetWindowLimits(WindowLimits & windowLimits)467     virtual WMError GetWindowLimits(WindowLimits& windowLimits) { return WMError::WM_OK; }
EnableDrag(bool enableDrag)468     virtual WMError EnableDrag(bool enableDrag) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
RegisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr & listener)469     virtual WMError RegisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr& listener)
470     {
471         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
472     }
UnregisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr & listener)473     virtual WMError UnregisterWindowNoInteractionListener(const IWindowNoInteractionListenerSptr& listener)
474     {
475         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
476     }
477     virtual WMError SetSingleFrameComposerEnabled(bool enable) = 0;
478     virtual WMError SetLandscapeMultiWindow(bool isLandscapeMultiWindow) = 0;
SetDecorVisible(bool isVisible)479     virtual WMError SetDecorVisible(bool isVisible) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetDecorVisible(bool & isVisible)480     virtual WMError GetDecorVisible(bool& isVisible) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
SetWindowTitleMoveEnabled(bool enable)481     virtual WMError SetWindowTitleMoveEnabled(bool enable) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
SetWindowTitle(const std::string & title)482     virtual WMError SetWindowTitle(const std::string& title) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
SetTitleButtonVisible(bool isMaximizeVisible,bool isMinimizeVisible,bool isSplitVisible,bool isCloseVisible)483     virtual WMError SetTitleButtonVisible(bool isMaximizeVisible, bool isMinimizeVisible, bool isSplitVisible,
484         bool isCloseVisible)
485     {
486         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
487     }
SetDecorHeight(int32_t decorHeight)488     virtual WMError SetDecorHeight(int32_t decorHeight) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetDecorHeight(int32_t & height)489     virtual WMError GetDecorHeight(int32_t& height) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
SetDecorButtonStyle(const DecorButtonStyle & style)490     virtual WMError SetDecorButtonStyle(const DecorButtonStyle& style)
491     {
492         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
493     }
GetDecorButtonStyle(DecorButtonStyle & style)494     virtual WMError GetDecorButtonStyle(DecorButtonStyle& style) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
GetTitleButtonArea(TitleButtonRect & titleButtonRect)495     virtual WMError GetTitleButtonArea(TitleButtonRect& titleButtonRect)
496     {
497         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
498     }
SetWindowContainerColor(const std::string & activeColor,const std::string & inactiveColor)499     virtual WMError SetWindowContainerColor(const std::string& activeColor, const std::string& inactiveColor)
500     {
501         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
502     }
SetWindowContainerModalColor(const std::string & activeColor,const std::string & inactiveColor)503     virtual WMError SetWindowContainerModalColor(const std::string& activeColor, const std::string& inactiveColor)
504     {
505         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
506     }
RegisterWindowTitleButtonRectChangeListener(const sptr<IWindowTitleButtonRectChangedListener> & listener)507     virtual WMError RegisterWindowTitleButtonRectChangeListener(
508         const sptr<IWindowTitleButtonRectChangedListener>& listener)
509     {
510         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
511     }
UnregisterWindowTitleButtonRectChangeListener(const sptr<IWindowTitleButtonRectChangedListener> & listener)512     virtual WMError UnregisterWindowTitleButtonRectChangeListener(
513         const sptr<IWindowTitleButtonRectChangedListener>& listener)
514     {
515         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
516     }
517 
518     /**
519      * @brief Set the application modality of main window.
520      *
521      * @param isModal bool.
522      * @return WMError
523      */
SetWindowModal(bool isModal)524     virtual WMError SetWindowModal(bool isModal) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
525 
526     /**
527      * @brief Set the modality of sub window.
528      *
529      * @param isModal bool.
530      * @param modalityType ModalityType.
531      * @return WMError
532      */
533     virtual WMError SetSubWindowModal(bool isModal, ModalityType modalityType = ModalityType::WINDOW_MODALITY)
534     {
535         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
536     }
537 
538     /**
539      * @brief Set sub window zLevel
540      *
541      * @param zLevel zLevel of sub window to specify the hierarchical relationship among sub windows
542      * @return WM_OK means success, others mean set failed
543      */
SetSubWindowZLevel(int32_t zLevel)544     virtual WMError SetSubWindowZLevel(int32_t zLevel)
545     {
546         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
547     }
548 
549     /**
550      * @brief Get sub window zLevel
551      *
552      * @param zLevel sub window zLevel
553      * @return WM_OK means success, others mean get failed
554      */
GetSubWindowZLevel(int32_t & zLevel)555     virtual WMError GetSubWindowZLevel(int32_t& zLevel)
556     {
557         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
558     }
559 
560     virtual WMError Recover(uint32_t reason = 0) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
561 
Maximize(MaximizePresentation present)562     virtual WMError Maximize(MaximizePresentation present) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
563 
SetWindowMask(const std::vector<std::vector<uint32_t>> & windowMask)564     virtual WMError SetWindowMask(const std::vector<std::vector<uint32_t>>& windowMask)
565     {
566         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
567     }
568 
SetGrayScale(float grayScale)569     virtual WMError SetGrayScale(float grayScale) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
570 
571     /**
572      * @brief Set the Dvsync object
573      *
574      * @param dvsyncSwitch bool.
575      * @return * void
576      */
SetUiDvsyncSwitch(bool dvsyncSwitch)577     virtual void SetUiDvsyncSwitch(bool dvsyncSwitch) {}
578 
579     /**
580      * @brief Set touch event
581      *
582      * @param touchType int32_t.
583      */
SetTouchEvent(int32_t touchType)584     virtual void SetTouchEvent(int32_t touchType) {}
585 
SetImmersiveModeEnabledState(bool enable)586     virtual WMError SetImmersiveModeEnabledState(bool enable) { return WMError::WM_OK; }
587 
GetImmersiveModeEnabledState()588     virtual bool GetImmersiveModeEnabledState() const { return true; }
589 
IsImmersiveLayout(bool & isImmersiveLayout)590     virtual WMError IsImmersiveLayout(bool& isImmersiveLayout) const { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
591 
GetWindowStatus(WindowStatus & windowStatus)592     virtual WMError GetWindowStatus(WindowStatus& windowStatus) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
593 
NotifyExtensionTimeout(int32_t errorCode)594     virtual void NotifyExtensionTimeout(int32_t errorCode) {}
595 
596     /**
597      * @brief Set whether to enable gesture back.
598      * @param enable the value true means to enable gesture back, and false means the opposite.
599      * @return WM_OK means set success, others means set failed.
600      */
SetGestureBackEnabled(bool enable)601     virtual WMError SetGestureBackEnabled(bool enable) { return WMError::WM_OK; }
602 
603     /**
604      * @brief Get whether to enable gesture back.
605      * @param enable the value true means to enable gesture back, and false means the opposite.
606      * @return WM_OK means get success, others means get failed.
607      */
GetGestureBackEnabled(bool & enable)608     virtual WMError GetGestureBackEnabled(bool& enable) const { return WMError::WM_OK; }
609 
610     /**
611      * @brief Flush layout size.
612      *
613      * @param width The width after layout
614      * @param height The height after layout
615      */
FlushLayoutSize(int32_t width,int32_t height)616     virtual void FlushLayoutSize(int32_t width, int32_t height) {}
617 
618     /**
619      * @brief Notify window manager to update snapshot.
620      */
NotifySnapshotUpdate()621     virtual WMError NotifySnapshotUpdate() { return WMError::WM_OK; }
622 
623     /**
624      * @brief notify window remove starting window.
625      *
626      * @return WMError
627      */
NotifyRemoveStartingWindow()628     virtual WMError NotifyRemoveStartingWindow() { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
629 
630     /**
631      * @brief Enable or disable window delay raise
632      *
633      * @param isEnabled Enable or disable window delay raise
634      */
SetWindowDelayRaiseEnabled(bool isEnabled)635     virtual WMError SetWindowDelayRaiseEnabled(bool isEnabled) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
636 
637     /**
638      * @brief Get whether window delay raise is enabled
639      *
640      * @return True means window delay raise is enabled
641      */
IsWindowDelayRaiseEnabled()642     virtual bool IsWindowDelayRaiseEnabled() const { return false; }
643 
644     /**
645      * @brief Set whether to enable exclusively highlight.
646      *
647      * @param isExclusivelyHighlighted the value true means to exclusively highlight, and false means the opposite.
648      * @return WM_OK means set success, others means set failed.
649      */
SetExclusivelyHighlighted(bool isExclusivelyHighlighted)650     virtual WMError SetExclusivelyHighlighted(bool isExclusivelyHighlighted)
651     {
652         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
653     }
654 
655     /**
656      * @brief Check whether current window has specified device feature.
657      *
658      * @param feature specified device feature
659      * @return true means current window has specified device feature, false means not.
660      */
IsDeviceFeatureCapableFor(const std::string & feature)661     virtual bool IsDeviceFeatureCapableFor(const std::string& feature) const { return false; }
662 
663     /**
664      * @brief Check whether current window has free-multi-window device feature.
665      *
666      * @return true means current window has free-multi-window feature, false means not.
667      */
IsDeviceFeatureCapableForFreeMultiWindow()668     virtual bool IsDeviceFeatureCapableForFreeMultiWindow() const { return false; }
669 
670     /**
671      * @brief Get highlight property of window.
672      *
673      * @param highlighted True means the window is highlighted, and false means the opposite.
674      * @return WM_OK means get success, others means get failed.
675      */
IsWindowHighlighted(bool & highlighted)676     virtual WMError IsWindowHighlighted(bool& highlighted) const { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
677 
678     /**
679      * @brief Get the root host window type of UIExtension.
680      *
681      * @return WindowType of the root host window.
682      */
GetRootHostWindowType()683     virtual WindowType GetRootHostWindowType() const { return WindowType::WINDOW_TYPE_APP_MAIN_WINDOW; }
684 
685     /**
686      * @brief Set the root host window type of UIExtension.
687      *
688      * @param WindowType of the root host window.
689      */
SetRootHostWindowType(WindowType & rootHostWindowType)690     virtual void SetRootHostWindowType(WindowType& rootHostWindowType) {}
691 
692     /**
693      * @brief Register SystemBarProperty listener.
694      *
695      * @param listener ISystemBarPropertyListener.
696      * @return WM_OK means register success, others means register failed.
697      */
RegisterSystemBarPropertyListener(const sptr<ISystemBarPropertyListener> & listener)698     virtual WMError RegisterSystemBarPropertyListener(const sptr<ISystemBarPropertyListener>& listener)
699     {
700         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
701     }
702 
703     /**
704      * @brief Unregister SystemBarProperty listener.
705      *
706      * @param listener ISystemBarPropertyListener.
707      * @return WM_OK means unregister success, others means unregister failed.
708      */
UnregisterSystemBarPropertyListener(const sptr<ISystemBarPropertyListener> & listener)709     virtual WMError UnregisterSystemBarPropertyListener(const sptr<ISystemBarPropertyListener>& listener)
710     {
711         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
712     }
713 
714     /**
715      * @brief Notify SystemBarProperty listener.
716      *
717      * @param type The WindowType.
718      * @param property new property value setted by developer.
719      */
NotifySystemBarPropertyUpdate(WindowType type,const SystemBarProperty & property)720     virtual void NotifySystemBarPropertyUpdate(WindowType type, const SystemBarProperty& property) {}
721 
722     /**
723      * @brief Set the parent window of a sub window.
724      *
725      * @param newParentWindowId new parent window id.
726      * @return WM_OK means set parent window success, others means failed.
727      */
SetParentWindow(int32_t newParentWindowId)728     virtual WMError SetParentWindow(int32_t newParentWindowId) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
729 
730     /**
731      * @brief Get the parent window of a sub window.
732      *
733      * @param parentWindow parent window.
734      * @return WM_OK means get parent window success, others means failed.
735      */
GetParentWindow(sptr<Window> & parentWindow)736     virtual WMError GetParentWindow(sptr<Window>& parentWindow) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
737 
738     /**
739      * @brief Set window anchor info.
740      *
741      * @param windowAnchorInfo the windowAnchorInfo of subWindow.
742      * @return WM_OK means set success.
743      */
SetWindowAnchorInfo(const WindowAnchorInfo & windowAnchorInfo)744     virtual WMError SetWindowAnchorInfo(const WindowAnchorInfo& windowAnchorInfo)
745     {
746         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
747     }
748 
749     /**
750      * @brief Set the feature of subwindow follow the layout of the parent window.
751      *
752      * @param isFollow true - follow, false - not follow.
753      * @return WM_OK means set success.
754      */
SetFollowParentWindowLayoutEnabled(bool isFollow)755     virtual WMError SetFollowParentWindowLayoutEnabled(bool isFollow) { return WMError::WM_ERROR_SYSTEM_ABNORMALLY; }
756 
757     /**
758      * @brief Set the transition animation.
759      *
760      * @param transitionType window transition type.
761      * @param animation window transition animation.
762      * @return WM_OK means set window transition animation success, others means failed.
763      */
SetWindowTransitionAnimation(WindowTransitionType transitionType,const TransitionAnimation & animation)764     virtual WMError SetWindowTransitionAnimation(WindowTransitionType transitionType,
765         const TransitionAnimation& animation)
766     {
767         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
768     }
769 
770     /**
771      * @brief Get the transition animation.
772      *
773      * @param transitionType window transition type.
774      * @return nullptr means get failed.
775      */
GetWindowTransitionAnimation(WindowTransitionType transitionType)776     virtual std::shared_ptr<TransitionAnimation> GetWindowTransitionAnimation(WindowTransitionType transitionType)
777     {
778         return nullptr;
779     }
780 
781       /**
782      * @brief Get is subwindow support maximize.
783      *
784      * @return true means subwindow support maximize, others means do not support.
785      */
IsSubWindowMaximizeSupported()786     virtual bool IsSubWindowMaximizeSupported() const { return false; }
787 
788     /**
789      * @brief Set drag key frame policy.
790      * effective order:
791      *  1. resize when drag
792      *  2. key frame
793      *  3. default value
794      *
795      * @param keyFramePolicy param of key frame
796      * @return WM_OK means get success, others means failed.
797      */
SetDragKeyFramePolicy(const KeyFramePolicy & keyFramePolicy)798     virtual WMError SetDragKeyFramePolicy(const KeyFramePolicy& keyFramePolicy)
799     {
800         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
801     }
802 
803     /**
804      * @brief Get the window property of current window.
805      *
806      * @param windowPropertyInfo the window property struct.
807      * @return WMError.
808      */
GetWindowPropertyInfo(WindowPropertyInfo & windowPropertyInfo)809     virtual WMError GetWindowPropertyInfo(WindowPropertyInfo& windowPropertyInfo) { return WMError::WM_OK; }
810 
811     /**
812      * @brief notify avoid area for compatible mode app
813      */
HookCompatibleModeAvoidAreaNotify()814     virtual void HookCompatibleModeAvoidAreaNotify() {}
815 
816      /**
817      * @brief The comaptible mode app adapt to immersive or not.
818      *
819      * @return true comptbleMode adapt to immersive, others means not.
820      */
IsAdaptToCompatibleImmersive()821     virtual bool IsAdaptToCompatibleImmersive() const { return false; }
822 
823     /**
824      * @brief Set the source of subwindow.
825      *
826      * @param source 0 - defalut, 1 - arkui.
827      * @return WM_OK means set success.
828      */
SetSubWindowSource(SubWindowSource source)829     virtual WMError SetSubWindowSource(SubWindowSource source) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }
830 
831     /**
832      * @brief Raise main window above another.
833      *
834      * @param targetId Indicates the id of the target main window.
835      * @return WM_OK means raise success, others means raise failed.
836      */
RaiseMainWindowAboveTarget(int32_t targetId)837     virtual WMError RaiseMainWindowAboveTarget(int32_t targetId)
838     {
839         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
840     }
841 
842 };
843 }
844 }
845 #endif // OHOS_ROSEN_WINDOW_H
846