1 /*
2 * Copyright (c) 2022-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 #include "base/geometry/rect.h"
17 #include "base/log/log_wrapper.h"
18 #include "base/subwindow/subwindow_manager.h"
19
20 namespace OHOS::Ace {
21 namespace {
22 static RefPtr<Subwindow> g_currentWindow;
23 } // namespace
24
25 std::shared_ptr<SubwindowManager> SubwindowManager::instance_;
26
GetInstance()27 std::shared_ptr<SubwindowManager> SubwindowManager::GetInstance()
28 {
29 if (!instance_) {
30 instance_ = std::make_shared<SubwindowManager>();
31 }
32 return instance_;
33 }
34
HidePopupNG(int32_t targetId,int32_t instanceId)35 void SubwindowManager::HidePopupNG(int32_t targetId, int32_t instanceId) {}
36
ShowPopupNG(const RefPtr<NG::FrameNode> & targetNode,const NG::PopupInfo & popupInfo,const std::function<void (int32_t)> && onWillDismiss,bool interactiveDismiss)37 void SubwindowManager::ShowPopupNG(const RefPtr<NG::FrameNode>& targetNode, const NG::PopupInfo& popupInfo,
38 const std::function<void(int32_t)>&& onWillDismiss, bool interactiveDismiss)
39 {}
ShowTipsNG(int32_t targetId,const NG::PopupInfo & popupInfo,int32_t appearingTime,int32_t appearingTimeWithContinuousOperation)40 void SubwindowManager::ShowTipsNG(int32_t targetId, const NG::PopupInfo& popupInfo, int32_t appearingTime,
41 int32_t appearingTimeWithContinuousOperation)
42 {}
HideTipsNG(int32_t targetId,int32_t disappearingTime)43 void SubwindowManager::HideTipsNG(int32_t targetId, int32_t disappearingTime) {}
HideMenuNG(const RefPtr<NG::FrameNode> & menu,int32_t targetId)44 void SubwindowManager::HideMenuNG(const RefPtr<NG::FrameNode>& menu, int32_t targetId) {}
45
HideMenuNG(bool showPreviewAnimation,bool startDrag)46 void SubwindowManager::HideMenuNG(bool showPreviewAnimation, bool startDrag) {}
47
SetHotAreas(const std::vector<Rect> & rects,SubwindowType type,int32_t overlayId,int32_t instanceId)48 void SubwindowManager::SetHotAreas(
49 const std::vector<Rect>& rects, SubwindowType type, int32_t overlayId, int32_t instanceId) {}
50
HideSubWindowNG()51 void SubwindowManager::HideSubWindowNG() {}
52
GetCurrentWindow()53 const RefPtr<Subwindow> SubwindowManager::GetCurrentWindow()
54 {
55 return g_currentWindow;
56 }
57
GetParentWindowRect()58 Rect SubwindowManager::GetParentWindowRect()
59 {
60 return Rect();
61 }
62
GetParentContainerId(int32_t containerId)63 int32_t SubwindowManager::GetParentContainerId(int32_t containerId)
64 {
65 return -1;
66 }
67
GetSubContainerId(int32_t parentContainerId)68 int32_t SubwindowManager::GetSubContainerId(int32_t parentContainerId)
69 {
70 return -1;
71 }
72
GetSubwindow(int32_t instanceId)73 const RefPtr<Subwindow> SubwindowManager::GetSubwindow(int32_t instanceId)
74 {
75 return nullptr;
76 }
77
ResizeWindowForFoldStatus(int32_t parentContainerId)78 void SubwindowManager::ResizeWindowForFoldStatus(int32_t parentContainerId) {}
79
MarkDirtyDialogSafeArea()80 void SubwindowManager::MarkDirtyDialogSafeArea() {}
81 } // namespace OHOS::Ace
82