• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ROSEN_WINDOW_MANAGER_H
17 #define OHOS_ROSEN_WINDOW_MANAGER_H
18 
19 #include <memory>
20 #include <mutex>
21 #include <refbase.h>
22 #include <vector>
23 #include <iremote_object.h>
24 #include "wm_single_instance.h"
25 #include "wm_common.h"
26 #include "dm_common.h"
27 #include "focus_change_info.h"
28 #include "window_visibility_info.h"
29 #include "window_drawing_content_info.h"
30 #include "window.h"
31 #include "window_pid_visibility_info.h"
32 
33 namespace OHOS {
34 namespace Rosen {
35 struct SystemBarRegionTint {
36     WindowType type_;
37     SystemBarProperty prop_;
38     Rect region_;
SystemBarRegionTintSystemBarRegionTint39     SystemBarRegionTint()
40         : type_(WindowType::WINDOW_TYPE_APP_MAIN_WINDOW), prop_(), region_{ 0, 0, 0, 0 } {}
SystemBarRegionTintSystemBarRegionTint41     SystemBarRegionTint(WindowType type, SystemBarProperty prop, Rect region)
42         : type_(type), prop_(prop), region_(region) {}
43 };
44 using SystemBarRegionTints = std::vector<SystemBarRegionTint>;
45 using GetJSWindowObjFunc = std::function<void*(const std::string& windowName)>;
46 using WindowChangeInfoType = std::variant<int32_t, uint32_t, int64_t, uint64_t, std::string, float, Rect, WindowMode,
47     WindowVisibilityState>;
48 
49 struct VisibleWindowNumInfo {
50     uint32_t displayId;
51     uint32_t visibleWindowNum;
52 };
53 
54 struct WindowSnapshotDataPack {
55     std::shared_ptr<Media::PixelMap> pixelMap = nullptr;
56     WMError result = WMError::WM_OK;
57 };
58 
59 struct WindowLifeCycleInfo {
60     int32_t windowId;
61     WindowType windowType;
62     std::string windowName;
63 };
64 
65 /**
66  * @class IWMSConnectionChangedListener
67  *
68  * @brief Listener to observe window lifecycle status.
69  */
70 class IWindowLifeCycleListener : virtual public RefBase {
71 public:
72     /**
73      * @brief Notify caller when window is destroyed
74      *
75      * @param lifeCycleInfo window lifecycle info.
76      * @param jsWindowNapiValue js window object napi value.
77      *
78      */
79     virtual void OnWindowDestroyed(const WindowLifeCycleInfo& lifeCycleInfo, void* jsWindowNapiValue) = 0;
80 };
81 
82 /**
83  * @class IWMSConnectionChangedListener
84  *
85  * @brief Listener to observe WMS connection status.
86  */
87 class IWMSConnectionChangedListener : virtual public RefBase {
88 public:
89     /**
90      * @brief Notify caller when WMS connected
91      *
92      * @param userId ID of the user who has connected to the WMS.
93      *
94      * @param screenId ID of the screen that is connected to the WMS, screenId is currently always 0.
95      */
96     virtual void OnConnected(int32_t userId, int32_t screenId) = 0;
97 
98     /**
99      * @brief Notify caller when WMS disconnected
100      *
101      * @param userId ID of the user who has disconnected to the WMS.
102      *
103      * @param screenId ID of the screen that is disconnected to the WMS, screenId is currently always 0.
104      */
105     virtual void OnDisconnected(int32_t userId, int32_t screenId) = 0;
106 };
107 
108 /**
109  * @class IFocusChangedListener
110  *
111  * @brief Listener to observe focus changed.
112  */
113 class IFocusChangedListener : virtual public RefBase {
114 public:
115     /**
116      * @brief Notify caller when window get focus
117      *
118      * @param focusChangeInfo Window info while its focus status changed.
119      */
120     virtual void OnFocused(const sptr<FocusChangeInfo>& focusChangeInfo) = 0;
121 
122     /**
123      * @brief Notify caller when window lose focus
124      *
125      * @param focusChangeInfo Window info while its focus status changed.
126      */
127     virtual void OnUnfocused(const sptr<FocusChangeInfo>& focusChangeInfo) = 0;
128 };
129 
130 /**
131  * @class IWindowModeChangedListener
132  *
133  * @brief Listener to observe window mode change.
134  */
135 class IWindowModeChangedListener : virtual public RefBase {
136 public:
137     /**
138      * @brief Notify caller when window mode update.
139      *
140      * @param mode Window mode.
141      */
142     virtual void OnWindowModeUpdate(WindowModeType mode) = 0;
143 };
144 
145 /**
146  * @class ISystemBarChangedListener
147  *
148  * @brief Listener to observe systembar changed.
149  */
150 class ISystemBarChangedListener : virtual public RefBase {
151 public:
152     /**
153      * @brief Notify caller when system bar property changed
154      *
155      * @param displayId ID of display.
156      * @param tints Tint of system bar region.
157      */
158     virtual void OnSystemBarPropertyChange(DisplayId displayId, const SystemBarRegionTints& tints) = 0;
159 };
160 
161 /**
162  * @class IGestureNavigationEnabledChangedListener
163  *
164  * @brief Listener to observe GestureNavigationEnabled changed.
165  */
166 class IGestureNavigationEnabledChangedListener : virtual public RefBase {
167 public:
168     /**
169      * @brief Notify caller when GestureNavigationEnabled changed.
170      *
171      * @param enable True means set Gesture on, false means set Gesture off.
172      */
173     virtual void OnGestureNavigationEnabledUpdate(bool enable) = 0;
174 };
175 
176 /**
177  * @class IVisibilityChangedListener
178  *
179  * @brief Listener to observe visibility changed.
180  */
181 class IVisibilityChangedListener : virtual public RefBase {
182 public:
183     /**
184      * @brief Notify caller when window visibility changed.
185      *
186      * @param windowVisibilityInfo Window visibility info.
187      */
188     virtual void OnWindowVisibilityChanged(const std::vector<sptr<WindowVisibilityInfo>>& windowVisibilityInfo) = 0;
189 };
190 
191 /**
192  * @class IDrawingContentChangedListener
193  *
194  * @brief Listener to observe drawing content changed.
195  */
196 class IDrawingContentChangedListener : virtual public RefBase {
197 public:
198     /**
199      * @brief Notify caller when window DrawingContent changed.
200      *
201      * @param windowDrawingInfo Window DrawingContent info.
202      */
203     virtual void OnWindowDrawingContentChanged(const std::vector<sptr<WindowDrawingContentInfo>>&
204         windowDrawingInfo) = 0;
205 };
206 
207 /**
208  * @class IWindowStyleChangedListener
209  *
210  * @brief Listener to observe windowStyle changed.
211  */
212 class IWindowStyleChangedListener : virtual public RefBase {
213 public:
214     /**
215      * @brief Notify caller when window style changed.
216      *
217      * @param styleType
218      */
219     virtual void OnWindowStyleUpdate(WindowStyleType styleType) = 0;
220 };
221 
222 /**
223  * @class IKeyboardCallingWindowDisplayChangedListener
224  *
225  * @brief Observe the display change of keyboard callingWindow.
226  */
227 class IKeyboardCallingWindowDisplayChangedListener : virtual public RefBase {
228 public:
229     /**
230      * @brief Notify caller when calling window display changed.
231      *
232      * @param callingWindowInfo The information about the calling window.
233      */
234     virtual void OnCallingWindowDisplayChanged(const CallingWindowInfo& callingWindowInfo) = 0;
235 };
236 
237 /**
238  * @class IWindowPidVisibilityChangedListener
239  *
240  * @brief Listener to observe window visibility that in same pid.
241  */
242 class IWindowPidVisibilityChangedListener : virtual public RefBase {
243 public:
244     /**
245      * @brief Notify caller when window style changed.
246      *
247      * @param info
248      */
249     virtual void NotifyWindowPidVisibilityChanged(const sptr<WindowPidVisibilityInfo>& info) = 0;
250 };
251 
252 /**
253  * @class IWindowInfoChangedListener
254  *
255  * @brief Listener to observe window info.
256  */
257 class IWindowInfoChangedListener : virtual public RefBase {
258 public:
259     IWindowInfoChangedListener() = default;
260 
261     virtual ~IWindowInfoChangedListener() = default;
262 
263     /**
264      * @brief Notify caller when window Info changed.
265      *
266      * @param windowInfoList
267      */
268     virtual void OnWindowInfoChanged(
269         const std::vector<std::unordered_map<WindowInfoKey, WindowChangeInfoType>>& windowInfoList) = 0;
270 
SetInterestInfo(const std::unordered_set<WindowInfoKey> & interestInfo)271     void SetInterestInfo(const std::unordered_set<WindowInfoKey>& interestInfo) { interestInfo_ = interestInfo; }
GetInterestInfo()272     const std::unordered_set<WindowInfoKey>& GetInterestInfo() const { return interestInfo_; }
AddInterestInfo(WindowInfoKey interestValue)273     void AddInterestInfo(WindowInfoKey interestValue) { interestInfo_.insert(interestValue); }
SetInterestWindowIds(const std::unordered_set<int32_t> & interestWindowIds)274     void SetInterestWindowIds(const std::unordered_set<int32_t>& interestWindowIds)
275         { interestWindowIds_ = interestWindowIds; }
GetInterestWindowIds()276     const std::unordered_set<int32_t>& GetInterestWindowIds() const { return interestWindowIds_; }
AddInterestWindowId(int32_t interestWindowId)277     void AddInterestWindowId(int32_t interestWindowId) { interestWindowIds_.insert(interestWindowId); }
RemoveInterestWindowId(int32_t interestWindowId)278     void RemoveInterestWindowId(int32_t interestWindowId) { interestWindowIds_.erase(interestWindowId); }
279 
280 private:
281     std::unordered_set<WindowInfoKey> interestInfo_;
282     std::unordered_set<int32_t> interestWindowIds_;
283 };
284 
285 /*
286  * @class IWindowSystemBarPropertyChangedListener
287  *
288  * @brief Observe the property change of System Bar.
289  */
290 class IWindowSystemBarPropertyChangedListener : virtual public RefBase {
291 public:
292     /**
293      * @brief Notify caller when System Bar property changed.
294      *
295      * @param type Type of System Bar
296      * @param systemBarProperty Property of System Bar
297      */
298     virtual void OnWindowSystemBarPropertyChanged(WindowType type, const SystemBarProperty& systemBarProperty) = 0;
299 };
300 
301 /**
302  * @class AccessibilityWindowInfo
303  *
304  * @brief Window info used for Accessibility.
305  */
306 class AccessibilityWindowInfo : public Parcelable {
307 public:
308     /**
309      * @brief Default construct of AccessibilityWindowInfo.
310      */
311     AccessibilityWindowInfo() = default;
312 
313     /**
314      * @brief Default deconstruct of AccessibilityWindowInfo.
315      */
316     ~AccessibilityWindowInfo() = default;
317 
318     /**
319      * @brief Marshalling AccessibilityWindowInfo.
320      *
321      * @param parcel Package of AccessibilityWindowInfo.
322      * @return True means marshall success, false means marshall failed.
323      */
324     virtual bool Marshalling(Parcel& parcel) const override;
325 
326     /**
327      * @brief Unmarshalling AccessibilityWindowInfo.
328      *
329      * @param parcel Package of AccessibilityWindowInfo.
330      * @return AccessibilityWindowInfo object.
331      */
332     static AccessibilityWindowInfo* Unmarshalling(Parcel& parcel);
333 
334     int32_t wid_;
335     int32_t innerWid_;
336     int32_t uiNodeId_;
337     Rect windowRect_;
338     bool focused_ { false };
339     bool isDecorEnable_ { false };
340     DisplayId displayId_;
341     uint32_t layer_;
342     WindowMode mode_;
343     WindowType type_;
344     float scaleVal_;
345     float scaleX_;
346     float scaleY_;
347     bool isCompatScaleMode_ { false };
348     std::string bundleName_;
349     std::vector<Rect> touchHotAreas_;
350 };
351 
352 /**
353  * @class AppUseControlInfo
354  *
355  * @brief Window info used for AppUseControlInfo.
356  */
357 struct AppUseControlInfo : public Parcelable {
358     /**
359      * @brief Marshalling AppUseControlInfo.
360      *
361      * @param parcel Package of AppUseControlInfo.
362      * @return True means marshall success, false means marshall failed.
363      */
MarshallingAppUseControlInfo364     virtual bool Marshalling(Parcel& parcel) const override
365     {
366         return parcel.WriteString(bundleName_) &&
367                parcel.WriteInt32(appIndex_) &&
368                parcel.WriteBool(isNeedControl_) &&
369                parcel.WriteBool(isControlRecentOnly_);
370     }
371 
372     /**
373      * @brief Unmarshalling AppUseControlInfo.
374      *
375      * @param parcel Package of AppUseControlInfo.
376      * @return AppUseControlInfo object.
377      */
UnmarshallingAppUseControlInfo378     static AppUseControlInfo* Unmarshalling(Parcel& parcel)
379     {
380         auto info = new AppUseControlInfo();
381         if (!parcel.ReadString(info->bundleName_) ||
382             !parcel.ReadInt32(info->appIndex_) ||
383             !parcel.ReadBool(info->isNeedControl_) ||
384             !parcel.ReadBool(info->isControlRecentOnly_)) {
385             delete info;
386             return nullptr;
387         }
388         return info;
389     }
390 
391     std::string bundleName_ = "";
392     int32_t appIndex_ = 0;
393     bool isNeedControl_ = false;
394     bool isControlRecentOnly_ = false;
395 };
396 
397 /**
398  * @struct AbilityInfoBase
399  *
400  * @brief ability info.
401  */
402 struct AbilityInfoBase : public Parcelable {
403     /**
404      * @brief Marshalling AbilityInfoBase.
405      *
406      * @param parcel Package of AbilityInfoBase.
407      * @return True means marshall success, false means marshall failed.
408      */
MarshallingAbilityInfoBase409     bool Marshalling(Parcel& parcel) const override
410     {
411         return parcel.WriteString(bundleName) &&
412                parcel.WriteString(moduleName) &&
413                parcel.WriteString(abilityName) &&
414                parcel.WriteInt32(appIndex);
415     }
416 
417     /**
418      * @brief Unmarshalling AbilityInfoBase.
419      *
420      * @param parcel Package of AbilityInfoBase.
421      * @return AbilityInfoBase object.
422      */
UnmarshallingAbilityInfoBase423     static AbilityInfoBase* Unmarshalling(Parcel& parcel)
424     {
425         auto info = new AbilityInfoBase();
426         if (!parcel.ReadString(info->bundleName) ||
427             !parcel.ReadString(info->moduleName) ||
428             !parcel.ReadString(info->abilityName) ||
429             !parcel.ReadInt32(info->appIndex)) {
430             delete info;
431             return nullptr;
432         }
433         return info;
434     }
435 
IsValidAbilityInfoBase436     bool IsValid() const
437     {
438         return !bundleName.empty() && !moduleName.empty() && !abilityName.empty() && appIndex >= 0;
439     }
440 
ToKeyStringAbilityInfoBase441     std::string ToKeyString() const
442     {
443         return bundleName + "_" + moduleName + "_" + abilityName + "_" + std::to_string(appIndex);
444     }
445 
446     std::string bundleName;
447     std::string moduleName;
448     std::string abilityName;
449     int32_t appIndex = 0;
450 };
451 
452 /**
453  * @class UnreliableWindowInfo
454  *
455  * @brief Unreliable Window Info.
456  */
457 class UnreliableWindowInfo : public Parcelable {
458 public:
459     /**
460      * @brief Default construct of UnreliableWindowInfo.
461      */
462     UnreliableWindowInfo() = default;
463 
464     /**
465      * @brief Default deconstruct of UnreliableWindowInfo.
466      */
467     ~UnreliableWindowInfo() = default;
468 
469     /**
470      * @brief Marshalling UnreliableWindowInfo.
471      *
472      * @param parcel Package of UnreliableWindowInfo.
473      * @return True means marshall success, false means marshall failed.
474      */
475     virtual bool Marshalling(Parcel& parcel) const override;
476 
477     /**
478      * @brief Unmarshalling UnreliableWindowInfo.
479      *
480      * @param parcel Package of UnreliableWindowInfo.
481      * @return UnreliableWindowInfo object.
482      */
483     static UnreliableWindowInfo* Unmarshalling(Parcel& parcel);
484 
485     int32_t windowId_ { 0 };
486     Rect windowRect_;
487     uint32_t zOrder_ { 0 };
488     float floatingScale_ { 1.0f };
489     float scaleX_ { 1.0f };
490     float scaleY_ { 1.0f };
491 };
492 
493 /**
494  * @class IWindowUpdateListener
495  *
496  * @brief Listener to observe window update.
497  */
498 class IWindowUpdateListener : virtual public RefBase {
499 public:
500     /**
501      * @brief Notify caller when AccessibilityWindowInfo update.
502      *
503      * @param infos Window info used for Accessibility.
504      * @param type Type for window update.
505      */
506     virtual void OnWindowUpdate(const std::vector<sptr<AccessibilityWindowInfo>>& infos, WindowUpdateType type) = 0;
507 };
508 
509 /**
510  * @class IWaterMarkFlagChangedListener
511  *
512  * @brief Listener to observe water mark flag changed.
513  */
514 class IWaterMarkFlagChangedListener : virtual public RefBase {
515 public:
516     /**
517      * @brief Notify caller when water mark flag changed.
518      *
519      * @param showWaterMark True means show water mark, false means the opposite.
520      */
521     virtual void OnWaterMarkFlagUpdate(bool showWaterMark) = 0;
522 };
523 
524 /**
525  * @class IVisibleWindowNumChangedListener
526  *
527  * @brief Listener to observe visible main window num changed.
528  */
529 class IVisibleWindowNumChangedListener : virtual public RefBase {
530 public:
531     /**
532      * @brief Notify caller when visible window num changed
533      *
534      * @param visibleWindowNum visible window num .
535      */
536     virtual void OnVisibleWindowNumChange(const std::vector<VisibleWindowNumInfo>& visibleWindowNumInfo) = 0;
537 };
538 
539 /**
540  * @class ICameraFloatWindowChangedListener
541  *
542  * @brief Listener to observe camera window changed.
543  */
544 class ICameraFloatWindowChangedListener : virtual public RefBase {
545 public:
546     /**
547      * @brief Notify caller when camera window changed.
548      *
549      * @param accessTokenId Token id of camera window.
550      * @param isShowing True means camera is shown, false means the opposite.
551      */
552     virtual void OnCameraFloatWindowChange(uint32_t accessTokenId, bool isShowing) = 0;
553 };
554 
555 /**
556  * @class ICameraWindowChangedListener
557  *
558  * @brief Listener to observe camera window changed.
559  */
560 class ICameraWindowChangedListener : virtual public RefBase {
561 public:
562     /**
563      * @brief Notify caller when camera window changed.
564      *
565      * @param accessTokenId Token id of camera window.
566      * @param isShowing True means camera is shown, false means the opposite.
567      */
568     virtual void OnCameraWindowChange(uint32_t accessTokenId, bool isShowing) = 0;
569 };
570 
571 /**
572  * @class IDisplayInfoChangedListener
573  *
574  * @brief Listener to observe display information changed.
575  */
576 class IDisplayInfoChangedListener : virtual public RefBase {
577 public:
578     /**
579      * @brief Notify caller when display information changed.
580      *
581      * @param token token of ability.
582      * @param displayId ID of the display where the main window of the ability is located.
583      * @param density density of the display where the main window of the ability is located.
584      * @param orientation orientation of the display where the main window of the ability is located.
585      */
586     virtual void OnDisplayInfoChange(const sptr<IRemoteObject>& token,
587         DisplayId displayId, float density, DisplayOrientation orientation) = 0;
588 };
589 
590 /**
591  * @class IPiPStateChangedListener
592  *
593  * @brief Listener to observe PiP State changed.
594  */
595 class IPiPStateChangedListener : virtual public RefBase {
596 public:
597     /**
598      * @brief Notify caller when PiP State changed.
599      *
600      * @param bundleName the name of the bundle in PiP state changed.
601      * @param isForeground the state of the bundle in PiP State.
602      */
603     virtual void OnPiPStateChanged(const std::string& bundleName, bool isForeground) = 0;
604 };
605 
606 /**
607  * @class WindowManager
608  *
609  * @brief WindowManager used to manage window.
610  */
611 class WindowManager {
612 WM_DECLARE_SINGLE_INSTANCE_BASE(WindowManager);
613 friend class WindowManagerAgent;
614 friend class WMSDeathRecipient;
615 friend class SSMDeathRecipient;
616 public:
617     /**
618      * @brief Register WMS connection status changed listener.
619      * @attention Callable only by u0 system user. A process only supports successful registration once.
620      * When the foundation service restarts, you need to re-register the listener.
621      * If you want to re-register, please call UnregisterWMSConnectionChangedListener first.
622      *
623      * @param listener IWMSConnectionChangedListener.
624      * @return WM_OK means register success, others means register failed.
625      */
626     WMError RegisterWMSConnectionChangedListener(const sptr<IWMSConnectionChangedListener>& listener);
627 
628     /**
629      * @brief Unregister WMS connection status changed listener.
630      * @attention Callable only by u0 system user.
631      *
632      * @return WM_OK means unregister success, others means unregister failed.
633      */
634     WMError UnregisterWMSConnectionChangedListener();
635 
636     /**
637      * @brief Register focus changed listener.
638      *
639      * @param listener IFocusChangedListener.
640      * @return WM_OK means register success, others means register failed.
641      */
642     WMError RegisterFocusChangedListener(const sptr<IFocusChangedListener>& listener);
643 
644     /**
645      * @brief Unregister focus changed listener.
646      *
647      * @param listener IFocusChangedListener.
648      * @return WM_OK means unregister success, others means unregister failed.
649      */
650     WMError UnregisterFocusChangedListener(const sptr<IFocusChangedListener>& listener);
651 
652     /**
653      * @brief Register window mode listener.
654      *
655      * @param listener IWindowModeChangedListener.
656      * @return WM_OK means register success, others means register failed.
657      */
658     WMError RegisterWindowModeChangedListener(const sptr<IWindowModeChangedListener>& listener);
659 
660     /**
661      * @brief Unregister window mode listener.
662      *
663      * @param listener IWindowModeChangedListener.
664      * @return WM_OK means unregister success, others means unregister failed.
665      */
666     WMError UnregisterWindowModeChangedListener(const sptr<IWindowModeChangedListener>& listener);
667 
668     /**
669      * @brief Get window mode type.
670      *
671      * @param void
672      * @return WM_OK means get success, others means get failed.
673      */
674     WMError GetWindowModeType(WindowModeType& windowModeType) const;
675 
676     /**
677      * @brief Register system bar changed listener.
678      *
679      * @param listener ISystemBarChangedListener.
680      * @return WM_OK means register success, others means register failed.
681      */
682     WMError RegisterSystemBarChangedListener(const sptr<ISystemBarChangedListener>& listener);
683 
684     /**
685      * @brief Unregister system bar changed listener.
686      *
687      * @param listener ISystemBarChangedListener.
688      * @return WM_OK means unregister success, others means unregister failed.
689      */
690     WMError UnregisterSystemBarChangedListener(const sptr<ISystemBarChangedListener>& listener);
691 
692     /**
693      * @brief Register window updated listener.
694      *
695      * @param listener IWindowUpdateListener.
696      * @return WM_OK means register success, others means register failed.
697      */
698     WMError RegisterWindowUpdateListener(const sptr<IWindowUpdateListener>& listener);
699 
700     /**
701      * @brief Unregister window updated listener.
702      *
703      * @param listener IWindowUpdateListener.
704      * @return WM_OK means unregister success, others means unregister failed.
705      */
706     WMError UnregisterWindowUpdateListener(const sptr<IWindowUpdateListener>& listener);
707 
708     /**
709      * @brief Register visibility changed listener.
710      *
711      * @param listener IVisibilityChangedListener.
712      * @return WM_OK means register success, others means register failed.
713      */
714     WMError RegisterVisibilityChangedListener(const sptr<IVisibilityChangedListener>& listener);
715 
716     /**
717      * @brief Unregister visibility changed listener.
718      *
719      * @param listener IVisibilityChangedListener.
720      * @return WM_OK means unregister success, others means unregister failed.
721      */
722     WMError UnregisterVisibilityChangedListener(const sptr<IVisibilityChangedListener>& listener);
723 
724     /**
725      * @brief Register drawingcontent changed listener.
726      *
727      * @param listener IDrawingContentChangedListener.
728      * @return WM_OK means register success, others means register failed.
729      */
730     WMError RegisterDrawingContentChangedListener(const sptr<IDrawingContentChangedListener>& listener);
731 
732     /**
733      * @brief Unregister drawingcontent changed listener.
734      *
735      * @param listener IDrawingContentChangedListener.
736      * @return WM_OK means unregister success, others means unregister failed.
737      */
738     WMError UnregisterDrawingContentChangedListener(const sptr<IDrawingContentChangedListener>& listener);
739 
740     /**
741      * @brief Register camera float window changed listener.
742      *
743      * @param listener ICameraFloatWindowChangedListener.
744      * @return WM_OK means register success, others means register failed.
745      */
746     WMError RegisterCameraFloatWindowChangedListener(const sptr<ICameraFloatWindowChangedListener>& listener);
747 
748     /**
749      * @brief Unregister camera float window changed listener.
750      *
751      * @param listener ICameraFloatWindowChangedListener.
752      * @return WM_OK means unregister success, others means unregister failed.
753      */
754     WMError UnregisterCameraFloatWindowChangedListener(const sptr<ICameraFloatWindowChangedListener>& listener);
755 
756     /**
757      * @brief Register water mark flag changed listener.
758      *
759      * @param listener IWaterMarkFlagChangedListener.
760      * @return WM_OK means register success, others means register failed.
761      */
762     WMError RegisterWaterMarkFlagChangedListener(const sptr<IWaterMarkFlagChangedListener>& listener);
763 
764     /**
765      * @brief Unregister water mark flag changed listener.
766      *
767      * @param listener IWaterMarkFlagChangedListener.
768      * @return WM_OK means unregister success, others means unregister failed.
769      */
770     WMError UnregisterWaterMarkFlagChangedListener(const sptr<IWaterMarkFlagChangedListener>& listener);
771 
772     /**
773      * @brief Register gesture navigation enabled changed listener.
774      *
775      * @param listener IGestureNavigationEnabledChangedListener.
776      * @return WM_OK means register success, others means register failed.
777      */
778     WMError RegisterGestureNavigationEnabledChangedListener(
779         const sptr<IGestureNavigationEnabledChangedListener>& listener);
780 
781     /**
782      * @brief Unregister gesture navigation enabled changed listener.
783      *
784      * @param listener IGestureNavigationEnabledChangedListener.
785      * @return WM_OK means unregister success, others means unregister failed.
786      */
787     WMError UnregisterGestureNavigationEnabledChangedListener(
788         const sptr<IGestureNavigationEnabledChangedListener>& listener);
789 
790     /**
791      * @brief register display information changed listener.
792      *
793      * @param token token of ability.
794      * @param listener IDisplayInfoChangedListener.
795      * @return WM_OK means register success, others means register failed.
796      */
797     WMError RegisterDisplayInfoChangedListener(const sptr<IRemoteObject>& token,
798         const sptr<IDisplayInfoChangedListener>& listener);
799 
800     /**
801      * @brief unregister display info changed listener.Before the ability is destroyed, the
802      * UnregisterDisplayInfoChangedListener interface must be invoked.
803      * Otherwise, the sptr token may be destroyed abnormally.
804      *
805      * @param token token of ability.
806      * @param listener IDisplayInfoChangedListener.
807      * @return WM_OK means unregister success, others means unregister failed.
808      */
809     WMError UnregisterDisplayInfoChangedListener(const sptr<IRemoteObject>& token,
810         const sptr<IDisplayInfoChangedListener>& listener);
811 
812     /**
813      * @brief Register window in same pid visibility changed listener.
814      * @caller SA
815      * @permission SA permission
816      *
817      * @param listener IWindowPidVisibilityChangedListener.
818      * @return WM_OK means register success, others means register failed.
819      */
820     WMError RegisterWindowPidVisibilityChangedListener(const sptr<IWindowPidVisibilityChangedListener>& listener);
821 
822     /**
823      * @brief Unregister window in same pid visibility changed listener.
824      *
825      * @param listener IWindowPidVisibilityChangedListener.
826      * @return WM_OK means unregister success, others means unregister failed.
827      */
828     WMError UnregisterWindowPidVisibilityChangedListener(const sptr<IWindowPidVisibilityChangedListener>& listener);
829 
830     /*
831      * @brief Register window System Bar property changed Listener.
832      *
833      * @param listener IWindowSystemBarPropertyChangedListener.
834      * @return WM_OK means register success, others means register failed.
835      */
836     WMError RegisterWindowSystemBarPropertyChangedListener(
837         const sptr<IWindowSystemBarPropertyChangedListener>& listener);
838 
839     /*
840      * @brief Unregister window System Bar property changed Listener.
841      *
842      * @param listener IWindowSystemBarPropertyChangedListener.
843      * @return WM_OK means unregister success, others means unregister failed.
844      */
845     WMError UnregisterWindowSystemBarPropertyChangedListener(
846         const sptr<IWindowSystemBarPropertyChangedListener>& listener);
847 
848     /*
849      * @brief Notify window System Bar property changed.
850      *
851      * @param type Type of System Bar
852      * @param systemBarProperty Property of System Bar
853      */
854     void NotifyWindowSystemBarPropertyChange(WindowType type, const SystemBarProperty& systemBarProperty);
855 
856     /**
857      * @brief notify display information change.
858      *
859      * @param token ability token.
860      * @param displayid ID of the display where the main window of the ability is located
861      * @param density density of the display where the main window of the ability is located.
862      * @param orientation orientation of the display where the main window of the ability is located.
863      * @return WM_OK means notify success, others means notify failed.
864     */
865     WMError NotifyDisplayInfoChange(const sptr<IRemoteObject>& token, DisplayId displayId,
866         float density, DisplayOrientation orientation);
867 
868     /**
869      * @brief notify window info change.
870      *
871      * @param flags mark the changed value.
872      * @param windowInfoList the changed window info list.
873      * @return WM_OK means notify success, others means notify failed.
874      */
875     void NotifyWindowPropertyChange(uint32_t propertyDirtyFlags,
876         const std::vector<std::unordered_map<WindowInfoKey, WindowChangeInfoType>>& windowInfoList);
877 
878     /**
879      * @brief Minimize all app window.
880      *
881      * @param displayId Display id.
882      * @return WM_OK means minimize success, others means minimize failed.
883      */
884     WMError MinimizeAllAppWindows(DisplayId displayId);
885 
886     /**
887      * @brief Toggle all app windows to the foreground.
888      *
889      * @return WM_OK means toggle success, others means toggle failed.
890      */
891     WMError ToggleShownStateForAllAppWindows();
892 
893     /**
894      * @brief Set window layout mode.
895      *
896      * @param mode Window layout mode.
897      * @return WM_OK means set success, others means set failed.
898      */
899     WMError SetWindowLayoutMode(WindowLayoutMode mode);
900 
901     /**
902      * @brief Get accessibility window info.
903      *
904      * @param infos WindowInfos used for Accessibility.
905      * @return WM_OK means get success, others means get failed.
906      */
907     WMError GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>>& infos) const;
908 
909     /**
910      * @brief Get unreliable window info.
911      *
912      * @param infos Unreliable Window Info.
913      * @return WM_OK means get success, others means get failed.
914      */
915     WMError GetUnreliableWindowInfo(int32_t windowId,
916         std::vector<sptr<UnreliableWindowInfo>>& infos) const;
917 
918     /**
919      * @brief List window info.
920      *
921      * @param windowInfoOption Option for selecting window info.
922      * @param infos Window info.
923      * @return WM_OK means get success, others means get failed.
924      */
925     WMError ListWindowInfo(const WindowInfoOption& windowInfoOption, std::vector<sptr<WindowInfo>>& infos) const;
926 
927     /**
928      * @brief Get window layout info.
929      *
930      * @param displayId DisplayId of which display to get window layout infos.
931      * @param infos Window layout infos.
932      * @return WM_OK means get success, others means get failed.
933      */
934     WMError GetAllWindowLayoutInfo(DisplayId displayId, std::vector<sptr<WindowLayoutInfo>>& infos) const;
935 
936     /**
937      * @brief Get global window mode.
938      *
939      * @param displayId DisplayId of which display to get window mode, DISPLAY_ID_INVALID means all displays.
940      * @param globalWinMode Global window mode flag of specified display or all displays.
941      * @return WM_OK means get success, others means get failed.
942      */
943     WMError GetGlobalWindowMode(DisplayId displayId, GlobalWindowMode& globalWinMode) const;
944 
945     /**
946      * @brief Get the name of the top page.
947      *
948      * @param windowId Window id which want to get.
949      * @param topNavDestName The top page name of specified window.
950      * @return WM_OK means get success, others means get failed.
951      */
952     WMError GetTopNavDestinationName(int32_t windowId, std::string& topNavDestName) const;
953 
954     /**
955      * @brief Get visibility window info.
956      *
957      * @param infos Visible window infos
958      * @return WM_OK means get success, others means get failed.
959      */
960     WMError GetVisibilityWindowInfo(std::vector<sptr<WindowVisibilityInfo>>& infos) const;
961 
962     /**
963      * @brief Set gesture navigation enabled.
964      *
965      * @param enable True means set gesture on, false means set gesture off.
966      * @return WM_OK means set success, others means set failed.
967      */
968     WMError SetGestureNavigationEnabled(bool enable) const;
969 
970     /**
971      * @brief Get focus window.
972      *
973      * @param focusInfo Focus window info.
974      * @return FocusChangeInfo object about focus window.
975      */
976     void GetFocusWindowInfo(FocusChangeInfo& focusInfo, DisplayId displayId = DEFAULT_DISPLAY_ID);
977 
978     /**
979      * @brief Dump all session info
980      *
981      * @param infos session infos
982      * @return WM_OK means set success, others means set failed.
983      */
984     WMError DumpSessionAll(std::vector<std::string>& infos);
985 
986     /**
987      * @brief Dump session info with id
988      *
989      * @param infos session infos
990      * @return WM_OK means set success, others means set failed.
991      */
992     WMError DumpSessionWithId(int32_t persistentId, std::vector<std::string>& infos);
993 
994     /**
995      * @brief Get uiContent remote object
996      *
997      * @param windowId windowId
998      * @param uiContentRemoteObj uiContentRemoteObj
999      * @return WM_OK if successfully retrieved uiContentRemoteObj
1000      */
1001     WMError GetUIContentRemoteObj(int32_t windowId, sptr<IRemoteObject>& uiContentRemoteObj);
1002 
1003     /**
1004      * @brief raise window to top by windowId
1005      *
1006      * @param persistentId this window to raise
1007      * @return WM_OK if raise success
1008      */
1009     WMError RaiseWindowToTop(int32_t persistentId);
1010 
1011     /**
1012      * @brief notify window extension visibility change
1013      *
1014      * @param pid process id
1015      * @param uid user id
1016      * @param visible visibility
1017      * @return WM_OK means notify success, others means notify failed.
1018      */
1019     WMError NotifyWindowExtensionVisibilityChange(int32_t pid, int32_t uid, bool visible);
1020 
1021     /**
1022      * @brief Shift window focus within the same application. Only main window and subwindow.
1023      *
1024      * @param sourcePersistentId Window id which the focus shift from
1025      * @param targetPersistentId Window id which the focus shift to
1026      * @return WM_OK means shift window focus success, others means failed.
1027      */
1028     WMError ShiftAppWindowFocus(int32_t sourcePersistentId, int32_t targetPersistentId);
1029 
1030     /**
1031      * @brief Set start window background color.
1032      *
1033      * @param moduleName Module name that needs to be set
1034      * @param abilityName Ability name that needs to be set
1035      * @param color Color metrics
1036      * @return WM_OK means set start window background color success, others means failed.
1037      */
1038     WMError SetStartWindowBackgroundColor(
1039         const std::string& moduleName, const std::string& abilityName, uint32_t color);
1040 
1041     /**
1042      * @brief Get snapshot by window id.
1043      *
1044      * @param windowId Window id which want to snapshot.
1045      * @param pixelMap Snapshot output pixel map.
1046      * @return WM_OK means get snapshot success, others means failed.
1047      */
1048     WMError GetSnapshotByWindowId(int32_t windowId, std::shared_ptr<Media::PixelMap>& pixelMap);
1049 
1050     /**
1051      * @brief Register visible main window num changed listener.
1052      *
1053      * @param listener IVisibleWindowNumChangedListener.
1054      * @return WM_OK means register success, others means register failed.
1055      */
1056     WMError RegisterVisibleWindowNumChangedListener(const sptr<IVisibleWindowNumChangedListener>& listener);
1057 
1058     /**
1059      * @brief Unregister visible main window num changed listener.
1060      *
1061      * @param listener IVisibleWindowNumChangedListener.
1062      * @return WM_OK means unregister success, others means unregister failed.
1063      */
1064     WMError UnregisterVisibleWindowNumChangedListener(const sptr<IVisibleWindowNumChangedListener>& listener);
1065 
1066     /**
1067      * @brief Register WindowStyle changed listener.
1068      *
1069      * @param listener IWindowStyleChangedListener
1070      * @return WM_OK means register success, others means unregister failed.
1071      */
1072     WMError RegisterWindowStyleChangedListener(const sptr<IWindowStyleChangedListener>& listener);
1073 
1074     /**
1075      * @brief Unregister WindowStyle changed listener.
1076      *
1077      * @param listener IWindowStyleChangedListener
1078      * @return WM_OK means unregister success, others means unregister failed.
1079      */
1080     WMError UnregisterWindowStyleChangedListener(const sptr<IWindowStyleChangedListener>& listener);
1081 
1082     /**
1083      * @brief Register a listener to detect display changes for the keyboard calling window.
1084      *
1085      * @param listener IKeyboardCallingWindowDisplayChangedListener
1086      * @return WM_OK means register success, others means unregister failed.
1087      */
RegisterCallingWindowDisplayChangedListener(const sptr<IKeyboardCallingWindowDisplayChangedListener> & listener)1088     WMError RegisterCallingWindowDisplayChangedListener(
1089         const sptr<IKeyboardCallingWindowDisplayChangedListener>& listener)
1090     {
1091         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
1092     }
1093 
1094     /**
1095      * @brief Unregister the listener that detects display changes for the keyboard calling window.
1096      *
1097      * @param listener IKeyboardCallingWindowDisplayChangedListener
1098      * @return WM_OK means unregister success, others means unregister failed.
1099      */
UnregisterCallingWindowDisplayChangedListener(const sptr<IKeyboardCallingWindowDisplayChangedListener> & listener)1100     WMError UnregisterCallingWindowDisplayChangedListener(
1101         const sptr<IKeyboardCallingWindowDisplayChangedListener>& listener)
1102     {
1103         return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
1104     }
1105 
1106     /**
1107      * @brief Skip Snapshot for app process.
1108      *
1109      * @param pid process id
1110      * @param skip True means skip, false means not skip.
1111      * @return WM_OK means snapshot skip success, others means snapshot skip failed.
1112      */
1113     WMError SkipSnapshotForAppProcess(int32_t pid, bool skip);
1114 
1115     /**
1116      * @brief Get window style type.
1117      *
1118      * @param windowStyleType WindowType
1119      * @return @return WM_OK means get window style success, others means failed.
1120      */
1121     WindowStyleType GetWindowStyleType();
1122 
1123     /**
1124      * @brief set process watermark.
1125      *
1126      * @param pid pid
1127      * @param watermarkName watermark picture name
1128      * @param isEnabled add or remove
1129      * @return WM_OK means set process watermark success, others means failed.
1130      */
1131     WMError SetProcessWatermark(int32_t pid, const std::string& watermarkName, bool isEnabled);
1132 
1133     /**
1134      * @brief Get window ids by coordinate.
1135      *
1136      * @param displayId display id
1137      * @param windowNumber indicates the number of query windows
1138      * @param x x-coordinate of the window
1139      * @param y y-coordinate of the window
1140      * @param windowIds array of window id
1141      * @return WM_OK means get success, others means get failed.
1142      */
1143     WMError GetWindowIdsByCoordinate(DisplayId displayId, int32_t windowNumber,
1144         int32_t x, int32_t y, std::vector<int32_t>& windowIds) const;
1145 
1146     /**
1147      * @brief Update screen lock status for app.
1148      *
1149      * @param bundleName BundleName of specific app
1150      * @param isRelease True means screen lock, false means reLock screen lock
1151      * @return WM_OK means update success, others means failed.
1152      */
1153     WMError UpdateScreenLockStatusForApp(const std::string& bundleName, bool isRelease);
1154 
1155     /**
1156      * @brief Get displayId by windowId.
1157      *
1158      * @param windowIds list of window ids that need to get screen ids
1159      * @param windowDisplayIdMap map of windows and displayIds
1160      * @return WM_OK means get success, others means failed.
1161      */
1162     WMError GetDisplayIdByWindowId(const std::vector<uint64_t>& windowIds,
1163         std::unordered_map<uint64_t, DisplayId>& windowDisplayIdMap);
1164 
1165     /**
1166      * @brief Set global drag resize type.
1167      * this priority is highest.
1168      *
1169      * @param dragResizeType global drag resize type to set
1170      * @return WM_OK means get success, others means failed.
1171      */
1172     WMError SetGlobalDragResizeType(DragResizeType dragResizeType);
1173 
1174     /**
1175      * @brief Get global drag resize type.
1176      * if it is RESIZE_TYPE_UNDEFINED, return default value.
1177      *
1178      * @param dragResizeType global drag resize type to get
1179      * @return WM_OK means get success, others means failed.
1180      */
1181     WMError GetGlobalDragResizeType(DragResizeType& dragResizeType);
1182 
1183     /**
1184      * @brief Set drag resize type of specific app.
1185      * only when global value is RESIZE_TYPE_UNDEFINED, this value take effect.
1186      *
1187      * @param bundleName bundleName of specific app
1188      * @param dragResizeType drag resize type to set
1189      * @return WM_OK means get success, others means failed.
1190      */
1191     WMError SetAppDragResizeType(const std::string& bundleName, DragResizeType dragResizeType);
1192 
1193     /**
1194      * @brief Get drag resize type of specific app.
1195      * effective order:
1196      *  1. global value
1197      *  2. app value
1198      *  3. default value
1199      *
1200      * @param bundleName bundleName of specific app
1201      * @param dragResizeType drag resize type to get
1202      * @return WM_OK means get success, others means failed.
1203      */
1204     WMError GetAppDragResizeType(const std::string& bundleName, DragResizeType& dragResizeType);
1205 
1206     /**
1207      * @brief Set drag key frame type of specific app.
1208      * effective order:
1209      *  1. resize when drag
1210      *  2. key frame
1211      *  3. default value
1212      *
1213      * @param bundleName bundleName of specific app
1214      * @param keyFramePolicy param of key frame
1215      * @return WM_OK means get success, others means failed.
1216      */
1217     WMError SetAppKeyFramePolicy(const std::string& bundleName, const KeyFramePolicy& keyFramePolicy);
1218 
1219     /**
1220      * @brief Shift window pointer event within the same application. Only main window and subwindow.
1221      *
1222      * @param sourceWindowId Window id which the pointer event shift from
1223      * @param targetWindowId Window id which the pointer event shift to
1224      * @param fingerId finger id of the event to be shift
1225      * @return WM_OK means shift window pointer event success, others means failed.
1226      */
1227     WMError ShiftAppWindowPointerEvent(int32_t sourceWindowId, int32_t targetWindowId, int32_t fingerId = -1);
1228 
1229     /**
1230      * @brief Notify screenshot event.
1231      *
1232      * @param type screenshot event type.
1233      * @return WM_OK means set success, others means set failed.
1234      */
1235     WMError NotifyScreenshotEvent(ScreenshotEventType type);
1236 
1237     /**
1238      * @brief Request focus.
1239      *
1240      * @param persistentId previous window id
1241      * @param isFocused true if request focus, otherwise false, default is true
1242      * @param byForeground true if by foreground, otherwise false, default is true
1243      * @param reason the reason for requesting focus, default is SA_REQUEST
1244      * @return WM_OK means request focus success, others means failed.
1245      */
1246     WMError RequestFocus(int32_t persistentId, bool isFocused = true,
1247         bool byForeground = true, WindowFocusChangeReason reason = WindowFocusChangeReason::SA_REQUEST);
1248 
1249     /**
1250      * @brief Minimize window within the vector of windowid, Only main window.
1251      *
1252      * @param WindowId window id which to minimize
1253      * @return WM_OK means window minimize event success, others means failed.
1254      */
1255     WMError MinimizeByWindowId(const std::vector<int32_t>& windowIds);
1256 
1257     /**
1258      * @brief Set foreground window number. Only main window. Only support freeMultiWindow.
1259      *
1260      * @param windowNum foreground window number
1261      * @return WM_OK means set success, others means failed.
1262      */
1263     WMError SetForegroundWindowNum(uint32_t windowNum);
1264 
1265     /**
1266      * @brief Register window info change callback.
1267      *
1268      * @param observedInfo Property which to observe.
1269      * @param listener Listener to observe window info.
1270      * @return WM_OK means register success, others means failed.
1271      */
1272     WMError RegisterWindowInfoChangeCallback(const std::unordered_set<WindowInfoKey>& observedInfo,
1273         const sptr<IWindowInfoChangedListener>& listener);
1274 
1275     /**
1276      * @brief Unregister window info change callback.
1277      *
1278      * @param observedInfo Property which to observe.
1279      * @param listener Listener to observe window info.
1280      * @return WM_OK means unregister success, others means failed.
1281      */
1282     WMError UnregisterWindowInfoChangeCallback(const std::unordered_set<WindowInfoKey>& observedInfo,
1283         const sptr<IWindowInfoChangedListener>& listener);
1284 
1285     /**
1286      * @brief Whether new requested window needs hook.
1287      *
1288      * @param isModuleAbilityHookEnd Whether this module finished ability hook.
1289      * @param moduleName Indicates the hooked moduleName.
1290      * @return bool means the module finished ability hook or not.
1291      */
1292     bool IsModuleHookOff(bool isModuleAbilityHookEnd, const std::string& moduleName);
1293 
1294     /**
1295      * @brief set the animation property and parameter to the corresponding window.
1296      *
1297      * @param windowId target window id.
1298      * @param animationProperty the property of animation.
1299      * @param animationOption the option of animation.
1300      * @return WM_OK means set success, others means failed.
1301      */
1302     WMError AnimateTo(int32_t windowId, WindowAnimationProperty animationProperty,
1303         WindowAnimationOption animationOption);
1304 
1305     /**
1306      * @brief Register window lifecycle status changed callback.
1307      * @param listener IWindowLifeCycleListener.
1308      * @return WM_OK means register success, others means register failed.
1309      */
1310     WMError RegisterWindowLifeCycleCallback(const sptr<IWindowLifeCycleListener>& listener);
1311 
1312     /**
1313      * @brief Unregister window lifecycle status changed callback.
1314      * @param listener IWindowLifeCycleListener.
1315      * @return WM_OK means unregister success, others means unregister failed.
1316      */
1317     WMError UnregisterWindowLifeCycleCallback(const sptr<IWindowLifeCycleListener>& listener);
1318 
1319     /**
1320      * @brief Register get js window callback.
1321      * @param getJSWindowFunc get js window obj callback.
1322      */
1323     void RegisterGetJSWindowCallback(GetJSWindowObjFunc&& getJSWindowFunc);
1324 
1325     /**
1326      * @brief notify window destroyed.
1327      * @param lifeCycleInfo window lifecycle info.
1328      */
1329     void NotifyWMSWindowDestroyed(const WindowLifeCycleInfo& lifeCycleInfo);
1330 
1331     /**
1332      * @brief Add BundleNames to the list that will hide on virtual screen.
1333      * @param bundleNames BundleNames that need to add.
1334      * @param privacyWindowTags Tags of privacy window.
1335      * @return WM_OK means add success, others means add failed.
1336      */
1337     WMError AddSessionBlackList(
1338         const std::unordered_set<std::string>& bundleNames, const std::unordered_set<std::string>& privacyWindowTags);
1339 
1340     /**
1341      * @brief Remove BundleNames from the list that will hide on virtual screen.
1342      * @param bundleNames BundleNames that need to remove.
1343      * @param privacyWindowTags Tags of privacy window.
1344      * @return WM_OK means remove success, others means remove failed.
1345      */
1346     WMError RemoveSessionBlackList(
1347         const std::unordered_set<std::string>& bundleNames, const std::unordered_set<std::string>& privacyWindowTags);
1348 
1349 private:
1350     WindowManager();
1351     ~WindowManager();
1352     std::recursive_mutex mutex_;
1353     class Impl;
1354     std::unique_ptr<Impl> pImpl_;
1355     bool destroyed_ = false;
1356     std::unordered_set<std::string> isModuleHookOffSet_;
1357     std::unordered_map<WindowInfoKey, uint32_t> interestInfoMap_;
1358     GetJSWindowObjFunc getJSWindowObjFunc_;
1359 
1360     void OnWMSConnectionChanged(int32_t userId, int32_t screenId, bool isConnected) const;
1361     void UpdateFocusStatus(uint32_t windowId, const sptr<IRemoteObject>& abilityToken, WindowType windowType,
1362         DisplayId displayId, bool focused) const;
1363     void UpdateFocusChangeInfo(const sptr<FocusChangeInfo>& focusChangeInfo, bool focused) const;
1364     void UpdateWindowModeTypeInfo(WindowModeType type) const;
1365     void UpdateSystemBarRegionTints(DisplayId displayId, const SystemBarRegionTints& tints) const;
1366     void NotifyAccessibilityWindowInfo(const std::vector<sptr<AccessibilityWindowInfo>>& infos,
1367         WindowUpdateType type) const;
1368     void UpdateWindowVisibilityInfo(
1369         const std::vector<sptr<WindowVisibilityInfo>>& windowVisibilityInfos) const;
1370     void UpdateWindowDrawingContentInfo(
1371         const std::vector<sptr<WindowDrawingContentInfo>>& windowDrawingContentInfos) const;
1372     void UpdateCameraFloatWindowStatus(uint32_t accessTokenId, bool isShowing) const;
1373     void NotifyWaterMarkFlagChangedResult(bool showWaterMark) const;
1374     void NotifyGestureNavigationEnabledResult(bool enable) const;
1375     void UpdateVisibleWindowNum(const std::vector<VisibleWindowNumInfo>& visibleWindowNumInfo);
1376     WMError NotifyWindowStyleChange(WindowStyleType type);
1377     void NotifyWindowPidVisibilityChanged(const sptr<WindowPidVisibilityInfo>& info) const;
1378     WMError ProcessRegisterWindowInfoChangeCallback(WindowInfoKey observedInfo,
1379         const sptr<IWindowInfoChangedListener>& listener);
1380     WMError ProcessUnregisterWindowInfoChangeCallback(WindowInfoKey observedInfo,
1381         const sptr<IWindowInfoChangedListener>& listener);
1382     WMError RegisterVisibilityStateChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1383     WMError UnregisterVisibilityStateChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1384     WMError RegisterDisplayIdChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1385     WMError UnregisterDisplayIdChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1386     WMError RegisterRectChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1387     WMError UnregisterRectChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1388     WMError RegisterWindowModeChangedListenerForPropertyChange(const sptr<IWindowInfoChangedListener>& listener);
1389     WMError UnregisterWindowModeChangedListenerForPropertyChange(const sptr<IWindowInfoChangedListener>& listener);
1390     WMError RegisterFloatingScaleChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1391     WMError UnregisterFloatingScaleChangedListener(const sptr<IWindowInfoChangedListener>& listener);
1392     void SetIsModuleHookOffToSet(const std::string& moduleName);
1393     bool GetIsModuleHookOffFromSet(const std::string& moduleName);
1394 };
1395 } // namespace Rosen
1396 } // namespace OHOS
1397 
1398 #endif // OHOS_ROSEN_WINDOW_MANAGER_H
1399