• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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_SCENE_SESSION_INTERFACE_H
17 #define OHOS_ROSEN_WINDOW_SCENE_SESSION_INTERFACE_H
18 
19 #include <iremote_broker.h>
20 #include <session_info.h>
21 
22 #include "interfaces/include/ws_common.h"
23 #include "common/include/window_session_property.h"
24 #include "session/container/include/zidl/session_stage_interface.h"
25 #include "session/container/include/zidl/window_event_channel_interface.h"
26 
27 namespace OHOS::Accessibility {
28 class AccessibilityEventInfo;
29 }
30 namespace OHOS::Rosen {
31 class RSSurfaceNode;
32 class RSCanvasNode;
33 class RSTransaction;
34 enum class ImageFit;
35 class ISession : public IRemoteBroker {
36 public:
37     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.ISession");
38 
39     virtual WSError Connect(const sptr<ISessionStage>& sessionStage, const sptr<IWindowEventChannel>& eventChannel,
40         const std::shared_ptr<RSSurfaceNode>& surfaceNode, SystemSessionConfig& systemConfig,
41         sptr<WindowSessionProperty> property = nullptr, sptr<IRemoteObject> token = nullptr,
42         const std::string& identityToken = "") { return WSError::WS_OK; }
43     virtual WSError Foreground(
44         sptr<WindowSessionProperty> property, bool isFromClient = false, const std::string& identityToken = "") = 0;
45     virtual WSError Background(bool isFromClient = false, const std::string& identityToken = "") = 0;
46     virtual WSError Disconnect(bool isFromClient = false, const std::string& identityToken = "") = 0;
47     virtual WSError Show(sptr<WindowSessionProperty> property) = 0;
48     virtual WSError Hide() = 0;
49     virtual WSError DrawingCompleted() = 0;
50     virtual WSError RemoveStartingWindow() = 0;
51 
52     // scene session
53     /**
54      * @brief Receive session event from application.
55      *
56      * This function provides the ability for applications to move window.
57      * This interface will take effect after touch down event.
58      *
59      * @param event Indicates the {@link SessionEvent}
60      * @return Returns WSError::WS_OK if called success, otherwise failed.
61      */
OnSessionEvent(SessionEvent event)62     virtual WSError OnSessionEvent(SessionEvent event) { return WSError::WS_OK; }
63 
64     /**
65      * @brief Receive session event from application.
66      *
67      * This function provides the ability for applications to move window.\n
68      * This interface will take effect after touch down event.\n
69      *
70      * @return Returns WSError::WS_OK if called success, otherwise failed.
71      */
SyncSessionEvent(SessionEvent event)72     virtual WSError SyncSessionEvent(SessionEvent event) { return WSError::WS_OK; }
73 
74     /**
75      * @brief Enables or disables system window dragging.
76      *
77      * This function provides the ability for system application to make system window dragable.
78      *
79      * @return Returns WSError::WS_OK if called success, otherwise failed.
80      * @permission Make sure the caller has system permission.
81      */
SetSystemWindowEnableDrag(bool enableDrag)82     virtual WMError SetSystemWindowEnableDrag(bool enableDrag) { return WMError::WM_OK; }
83 
84     /**
85      * @brief Callback for processing full-screen layout changes.
86      *
87      * @param isLayoutFullScreen Indicates the {@link bool}
88      * @return Returns WSError::WS_OK if called success, otherwise failed.
89      */
OnLayoutFullScreenChange(bool isLayoutFullScreen)90     virtual WSError OnLayoutFullScreenChange(bool isLayoutFullScreen) { return WSError::WS_OK; }
91 
92     /**
93      * @brief Callback for processing set default density enabled.
94      *
95      * @param isDefaultDensityEnabled Indicates the {@link bool}
96      * @return Returns WSError::WS_OK if called success, otherwise failed.
97      */
OnDefaultDensityEnabled(bool isDefaultDensityEnabled)98     virtual WSError OnDefaultDensityEnabled(bool isDefaultDensityEnabled) { return WSError::WS_OK; }
99 
100     /**
101      * @brief Callback for processing title and dock hover show changes.
102      *
103      * @param isTitleHoverShown Indicates the {@link bool}
104      * @param isDockHoverShown Indicates the {@link bool}
105      * @return Returns WSError::WS_OK if called success, otherwise failed.
106      */
107     virtual WSError OnTitleAndDockHoverShowChange(bool isTitleHoverShown = true,
108         bool isDockHoverShown = true) { return WSError::WS_OK; }
109 
110     /**
111      * @brief Callback for processing restore main window.
112      *
113      * @return Returns WSError::WS_OK if called success, otherwise failed.
114      */
OnRestoreMainWindow()115     virtual WSError OnRestoreMainWindow() { return WSError::WS_OK; }
116 
117     /**
118      * @brief Raise the application subwindow to the top layer of the application.
119      *
120      * @return Returns WSError::WS_OK if called success, otherwise failed.
121      * @permission Make sure the caller has system permission.
122      */
RaiseToAppTop()123     virtual WSError RaiseToAppTop() { return WSError::WS_OK; }
124 
125     /**
126      * @brief Update window size and position.
127      *
128      * @param rect Indicates the {@link WSRect} structure containing required size and position.
129      * @param reason Indicates the {@link SizeChangeReason} reason.
130      * @param isGlobal Indicates the {@link bool}.
131      * @return Returns WSError::WS_OK if called success, otherwise failed.
132      */
133     virtual WSError UpdateSessionRect(
134         const WSRect& rect, SizeChangeReason reason, bool isGlobal = false,
135         bool isFromMoveToGlobal = false, const MoveConfiguration& moveConfiguration = {},
136         const RectAnimationConfig& rectAnimationConfig = {}) { return WSError::WS_OK; }
UpdateClientRect(const WSRect & rect)137     virtual WSError UpdateClientRect(const WSRect& rect) { return WSError::WS_OK; }
138 
139     /**
140      * @brief Updates the window's rectangle in global coordinates from client-side state.
141      *
142      * This method is called internally to synchronize the window's position and size in global coordinates
143      * based on the client-side changes (e.g., from the client application or user interactions).
144      *
145      * @param rect The updated rectangle (position and size) in global coordinates.
146      * @param reason The reason for the size or position change.
147      * @return WSError::WS_OK if the update is successful; otherwise, returns the corresponding error code.
148      */
UpdateGlobalDisplayRectFromClient(const WSRect & rect,SizeChangeReason reason)149     virtual WSError UpdateGlobalDisplayRectFromClient(const WSRect& rect, SizeChangeReason reason)
150     {
151         return WSError::WS_DO_NOTHING;
152     }
153 
GetGlobalScaledRect(Rect & globalScaledRect)154     virtual WMError GetGlobalScaledRect(Rect& globalScaledRect) { return WMError::WM_OK; }
OnNeedAvoid(bool status)155     virtual WSError OnNeedAvoid(bool status) { return WSError::WS_OK; }
156     virtual AvoidArea GetAvoidAreaByType(AvoidAreaType type, const WSRect& rect = WSRect::EMPTY_RECT,
157         int32_t apiVersion = API_VERSION_INVALID) { return {}; }
GetTargetOrientationConfigInfo(Orientation targetOrientation,const std::map<Rosen::WindowType,Rosen::SystemBarProperty> & properties)158     virtual WSError GetTargetOrientationConfigInfo(Orientation targetOrientation,
159         const std::map<Rosen::WindowType, Rosen::SystemBarProperty>& properties) { return WSError::WS_OK; }
GetAllAvoidAreas(std::map<AvoidAreaType,AvoidArea> & avoidAreas)160     virtual WSError GetAllAvoidAreas(std::map<AvoidAreaType, AvoidArea>& avoidAreas) { return WSError::WS_OK; }
RequestSessionBack(bool needMoveToBackground)161     virtual WSError RequestSessionBack(bool needMoveToBackground) { return WSError::WS_OK; }
MarkProcessed(int32_t eventId)162     virtual WSError MarkProcessed(int32_t eventId) { return WSError::WS_OK; }
163 
164     /**
165      * @brief Sets the global maximization mode of window.
166      *
167      * @param mode Indicates the {@link MaximizeMode}.
168      * @return Returns WSError::WS_OK if called success, otherwise failed.
169      */
SetGlobalMaximizeMode(MaximizeMode mode)170     virtual WSError SetGlobalMaximizeMode(MaximizeMode mode) { return WSError::WS_OK; }
171 
172     /**
173      * @brief this interface is invoked by the ACE to the native host.
174      * @param eventName invoking event name, which is used to distinguish different invoking types.
175      * @param eventValue used to transfer parameters.
176      * @return WM_OK means get success, others means get failed.
177      */
OnContainerModalEvent(const std::string & eventName,const std::string & eventValue)178     virtual WSError OnContainerModalEvent(const std::string& eventName,
179         const std::string& eventValue) { return WSError::WS_OK; }
180 
181     /**
182      * @brief Obtains the global maximization mode of window.
183      *
184      * @param mode Indicates the {@link MaximizeMode}.
185      * @return Returns WSError::WS_OK if called success, otherwise failed.
186      */
GetGlobalMaximizeMode(MaximizeMode & mode)187     virtual WSError GetGlobalMaximizeMode(MaximizeMode& mode) { return WSError::WS_OK; }
188 
189     /**
190      * @brief Sets the aspect ratio of window.
191      *
192      * @param ratio Indicates the {@link float}
193      * @return Returns WSError::WS_OK if called success, otherwise failed.
194      */
SetAspectRatio(float ratio)195     virtual WSError SetAspectRatio(float ratio) { return WSError::WS_OK; }
UpdateWindowAnimationFlag(bool needDefaultAnimationFlag)196     virtual WSError UpdateWindowAnimationFlag(bool needDefaultAnimationFlag) { return WSError::WS_OK; }
UpdateWindowSceneAfterCustomAnimation(bool isAdd)197     virtual WSError UpdateWindowSceneAfterCustomAnimation(bool isAdd) { return WSError::WS_OK; }
198 
199     /**
200      * @brief Raise a subwindow above a target subwindow.
201      *
202      * @param subWindowId Indicates the {@link int32_t} id of the target subwindow.
203      * @return Returns WSError::WS_OK if called success, otherwise failed.
204      * @permission Make sure the caller has system permission.
205      */
RaiseAboveTarget(int32_t subWindowId)206     virtual WSError RaiseAboveTarget(int32_t subWindowId) { return WSError::WS_OK; }
207 
208     /**
209      * @brief Raise main window above another.
210      *
211      * @param targetId Indicates the {@link int32_t} id of the target main window.
212      * @return Returns WSError::WS_OK if called success, otherwise failed.
213      * @permission Make sure the caller has system permission.
214      */
RaiseMainWindowAboveTarget(int32_t targetId)215     virtual WSError RaiseMainWindowAboveTarget(int32_t targetId) { return WSError::WS_OK; }
216 
217     /**
218      * @brief Raise the application main window to the top layer of the application.
219      *
220      * @return Returns WSError::WS_OK if called success, otherwise failed.
221      */
RaiseAppMainWindowToTop()222     virtual WSError RaiseAppMainWindowToTop() { return WSError::WS_OK; }
PendingSessionActivation(const sptr<AAFwk::SessionInfo> abilitySessionInfo)223     virtual WSError PendingSessionActivation(const sptr<AAFwk::SessionInfo> abilitySessionInfo)
224         { return WSError::WS_OK; }
225 
226     /**
227      * @brief Pending session active batch
228      *
229      * @return Returns WSError::WS_OK if called success, otherwise failed.
230      */
BatchPendingSessionsActivation(const std::vector<sptr<AAFwk::SessionInfo>> & abilitySessionInfos)231     virtual WSError BatchPendingSessionsActivation(const std::vector<sptr<AAFwk::SessionInfo>>& abilitySessionInfos)
232         { return WSError::WS_OK; }
TerminateSession(const sptr<AAFwk::SessionInfo> abilitySessionInfo)233     virtual WSError TerminateSession(const sptr<AAFwk::SessionInfo> abilitySessionInfo) { return WSError::WS_OK; }
SetLandscapeMultiWindow(bool isLandscapeMultiWindow)234     virtual WSError SetLandscapeMultiWindow(bool isLandscapeMultiWindow) { return WSError::WS_OK; }
GetIsMidScene(bool & isMidScene)235     virtual WSError GetIsMidScene(bool& isMidScene) { return WSError::WS_OK; }
NotifySessionException(const sptr<AAFwk::SessionInfo> abilitySessionInfo,const ExceptionInfo & exceptionInfo)236     virtual WSError NotifySessionException(
237         const sptr<AAFwk::SessionInfo> abilitySessionInfo,
238         const ExceptionInfo& exceptionInfo) { return WSError::WS_OK; }
239 
240     // extension session
TransferAbilityResult(uint32_t resultCode,const AAFwk::Want & want)241     virtual WSError TransferAbilityResult(uint32_t resultCode, const AAFwk::Want& want) { return WSError::WS_OK; }
TransferExtensionData(const AAFwk::WantParams & wantParams)242     virtual int32_t TransferExtensionData(const AAFwk::WantParams& wantParams) { return 0; }
TransferAccessibilityEvent(const Accessibility::AccessibilityEventInfo & info,int64_t uiExtensionIdLevel)243     virtual WSError TransferAccessibilityEvent(const Accessibility::AccessibilityEventInfo& info,
244         int64_t uiExtensionIdLevel)
245     {
246         return WSError::WS_OK;
247     }
248 
249     /**
250      * @brief keyFrame event info.
251      *
252      * @return Returns WSError::WS_OK if called success, otherwise failed.
253      */
KeyFrameAnimateEnd()254     virtual WSError KeyFrameAnimateEnd() { return WSError::WS_OK; }
UpdateKeyFrameCloneNode(std::shared_ptr<RSCanvasNode> & rsCanvasNode,std::shared_ptr<RSTransaction> & rsTransaction)255     virtual WSError UpdateKeyFrameCloneNode(std::shared_ptr<RSCanvasNode>& rsCanvasNode,
256         std::shared_ptr<RSTransaction>& rsTransaction) { return WSError::WS_OK; }
SetDragKeyFramePolicy(const KeyFramePolicy & keyFramePolicy)257     virtual WSError SetDragKeyFramePolicy(const KeyFramePolicy& keyFramePolicy) { return WSError::WS_OK; }
258 
NotifyFrameLayoutFinishFromApp(bool notifyListener,const WSRect & rect)259     virtual WSError NotifyFrameLayoutFinishFromApp(bool notifyListener, const WSRect& rect)
260     {
261         return WSError::WS_OK;
262     }
NotifySnapshotUpdate()263     virtual WMError NotifySnapshotUpdate() { return WMError::WM_OK; }
NotifyExtensionDied()264     virtual void NotifyExtensionDied() {}
NotifyExtensionTimeout(int32_t errorCode)265     virtual void NotifyExtensionTimeout(int32_t errorCode) {}
TriggerBindModalUIExtension()266     virtual void TriggerBindModalUIExtension() {}
NotifySyncOn()267     virtual void NotifySyncOn() {}
NotifyAsyncOn()268     virtual void NotifyAsyncOn() {}
NotifyTransferAccessibilityEvent(const Accessibility::AccessibilityEventInfo & info,int64_t uiExtensionIdLevel)269     virtual void NotifyTransferAccessibilityEvent(const Accessibility::AccessibilityEventInfo& info,
270         int64_t uiExtensionIdLevel) {}
NotifyExtensionEventAsync(uint32_t notifyEvent)271     virtual void NotifyExtensionEventAsync(uint32_t notifyEvent) {}
SendExtensionData(MessageParcel & data,MessageParcel & reply,MessageOption & option)272     virtual WSError SendExtensionData(MessageParcel& data, MessageParcel& reply, MessageOption& option)
273     {
274         return WSError::WS_OK;
275     }
276 
277     /**
278      * @brief Close pip window while stopPip is called.
279      *
280      * Notify system that pip window is stopping and execute animation.
281      */
NotifyPiPWindowPrepareClose()282     virtual void NotifyPiPWindowPrepareClose() {}
283 
284     /**
285      * @brief Update the required params to system.
286      *
287      * Update the required rect and reason to determine the final size of pip window. Called when start pip,
288      * show pip window, update pip size and pip restore.
289      * Make sure the caller's process is same with the process which created pip window.
290      *
291      * @param rect Indicates the {@link Rect} structure containing required size and position.
292      * @param reason Indicates the {@link SizeChangeReason} reason.
293      * @return Returns WSError::WS_OK if called success, otherwise failed.
294      */
UpdatePiPRect(const Rect & rect,SizeChangeReason reason)295     virtual WSError UpdatePiPRect(const Rect& rect, SizeChangeReason reason) { return WSError::WS_OK; }
296 
297     /**
298      * @brief Update the pip control status to pip control panel.
299      *
300      * Called when the specified component's status needs to be updated.
301      * Make sure the caller's process is same with the process which created pip window.
302      *
303      * @param controlType Indicates the {@link WsPiPControlType} component in pip control panel.
304      * @param status Indicates the {@link WsPiPControlStatus} status of specified component.
305      * @return Returns WSError::WS_OK if called success, otherwise failed.
306      */
UpdatePiPControlStatus(WsPiPControlType controlType,WsPiPControlStatus status)307     virtual WSError UpdatePiPControlStatus(WsPiPControlType controlType, WsPiPControlStatus status)
308     {
309         return WSError::WS_OK;
310     }
311 
312     /**
313      * @brief Update the auto start pip window status.
314      *
315      * @param isAutoStart Indicates the {@link bool}
316      * @param priority Indicates the {@link uint32_t} priority of pip window
317      * @param width Indicates the {@link uint32_t} width of the video content
318      * @param height Indicates the {@link uint32_t} height of the video content
319      * @return Returns WSError::WS_OK if called success, otherwise failed.
320      */
SetAutoStartPiP(bool isAutoStart,uint32_t priority,uint32_t width,uint32_t height)321     virtual WSError SetAutoStartPiP(bool isAutoStart, uint32_t priority, uint32_t width, uint32_t height)
322     {
323         return WSError::WS_OK;
324     }
325 
326     /**
327      * @brief Update pipTemplateInfo.
328      *
329      * @param pipTemplateInfo Indicates the {@link PiPTemplateInfo} pipTemplateInfo of pip window
330      * @return Returns WSError::WS_OK if called success, otherwise failed.
331      */
UpdatePiPTemplateInfo(PiPTemplateInfo & pipTemplateInfo)332     virtual WSError UpdatePiPTemplateInfo(PiPTemplateInfo& pipTemplateInfo)
333     {
334         return WSError::WS_OK;
335     }
336 
ProcessPointDownSession(int32_t posX,int32_t posY)337     virtual WSError ProcessPointDownSession(int32_t posX, int32_t posY) { return WSError::WS_OK; }
338     virtual WSError SendPointEventForMoveDrag(const std::shared_ptr<MMI::PointerEvent>& pointerEvent,
339         bool isExecuteDelayRaise = false) { return WSError::WS_OK; }
IsStartMoving()340     virtual bool IsStartMoving() { return false; }
ChangeSessionVisibilityWithStatusBar(const sptr<AAFwk::SessionInfo> abilitySessionInfo,bool isShow)341     virtual WSError ChangeSessionVisibilityWithStatusBar(const sptr<AAFwk::SessionInfo> abilitySessionInfo,
342         bool isShow) { return WSError::WS_OK; }
343 
344     /**
345      * @brief Instruct the application to update the listening flag for registering rect changes.
346      *
347      * @param isRegister Indicates the {@link bool}
348      * @return Returns WSError::WS_OK if called success, otherwise failed.
349      */
UpdateRectChangeListenerRegistered(bool isRegister)350     virtual WSError UpdateRectChangeListenerRegistered(bool isRegister)
351     {
352         return WSError::WS_OK;
353     }
SetCallingSessionId(uint32_t callingSessionId)354     virtual void SetCallingSessionId(uint32_t callingSessionId) {};
NotifyKeyboardWillShowRegistered(bool registered)355     virtual void NotifyKeyboardWillShowRegistered(bool registered) {};
NotifyKeyboardWillHideRegistered(bool registered)356     virtual void NotifyKeyboardWillHideRegistered(bool registered) {};
NotifyKeyboardDidShowRegistered(bool registered)357     virtual void NotifyKeyboardDidShowRegistered(bool registered) {};
NotifyKeyboardDidHideRegistered(bool registered)358     virtual void NotifyKeyboardDidHideRegistered(bool registered) {};
SetCustomDecorHeight(int32_t height)359     virtual void SetCustomDecorHeight(int32_t height) {};
UpdateSessionPropertyByAction(const sptr<WindowSessionProperty> & property,WSPropertyChangeAction action)360     virtual WMError UpdateSessionPropertyByAction(const sptr<WindowSessionProperty>& property,
361         WSPropertyChangeAction action) { return WMError::WM_OK; }
GetAppForceLandscapeConfig(AppForceLandscapeConfig & config)362     virtual WMError GetAppForceLandscapeConfig(AppForceLandscapeConfig& config) { return WMError::WM_OK; }
GetAppHookWindowInfoFromServer(HookWindowInfo & hookWindowInfo)363     virtual WMError GetAppHookWindowInfoFromServer(HookWindowInfo& hookWindowInfo) { return WMError::WM_OK; }
AdjustKeyboardLayout(const KeyboardLayoutParams & params)364     virtual WSError AdjustKeyboardLayout(const KeyboardLayoutParams& params) { return WSError::WS_OK; }
SetDialogSessionBackGestureEnabled(bool isEnabled)365     virtual WSError SetDialogSessionBackGestureEnabled(bool isEnabled) { return WSError::WS_OK; }
NotifyExtensionDetachToDisplay()366     virtual void NotifyExtensionDetachToDisplay() {}
GetStatusBarHeight()367     virtual int32_t GetStatusBarHeight() { return 0; }
368     /**
369      * @brief Request to get focus or lose focus.
370      *
371      * @param isFocused True means window wants to get focus, false means the opposite.
372      * @return Returns WSError::WS_OK if called success, otherwise failed.
373      */
RequestFocus(bool isFocused)374     virtual WSError RequestFocus(bool isFocused) { return WSError::WS_OK; }
375 
376     /**
377      * @brief Callback for session modal type changes.
378      *
379      * @param subWindowModalType Indicates the {@link SubWindowModalType}
380      * @return Returns WSError::WS_OK if called success, otherwise failed.
381      */
NotifySubModalTypeChange(SubWindowModalType subWindowModalType)382     virtual WSError NotifySubModalTypeChange(SubWindowModalType subWindowModalType) { return WSError::WS_OK; }
383 
384     /**
385      * @brief Callback for main session modal type changes.
386      *
387      * @param isModal Indicates the {@link bool}
388      * @return Returns WSError::WS_OK if called success, otherwise failed.
389      */
NotifyMainModalTypeChange(bool isModal)390     virtual WSError NotifyMainModalTypeChange(bool isModal) { return WSError::WS_OK; }
391 
392     /**
393      * @brief Callback for setting whether the sub window supports simultaneous display on multiple screens
394      *        when the parent window is dragged to move or dragged to zoom.
395      * @param enabled Indicates the {@link bool}
396      * @return Returns WSError::WS_OK if called success, otherwise failed.
397      */
NotifyFollowParentMultiScreenPolicy(bool enabled)398     virtual WSError NotifyFollowParentMultiScreenPolicy(bool enabled) { return WSError::WS_OK; }
399 
400     /**
401      * @brief Callback for setting to automatically save the window rect.
402      *
403      * @param enabled Enable the window rect auto-save if true, otherwise means the opposite.
404      * @return Returns WSError::WS_OK if called success, otherwise failed.
405      */
OnSetWindowRectAutoSave(bool enabled,bool isSaveBySpecifiedFlag)406     virtual WSError OnSetWindowRectAutoSave(bool enabled, bool isSaveBySpecifiedFlag) { return WSError::WS_OK; }
407 
408     /**
409      * @brief Callback for set image for recent.
410      *
411      * @param imgResourceId resourceId of static image.
412      * @param imageFit imageFit.
413      * @return Returns WSError::WS_OK if called success, otherwise failed.
414      */
OnSetImageForRecent(uint32_t imgResourceId,ImageFit ImageFit)415     virtual WSError OnSetImageForRecent(uint32_t imgResourceId, ImageFit ImageFit) { return WSError::WS_OK; }
416 
417     /**
418      * @brief Callback for setting to radius of window.
419      *
420      * @param cornerRadius corner radius of window.
421      * @return Returns WSError::WS_OK if called success, otherwise failed.
422      */
SetWindowCornerRadius(float cornerRadius)423     virtual WSError SetWindowCornerRadius(float cornerRadius) { return WSError::WS_OK; }
424 
425     /**
426      * @brief Callback for setting to shadows of window.
427      *
428      * @param shadowsInfo shadows of window.
429      * @return Returns WSError::WS_OK if called success, otherwise failed.
430      */
SetWindowShadows(const ShadowsInfo & shadowsInfo)431     virtual WSError SetWindowShadows(const ShadowsInfo& shadowsInfo) { return WSError::WS_OK; }
432 
433     /**
434      *  Gesture Back
435      */
SetGestureBackEnabled(bool isEnabled)436     virtual WMError SetGestureBackEnabled(bool isEnabled) { return WMError::WM_OK; }
437 
438     /**
439      * @brief Get waterfall mode.
440      *
441      * @param isWaterfallMode Indicates the waterfall mode.
442      * @return Returns WSError::WS_OK if called success, otherwise failed.
443      */
GetWaterfallMode(bool & isWaterfallMode)444     virtual WSError GetWaterfallMode(bool& isWaterfallMode) { return WSError::WS_OK; }
445 
446     /**
447      * @brief Callback for setting the window support modes.
448      *
449      * @param supportedWindowModes Indicates the {@link AppExecFwk::SupportWindowMode}.
450      * @return Returns WSError::WS_OK if called success, otherwise failed.
451      */
NotifySupportWindowModesChange(const std::vector<AppExecFwk::SupportWindowMode> & supportedWindowModes)452     virtual WSError NotifySupportWindowModesChange(
453         const std::vector<AppExecFwk::SupportWindowMode>& supportedWindowModes) { return WSError::WS_OK; }
454 
455     /**
456      * @brief set session label and icon
457      *
458      * @param label
459      * @param icon
460      * @return Returns WSError::WS_OK if called success, otherwise failed.
461      * @permission ohos.permission.SET_ABILITY_INSTANCE_INFO
462      * @scene 15
463      */
SetSessionLabelAndIcon(const std::string & label,const std::shared_ptr<Media::PixelMap> & icon)464     virtual WSError SetSessionLabelAndIcon(const std::string& label,
465         const std::shared_ptr<Media::PixelMap>& icon) { return WSError::WS_OK; }
466 
ChangeKeyboardEffectOption(const KeyboardEffectOption & effectOption)467     virtual WSError ChangeKeyboardEffectOption(const KeyboardEffectOption& effectOption) { return WSError::WS_OK; };
468 
469     /**
470      * @brief Start Moving window with coordinate.
471      *
472      * @param offsetX expected pointer position x-axis offset in window when start moving.
473      * @param offsetY expected pointer position y-axis offset in window when start moving.
474      * @param pointerPosX current pointer position x-axis offset in screen.
475      * @param pointerPosY current pointer position y-axis offset in screen.
476      * @param displayId current pointer display id.
477      * @return Returns WSError::WS_OK if called success, otherwise failed.
478      */
StartMovingWithCoordinate(int32_t offsetX,int32_t offsetY,int32_t pointerPosX,int32_t pointerPosY,DisplayId displayId)479     virtual WSError StartMovingWithCoordinate(int32_t offsetX, int32_t offsetY,
480         int32_t pointerPosX, int32_t pointerPosY, DisplayId displayId) { return WSError::WS_OK; }
GetCrossAxisState(CrossAxisState & state)481     virtual WSError GetCrossAxisState(CrossAxisState& state) { return WSError::WS_OK; };
482 
483     /**
484      * @brief Notify the window attach state listener is registered or not.
485      *
486      * @param registered true means register success.
487      */
NotifyWindowAttachStateListenerRegistered(bool registered)488     virtual void NotifyWindowAttachStateListenerRegistered(bool registered) { }
SetFollowParentWindowLayoutEnabled(bool isFollow)489     virtual WSError SetFollowParentWindowLayoutEnabled(bool isFollow) { return WSError::WS_OK; };
SetWindowAnchorInfo(const WindowAnchorInfo & windowAnchorInfo)490     virtual WSError SetWindowAnchorInfo(const WindowAnchorInfo& windowAnchorInfo) { return WSError::WS_OK; };
UpdateFlag(const std::string & flag)491     virtual WSError UpdateFlag(const std::string& flag) { return WSError::WS_OK; };
UpdateRotationChangeRegistered(int32_t persistentId,bool isRegister)492     virtual WSError UpdateRotationChangeRegistered(int32_t persistentId, bool isRegister) { return WSError::WS_OK; }
UpdateScreenshotAppEventRegistered(int32_t persistentId,bool isRegister)493     virtual WMError UpdateScreenshotAppEventRegistered(int32_t persistentId, bool isRegister) { return WMError::WM_OK; }
UpdateAcrossDisplaysChangeRegistered(bool isRegister)494     virtual WMError UpdateAcrossDisplaysChangeRegistered(bool isRegister) { return WMError::WM_OK; }
IsMainWindowFullScreenAcrossDisplays(bool & isAcrossDisplays)495     virtual WMError IsMainWindowFullScreenAcrossDisplays(bool& isAcrossDisplays) { return WMError::WM_OK; }
GetIsHighlighted(bool & isHighlighted)496     virtual WSError GetIsHighlighted(bool& isHighlighted) { return WSError::WS_OK; }
497 
498     /**
499      * @brief Notify when disableDelegator change to true
500      *
501      * This function is used to notify disableDelegator change.
502      *
503      * @caller SA
504      * @permission SA permission
505      *
506      * @return Successful call returns WMError::WS_OK, otherwise it indicates failure
507      */
NotifyDisableDelegatorChange()508     virtual WMError NotifyDisableDelegatorChange() { return WMError::WM_OK; }
509 
510     /**
511      * @brief Use implict animation
512      *
513      * @param used used
514      * @return Returns WSError::WS_OK if called success, otherwise failed.
515      */
UseImplicitAnimation(bool useImplicit)516     virtual WSError UseImplicitAnimation(bool useImplicit) { return WSError::WS_OK; }
517 
518     /**
519      * @brief Set the transition animation.
520      *
521      * @param transitionType window transition type.
522      * @param animation window transition animation.
523      * @return WM_OK means set success.
524      */
SetWindowTransitionAnimation(WindowTransitionType transitionType,const TransitionAnimation & animation)525     virtual WSError SetWindowTransitionAnimation(WindowTransitionType transitionType,
526         const TransitionAnimation& animation)
527     {
528         return WSError::WS_OK;
529     }
530 
531     /**
532     * @brief Set sub window source
533     *
534     * @param source source
535     * @return Returns WSError::WS_OK if called success, otherwise failed.
536     */
SetSubWindowSource(SubWindowSource source)537     virtual WSError SetSubWindowSource(SubWindowSource source) { return WSError::WS_OK; }
538 
539     /**
540      * @brief Set the frameRect in a partial zoom-in scene.
541      *
542      * @param frameRect The original rect of frameBuffer before partial zoom-in.
543      * @return WSError::WS_OK means set success, otherwise failed.
544      */
SetFrameRectForPartialZoomIn(const Rect & frameRect)545     virtual WSError SetFrameRectForPartialZoomIn(const Rect& frameRect) { return WSError::WS_OK; }
546 
547     /**
548      * @brief update the floating-ball window instance.
549      *
550      * @param fbTemplateInfo the template info of the floating-ball.
551      */
UpdateFloatingBall(const FloatingBallTemplateInfo & fbTemplateInfo)552     virtual WMError UpdateFloatingBall(const FloatingBallTemplateInfo& fbTemplateInfo)
553     {
554         return WMError::WM_OK;
555     }
556 
GetFloatingBallWindowId(uint32_t & windowId)557     virtual WMError GetFloatingBallWindowId(uint32_t& windowId)
558     {
559         return WMError::WM_OK;
560     }
561 
562     /**
563      * @brief Close flating ball window while stopFb is called.
564      *
565      * Notify system that flating ball window is stopping and execute animation.
566      */
NotifyFloatingBallPrepareClose()567     virtual void NotifyFloatingBallPrepareClose() {}
568 
569     /**
570      * @brief Notify prepare to close window
571      */
StopFloatingBall()572     virtual WSError StopFloatingBall()
573     {
574         return WSError::WS_OK;
575     }
576 
RestoreFbMainWindow(const std::shared_ptr<AAFwk::Want> & want)577     virtual WMError RestoreFbMainWindow(const std::shared_ptr<AAFwk::Want>& want)
578     {
579         return WMError::WM_OK;
580     }
581 };
582 } // namespace OHOS::Rosen
583 
584 #endif // OHOS_ROSEN_WINDOW_SCENE_SESSION_INTERFACE_H
585