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 {}
40 
HideMenuNG(const RefPtr<NG::FrameNode> & menu,int32_t targetId)41 void SubwindowManager::HideMenuNG(const RefPtr<NG::FrameNode>& menu, int32_t targetId) {}
42 
HideMenuNG(bool showPreviewAnimation,bool startDrag)43 void SubwindowManager::HideMenuNG(bool showPreviewAnimation, bool startDrag) {}
44 
SetHotAreas(const std::vector<Rect> & rects,int32_t overlayId,int32_t instanceId)45 void SubwindowManager::SetHotAreas(const std::vector<Rect>& rects, int32_t overlayId, int32_t instanceId) {}
46 
HideSubWindowNG()47 void SubwindowManager::HideSubWindowNG() {}
48 
GetCurrentWindow()49 const RefPtr<Subwindow>& SubwindowManager::GetCurrentWindow()
50 {
51     return g_currentWindow;
52 }
53 
GetParentWindowRect()54 Rect SubwindowManager::GetParentWindowRect()
55 {
56     return Rect();
57 }
58 
GetParentContainerId(int32_t containerId)59 int32_t SubwindowManager::GetParentContainerId(int32_t containerId)
60 {
61     return -1;
62 }
63 
GetSubContainerId(int32_t parentContainerId)64 int32_t SubwindowManager::GetSubContainerId(int32_t parentContainerId)
65 {
66     return -1;
67 }
68 
GetSubwindow(int32_t instanceId)69 const RefPtr<Subwindow> SubwindowManager::GetSubwindow(int32_t instanceId)
70 {
71     return nullptr;
72 }
73 
ResizeWindowForFoldStatus(int32_t parentContainerId)74 void SubwindowManager::ResizeWindowForFoldStatus(int32_t parentContainerId) {}
75 
MarkDirtyDialogSafeArea()76 void SubwindowManager::MarkDirtyDialogSafeArea() {}
77 } // namespace OHOS::Ace
78