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/subwindow/subwindow_manager.h"
18 namespace OHOS::Ace {
19 namespace {
20 static RefPtr<Subwindow> g_currentWindow;
21 }
22
23 std::shared_ptr<SubwindowManager> SubwindowManager::instance_;
24
GetInstance()25 std::shared_ptr<SubwindowManager> SubwindowManager::GetInstance()
26 {
27 if (!instance_) {
28 instance_ = std::make_shared<SubwindowManager>();
29 }
30 return instance_;
31 }
32
HidePopupNG(int32_t targetId,int32_t instanceId)33 void SubwindowManager::HidePopupNG(int32_t targetId, int32_t instanceId)
34 {
35 LOGI("SubwindowManager::HidePopupNG MOCK");
36 }
37
ShowPopupNG(int32_t targetId,const NG::PopupInfo & popupInfo)38 void SubwindowManager::ShowPopupNG(int32_t targetId, const NG::PopupInfo& popupInfo) {}
39
HideMenuNG(const RefPtr<NG::FrameNode> & menu,int32_t targetId)40 void SubwindowManager::HideMenuNG(const RefPtr<NG::FrameNode>& menu, int32_t targetId) {}
41
HideMenuNG()42 void SubwindowManager::HideMenuNG() {}
43
SetHotAreas(const std::vector<Rect> & rects,int32_t overlayId,int32_t instanceId)44 void SubwindowManager::SetHotAreas(const std::vector<Rect>& rects, int32_t overlayId, int32_t instanceId) {}
45
GetCurrentWindow()46 const RefPtr<Subwindow>& SubwindowManager::GetCurrentWindow()
47 {
48 return g_currentWindow;
49 }
50
GetParentWindowRect()51 Rect SubwindowManager::GetParentWindowRect()
52 {
53 return Rect();
54 }
55
GetParentContainerId(int32_t containerId)56 int32_t SubwindowManager::GetParentContainerId(int32_t containerId)
57 {
58 return 0;
59 }
60
GetSubwindow(int32_t instanceId)61 const RefPtr<Subwindow> SubwindowManager::GetSubwindow(int32_t instanceId)
62 {
63 return nullptr;
64 }
65
66 } // namespace OHOS::Ace
67