• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #include "window_impl.h"
17 #include "window_manager_hilog.h"
18 
19 namespace OHOS {
20 namespace Rosen {
21 std::map<std::string, std::pair<uint32_t, sptr<Window>>> WindowImpl::windowMap_;
22 std::map<uint32_t, std::vector<sptr<WindowImpl>>> WindowImpl::subWindowMap_;
23 static int constructorCnt = 0;
24 static int deConstructorCnt = 0;
WindowImpl(const sptr<WindowOption> & option)25 WindowImpl::WindowImpl(const sptr<WindowOption>& option)
26 {
27     property_ = new (std::nothrow) WindowProperty();
28     property_->SetWindowName(option->GetWindowName());
29     property_->SetRequestRect(option->GetWindowRect());
30     property_->SetWindowType(option->GetWindowType());
31     property_->SetWindowMode(option->GetWindowMode());
32     property_->SetFullScreen(option->GetWindowMode() == WindowMode::WINDOW_MODE_FULLSCREEN);
33     property_->SetFocusable(option->GetFocusable());
34     property_->SetTouchable(option->GetTouchable());
35     property_->SetDisplayId(option->GetDisplayId());
36     property_->SetCallingWindow(option->GetCallingWindow());
37     property_->SetWindowFlags(option->GetWindowFlags());
38     property_->SetHitOffset(option->GetHitOffset());
39     property_->SetRequestedOrientation(option->GetRequestedOrientation());
40     property_->SetTurnScreenOn(option->IsTurnScreenOn());
41     property_->SetKeepScreenOn(option->IsKeepScreenOn());
42     property_->SetBrightness(option->GetBrightness());
43     auto& sysBarPropMap = option->GetSystemBarProperty();
44     for (auto it : sysBarPropMap) {
45         property_->SetSystemBarProperty(it.first, it.second);
46     }
47     name_ = option->GetWindowName();
48 
49     WLOGFI("WindowImpl constructorCnt: %{public}d name: %{public}s",
50         ++constructorCnt, property_->GetWindowName().c_str());
51 }
52 
~WindowImpl()53 WindowImpl::~WindowImpl()
54 {
55     WLOGFI("windowName: %{public}s, windowId: %{public}d, deConstructorCnt: %{public}d",
56         GetWindowName().c_str(), GetWindowId(), ++deConstructorCnt);
57     Destroy();
58 }
59 
Find(const std::string & name)60 sptr<Window> WindowImpl::Find(const std::string& name)
61 {
62     auto iter = windowMap_.find(name);
63     if (iter == windowMap_.end()) {
64         return nullptr;
65     }
66     return iter->second.second;
67 }
68 
GetContext() const69 const std::shared_ptr<AbilityRuntime::Context> WindowImpl::GetContext() const
70 {
71     return nullptr;
72 }
73 
GetTopWindowWithId(uint32_t mainWinId)74 sptr<Window> WindowImpl::GetTopWindowWithId(uint32_t mainWinId)
75 {
76     if (windowMap_.empty()) {
77         WLOGFE("Please create mainWindow First!");
78         return nullptr;
79     }
80     for (auto iter = windowMap_.begin(); iter != windowMap_.end(); iter++) {
81         if (mainWinId == iter->second.first) {
82             WLOGFI("FindTopWindow id: %{public}u", mainWinId);
83             return iter->second.second;
84         }
85     }
86     WLOGFE("Cannot find topWindow!");
87 }
88 
GetTopWindowWithContext(const std::shared_ptr<AbilityRuntime::Context> & context)89 sptr<Window> WindowImpl::GetTopWindowWithContext(const std::shared_ptr<AbilityRuntime::Context>& context)
90 {
91     if (windowMap_.empty()) {
92         WLOGFE("Please create mainWindow First!");
93         return nullptr;
94     }
95     uint32_t mainWinId = INVALID_WINDOW_ID;
96     WLOGFI("GetTopWindowfinal MainWinId:%{public}u!", mainWinId);
97     if (mainWinId == INVALID_WINDOW_ID) {
98         WLOGFE("Cannot find topWindow!");
99         return nullptr;
100     }
101     return GetTopWindowWithId(mainWinId);
102 }
103 
GetSubWindow(uint32_t parentId)104 std::vector<sptr<Window>> WindowImpl::GetSubWindow(uint32_t parentId)
105 {
106     if (subWindowMap_.find(parentId) == subWindowMap_.end()) {
107         WLOGFE("Cannot parentWindow with id: %{public}u!", parentId);
108         return std::vector<sptr<Window>>();
109     }
110     return std::vector<sptr<Window>>(subWindowMap_[parentId].begin(), subWindowMap_[parentId].end());
111 }
112 
UpdateConfigurationForAll(const std::shared_ptr<AppExecFwk::Configuration> & configuration)113 void WindowImpl::UpdateConfigurationForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration)
114 {
115     for (const auto& winPair : windowMap_) {
116         auto window = winPair.second.second;
117         window->UpdateConfiguration(configuration);
118     }
119 }
120 
GetSurfaceNode() const121 std::shared_ptr<RSSurfaceNode> WindowImpl::GetSurfaceNode() const
122 {
123     return nullptr;
124 }
125 
GetRect() const126 Rect WindowImpl::GetRect() const
127 {
128     return property_->GetWindowRect();
129 }
130 
GetRequestRect() const131 Rect WindowImpl::GetRequestRect() const
132 {
133     return property_->GetRequestRect();
134 }
135 
GetType() const136 WindowType WindowImpl::GetType() const
137 {
138     return property_->GetWindowType();
139 }
140 
GetMode() const141 WindowMode WindowImpl::GetMode() const
142 {
143     return property_->GetWindowMode();
144 }
145 
GetAlpha() const146 float WindowImpl::GetAlpha() const
147 {
148     return property_->GetAlpha();
149 }
150 
GetWindowState() const151 WindowState WindowImpl::GetWindowState() const
152 {
153     return state_;
154 }
155 
SetFocusable(bool isFocusable)156 WMError WindowImpl::SetFocusable(bool isFocusable)
157 {
158     return WMError::WM_OK;
159 }
160 
GetFocusable() const161 bool WindowImpl::GetFocusable() const
162 {
163     return property_->GetFocusable();
164 }
165 
SetTouchable(bool isTouchable)166 WMError WindowImpl::SetTouchable(bool isTouchable)
167 {
168     return WMError::WM_OK;
169 }
170 
GetTouchable() const171 bool WindowImpl::GetTouchable() const
172 {
173     return property_->GetTouchable();
174 }
175 
GetWindowName() const176 const std::string& WindowImpl::GetWindowName() const
177 {
178     return name_;
179 }
180 
GetWindowId() const181 uint32_t WindowImpl::GetWindowId() const
182 {
183     return property_->GetWindowId();
184 }
185 
GetWindowFlags() const186 uint32_t WindowImpl::GetWindowFlags() const
187 {
188     return property_->GetWindowFlags();
189 }
190 
GetRequestModeSupportInfo() const191 uint32_t WindowImpl::GetRequestModeSupportInfo() const
192 {
193     return property_->GetRequestModeSupportInfo();
194 }
195 
IsMainHandlerAvailable() const196 bool WindowImpl::IsMainHandlerAvailable() const
197 {
198     return true;
199 }
200 
GetSystemBarPropertyByType(WindowType type) const201 SystemBarProperty WindowImpl::GetSystemBarPropertyByType(WindowType type) const
202 {
203     auto curProperties = property_->GetSystemBarProperty();
204     return curProperties[type];
205 }
206 
GetAvoidAreaByType(AvoidAreaType type,AvoidArea & avoidArea)207 WMError WindowImpl::GetAvoidAreaByType(AvoidAreaType type, AvoidArea& avoidArea)
208 {
209     return WMError::WM_OK;
210 }
211 
SetWindowType(WindowType type)212 WMError WindowImpl::SetWindowType(WindowType type)
213 {
214     return WMError::WM_OK;
215 }
216 
SetWindowMode(WindowMode mode)217 WMError WindowImpl::SetWindowMode(WindowMode mode)
218 {
219     return WMError::WM_OK;
220 }
221 
SetAlpha(float alpha)222 void WindowImpl::SetAlpha(float alpha)
223 {
224     return;
225 }
226 
SetTransform(const Transform & trans)227 void WindowImpl::SetTransform(const Transform& trans)
228 {
229     return;
230 }
231 
GetTransform() const232 const Transform& WindowImpl::GetTransform() const
233 {
234     return property_->GetTransform();
235 }
236 
AddWindowFlag(WindowFlag flag)237 WMError WindowImpl::AddWindowFlag(WindowFlag flag)
238 {
239     return WMError::WM_OK;
240 }
241 
RemoveWindowFlag(WindowFlag flag)242 WMError WindowImpl::RemoveWindowFlag(WindowFlag flag)
243 {
244     return WMError::WM_OK;
245 }
246 
SetWindowFlags(uint32_t flags)247 WMError WindowImpl::SetWindowFlags(uint32_t flags)
248 {
249     return WMError::WM_OK;
250 }
251 
OnNewWant(const AAFwk::Want & want)252 void WindowImpl::OnNewWant(const AAFwk::Want& want)
253 {
254     return;
255 }
256 
SetUIContent(const std::string & contentInfo,NativeEngine * engine,NativeValue * storage,bool isdistributed,AppExecFwk::Ability * ability)257 WMError WindowImpl::SetUIContent(const std::string& contentInfo,
258     NativeEngine* engine, NativeValue* storage, bool isdistributed, AppExecFwk::Ability* ability)
259 {
260     return WMError::WM_OK;
261 }
262 
GetUIContent() const263 Ace::UIContent* WindowImpl::GetUIContent() const
264 {
265     return uiContent_.get();
266 }
267 
GetContentInfo()268 std::string WindowImpl::GetContentInfo()
269 {
270     return "";
271 }
272 
IsSupportWideGamut()273 bool WindowImpl::IsSupportWideGamut()
274 {
275     return true;
276 }
277 
SetColorSpace(ColorSpace colorSpace)278 void WindowImpl::SetColorSpace(ColorSpace colorSpace)
279 {
280     return;
281 }
282 
GetColorSpace()283 ColorSpace WindowImpl::GetColorSpace()
284 {
285     return ColorSpace::COLOR_SPACE_DEFAULT;
286 }
287 
Snapshot()288 std::shared_ptr<Media::PixelMap> WindowImpl::Snapshot()
289 {
290     return nullptr;
291 }
292 
DumpInfo(const std::vector<std::string> & params,std::vector<std::string> & info)293 void WindowImpl::DumpInfo(const std::vector<std::string>& params, std::vector<std::string>& info)
294 {
295     return;
296 }
297 
SetSystemBarProperty(WindowType type,const SystemBarProperty & property)298 WMError WindowImpl::SetSystemBarProperty(WindowType type, const SystemBarProperty& property)
299 {
300     return WMError::WM_OK;
301 }
302 
SetLayoutFullScreen(bool status)303 WMError WindowImpl::SetLayoutFullScreen(bool status)
304 {
305     return WMError::WM_OK;
306 }
307 
SetFullScreen(bool status)308 WMError WindowImpl::SetFullScreen(bool status)
309 {
310     return WMError::WM_OK;
311 }
312 
Create(uint32_t parentId,const std::shared_ptr<AbilityRuntime::Context> & context)313 WMError WindowImpl::Create(uint32_t parentId, const std::shared_ptr<AbilityRuntime::Context>& context)
314 {
315     WLOGFI("[Client] Window [name:%{public}s] Create", name_.c_str());
316     // check window name, same window names are forbidden
317     if (windowMap_.find(name_) != windowMap_.end()) {
318         WLOGFE("WindowName(%{public}s) already exists.", name_.c_str());
319         return WMError::WM_ERROR_INVALID_PARAM;
320     }
321     // check parent id, if create sub window and there is not exist parent Window, then return
322     if (parentId != INVALID_WINDOW_ID) {
323         for (const auto& winPair : windowMap_) {
324             if (winPair.second.first == parentId) {
325                 property_->SetParentId(parentId);
326                 break;
327             }
328         }
329         if (property_->GetParentId() != parentId) {
330             WLOGFE("ParentId is empty or valid. ParentId is %{public}u", parentId);
331             return WMError::WM_ERROR_INVALID_PARAM;
332         }
333     }
334 
335     static std::atomic<uint32_t> tempWindowId = 0;
336     uint32_t windowId = tempWindowId++;
337     property_->SetWindowId(windowId);
338     windowMap_.insert(std::make_pair(name_, std::pair<uint32_t, sptr<Window>>(windowId, this)));
339 
340     state_ = WindowState::STATE_CREATED;
341 
342     return WMError::WM_OK;
343 }
344 
BindDialogTarget(sptr<IRemoteObject> targetToken)345 WMError WindowImpl::BindDialogTarget(sptr<IRemoteObject> targetToken)
346 {
347     return WMError::WM_OK;
348 }
349 
Destroy()350 WMError WindowImpl::Destroy()
351 {
352     return WMError::WM_OK;
353 }
354 
UpdateSurfaceNodeAfterCustomAnimation(bool isAdd)355 WMError WindowImpl::UpdateSurfaceNodeAfterCustomAnimation(bool isAdd)
356 {
357     return WMError::WM_OK;
358 }
359 
Show(uint32_t reason,bool withAnimation)360 WMError WindowImpl::Show(uint32_t reason, bool withAnimation)
361 {
362     return WMError::WM_OK;
363 }
364 
Hide(uint32_t reason,bool withAnimation)365 WMError WindowImpl::Hide(uint32_t reason, bool withAnimation)
366 {
367     return WMError::WM_OK;
368 }
369 
MoveTo(int32_t x,int32_t y)370 WMError WindowImpl::MoveTo(int32_t x, int32_t y)
371 {
372     return WMError::WM_OK;
373 }
374 
Resize(uint32_t width,uint32_t height)375 WMError WindowImpl::Resize(uint32_t width, uint32_t height)
376 {
377     return WMError::WM_OK;
378 }
379 
SetKeepScreenOn(bool keepScreenOn)380 WMError WindowImpl::SetKeepScreenOn(bool keepScreenOn)
381 {
382     return WMError::WM_OK;
383 }
384 
IsKeepScreenOn() const385 bool WindowImpl::IsKeepScreenOn() const
386 {
387     return property_->IsKeepScreenOn();
388 }
389 
SetTurnScreenOn(bool turnScreenOn)390 WMError WindowImpl::SetTurnScreenOn(bool turnScreenOn)
391 {
392     return WMError::WM_OK;
393 }
394 
IsTurnScreenOn() const395 bool WindowImpl::IsTurnScreenOn() const
396 {
397     return property_->IsTurnScreenOn();
398 }
399 
SetBackgroundColor(const std::string & color)400 WMError WindowImpl::SetBackgroundColor(const std::string& color)
401 {
402     return WMError::WM_OK;
403 }
404 
SetTransparent(bool isTransparent)405 WMError WindowImpl::SetTransparent(bool isTransparent)
406 {
407     return WMError::WM_OK;
408 }
409 
IsTransparent() const410 bool WindowImpl::IsTransparent() const
411 {
412     return true;
413 }
414 
SetBrightness(float brightness)415 WMError WindowImpl::SetBrightness(float brightness)
416 {
417     return WMError::WM_OK;
418 }
419 
GetBrightness() const420 float WindowImpl::GetBrightness() const
421 {
422     return property_->GetBrightness();
423 }
424 
SetCallingWindow(uint32_t windowId)425 WMError WindowImpl::SetCallingWindow(uint32_t windowId)
426 {
427     return WMError::WM_OK;
428 }
429 
SetPrivacyMode(bool isPrivacyMode)430 void WindowImpl::SetPrivacyMode(bool isPrivacyMode)
431 {
432     return;
433 }
434 
IsPrivacyMode() const435 bool WindowImpl::IsPrivacyMode() const
436 {
437     return property_->GetPrivacyMode();
438 }
439 
SetSystemPrivacyMode(bool isSystemPrivacyMode)440 void WindowImpl::SetSystemPrivacyMode(bool isSystemPrivacyMode)
441 {
442     return;
443 }
444 
SetSnapshotSkip(bool isSkip)445 void WindowImpl::SetSnapshotSkip(bool isSkip)
446 {
447     return;
448 }
449 
DisableAppWindowDecor()450 void WindowImpl::DisableAppWindowDecor()
451 {
452     return;
453 }
454 
IsDecorEnable() const455 bool WindowImpl::IsDecorEnable() const
456 {
457     return property_->GetDecorEnable();
458 }
459 
Maximize()460 WMError WindowImpl::Maximize()
461 {
462     return WMError::WM_OK;
463 }
464 
Minimize()465 WMError WindowImpl::Minimize()
466 {
467     return WMError::WM_OK;
468 }
469 
Recover()470 WMError WindowImpl::Recover()
471 {
472     return WMError::WM_OK;
473 }
474 
Close()475 WMError WindowImpl::Close()
476 {
477     return WMError::WM_OK;
478 }
479 
StartMove()480 void WindowImpl::StartMove()
481 {
482     return;
483 }
484 
RequestFocus() const485 WMError WindowImpl::RequestFocus() const
486 {
487     return WMError::WM_OK;
488 }
489 
IsFocused() const490 bool WindowImpl::IsFocused() const
491 {
492     return true;
493 }
494 
SetInputEventConsumer(const std::shared_ptr<IInputEventConsumer> & inputEventConsumer)495 void WindowImpl::SetInputEventConsumer(const std::shared_ptr<IInputEventConsumer>& inputEventConsumer)
496 {
497     return;
498 }
499 
RegisterLifeCycleListener(const sptr<IWindowLifeCycle> & listener)500 bool WindowImpl::RegisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener)
501 {
502     return true;
503 }
504 
RegisterWindowChangeListener(const sptr<IWindowChangeListener> & listener)505 bool WindowImpl::RegisterWindowChangeListener(const sptr<IWindowChangeListener>& listener)
506 {
507     return true;
508 }
509 
UnregisterLifeCycleListener(const sptr<IWindowLifeCycle> & listener)510 bool WindowImpl::UnregisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener)
511 {
512     return true;
513 }
514 
UnregisterWindowChangeListener(const sptr<IWindowChangeListener> & listener)515 bool WindowImpl::UnregisterWindowChangeListener(const sptr<IWindowChangeListener>& listener)
516 {
517     return true;
518 }
519 
RegisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener> & listener)520 bool WindowImpl::RegisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener>& listener)
521 {
522     return true;
523 }
524 
UnregisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener> & listener)525 bool WindowImpl::UnregisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener>& listener)
526 {
527     return true;
528 }
529 
RegisterDragListener(const sptr<IWindowDragListener> & listener)530 bool WindowImpl::RegisterDragListener(const sptr<IWindowDragListener>& listener)
531 {
532     return true;
533 }
534 
UnregisterDragListener(const sptr<IWindowDragListener> & listener)535 bool WindowImpl::UnregisterDragListener(const sptr<IWindowDragListener>& listener)
536 {
537     return true;
538 }
539 
RegisterDisplayMoveListener(sptr<IDisplayMoveListener> & listener)540 bool WindowImpl::RegisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener)
541 {
542     return true;
543 }
544 
UnregisterDisplayMoveListener(sptr<IDisplayMoveListener> & listener)545 bool WindowImpl::UnregisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener)
546 {
547     return true;
548 }
549 
RegisterWindowDestroyedListener(const NotifyNativeWinDestroyFunc & func)550 void WindowImpl::RegisterWindowDestroyedListener(const NotifyNativeWinDestroyFunc& func)
551 {
552     return;
553 }
554 
RegisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener> & listener)555 bool WindowImpl::RegisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener)
556 {
557     return true;
558 }
559 
UnregisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener> & listener)560 bool WindowImpl::UnregisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener)
561 {
562     return true;
563 }
564 
RegisterTouchOutsideListener(const sptr<ITouchOutsideListener> & listener)565 bool WindowImpl::RegisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener)
566 {
567     return true;
568 }
569 
UnregisterTouchOutsideListener(const sptr<ITouchOutsideListener> & listener)570 bool WindowImpl::UnregisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener)
571 {
572     return true;
573 }
574 
RegisterAnimationTransitionController(const sptr<IAnimationTransitionController> & listener)575 bool WindowImpl::RegisterAnimationTransitionController(const sptr<IAnimationTransitionController>& listener)
576 {
577     return true;
578 }
579 
RegisterScreenshotListener(const sptr<IScreenshotListener> & listener)580 bool WindowImpl::RegisterScreenshotListener(const sptr<IScreenshotListener>& listener)
581 {
582     return true;
583 }
584 
UnregisterScreenshotListener(const sptr<IScreenshotListener> & listener)585 bool WindowImpl::UnregisterScreenshotListener(const sptr<IScreenshotListener>& listener)
586 {
587     return true;
588 }
589 
RegisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener> & listener)590 bool WindowImpl::RegisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener)
591 {
592     return true;
593 }
594 
UnregisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener> & listener)595 bool WindowImpl::UnregisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener)
596 {
597     return true;
598 }
599 
RegisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener> & listener)600 void WindowImpl::RegisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener)
601 {
602     return;
603 }
604 
UnregisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener> & listener)605 void WindowImpl::UnregisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener)
606 {
607     return;
608 }
609 
SetAceAbilityHandler(const sptr<IAceAbilityHandler> & handler)610 void WindowImpl::SetAceAbilityHandler(const sptr<IAceAbilityHandler>& handler)
611 {
612     return;
613 }
614 
SetRequestModeSupportInfo(uint32_t modeSupportInfo)615 void WindowImpl::SetRequestModeSupportInfo(uint32_t modeSupportInfo)
616 {
617     return;
618 }
619 
ConsumeKeyEvent(std::shared_ptr<MMI::KeyEvent> & keyEvent)620 void WindowImpl::ConsumeKeyEvent(std::shared_ptr<MMI::KeyEvent>& keyEvent)
621 {
622     return;
623 }
624 
ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent> & pointerEvent)625 void WindowImpl::ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent)
626 {
627     return;
628 }
629 
RequestVsync(const std::shared_ptr<VsyncCallback> & vsyncCallback)630 void WindowImpl::RequestVsync(const std::shared_ptr<VsyncCallback>& vsyncCallback)
631 {
632     return;
633 }
634 
UpdateConfiguration(const std::shared_ptr<AppExecFwk::Configuration> & configuration)635 void WindowImpl::UpdateConfiguration(const std::shared_ptr<AppExecFwk::Configuration>& configuration)
636 {
637     if (uiContent_ != nullptr) {
638         WLOGFD("notify ace winId:%{public}u", GetWindowId());
639         uiContent_->UpdateConfiguration(configuration);
640     }
641     if (subWindowMap_.count(GetWindowId()) == 0) {
642         return;
643     }
644     for (auto& subWindow : subWindowMap_.at(GetWindowId())) {
645         subWindow->UpdateConfiguration(configuration);
646     }
647 }
648 
NotifyTouchDialogTarget()649 void WindowImpl::NotifyTouchDialogTarget()
650 {
651     return;
652 }
653 
SetNeedRemoveWindowInputChannel(bool needRemoveWindowInputChannel)654 void WindowImpl::SetNeedRemoveWindowInputChannel(bool needRemoveWindowInputChannel)
655 {
656     return;
657 }
658 
IsLayoutFullScreen() const659 bool WindowImpl::IsLayoutFullScreen() const
660 {
661     return true;
662 }
663 
IsFullScreen() const664 bool WindowImpl::IsFullScreen() const
665 {
666     return true;
667 }
668 
SetRequestedOrientation(Orientation orientation)669 void WindowImpl::SetRequestedOrientation(Orientation orientation)
670 {
671     return;
672 }
673 
GetRequestedOrientation()674 Orientation WindowImpl::GetRequestedOrientation()
675 {
676     return property_->GetRequestedOrientation();
677 }
678 
SetTouchHotAreas(const std::vector<Rect> & rects)679 WMError WindowImpl::SetTouchHotAreas(const std::vector<Rect>& rects)
680 {
681     return WMError::WM_OK;
682 }
GetRequestedTouchHotAreas(std::vector<Rect> & rects) const683 void WindowImpl::GetRequestedTouchHotAreas(std::vector<Rect>& rects) const
684 {
685     property_->GetTouchHotAreas(rects);
686 }
687 
SetAPPWindowLabel(const std::string & label)688 WMError WindowImpl::SetAPPWindowLabel(const std::string& label)
689 {
690     if (uiContent_ == nullptr) {
691         WLOGFE("uicontent is empty");
692         return WMError::WM_ERROR_NULLPTR;
693     }
694     uiContent_->SetAppWindowTitle(label);
695     return WMError::WM_OK;
696 }
697 
SetAPPWindowIcon(const std::shared_ptr<Media::PixelMap> & icon)698 WMError WindowImpl::SetAPPWindowIcon(const std::shared_ptr<Media::PixelMap>& icon)
699 {
700     if (icon == nullptr) {
701         WLOGFE("window icon is empty");
702         return WMError::WM_ERROR_NULLPTR;
703     }
704     if (uiContent_ == nullptr) {
705         WLOGFE("uicontent is empty");
706         return WMError::WM_ERROR_NULLPTR;
707     }
708     uiContent_->SetAppWindowIcon(icon);
709     return WMError::WM_OK;
710 }
711 
SetCornerRadius(float cornerRadius)712 WMError WindowImpl::SetCornerRadius(float cornerRadius)
713 {
714     return WMError::WM_OK;
715 }
716 
SetShadowRadius(float radius)717 WMError WindowImpl::SetShadowRadius(float radius)
718 {
719     return WMError::WM_OK;
720 }
721 
SetShadowColor(std::string color)722 WMError WindowImpl::SetShadowColor(std::string color)
723 {
724     return WMError::WM_OK;
725 }
726 
SetShadowOffsetX(float offsetX)727 void WindowImpl::SetShadowOffsetX(float offsetX)
728 {
729     return;
730 }
731 
SetShadowOffsetY(float offsetY)732 void WindowImpl::SetShadowOffsetY(float offsetY)
733 {
734     return;
735 }
736 
SetBlur(float radius)737 WMError WindowImpl::SetBlur(float radius)
738 {
739     return WMError::WM_OK;
740 }
741 
SetBackdropBlur(float radius)742 WMError WindowImpl::SetBackdropBlur(float radius)
743 {
744     return WMError::WM_OK;
745 }
746 
SetBackdropBlurStyle(WindowBlurStyle blurStyle)747 WMError WindowImpl::SetBackdropBlurStyle(WindowBlurStyle blurStyle)
748 {
749     return WMError::WM_OK;
750 }
751 
NotifyMemoryLevel(int32_t level) const752 WMError WindowImpl::NotifyMemoryLevel(int32_t level) const
753 {
754     return WMError::WM_OK;
755 }
756 
IsAllowHaveSystemSubWindow()757 bool WindowImpl::IsAllowHaveSystemSubWindow()
758 {
759     return true;
760 }
761 } // namespace Rosen
762 } // namespace OHOS
763