1 /*
2  * Copyright (c) 2024 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 "core/common/stylus/stylus_detector_mgr.h"
17 
18 namespace OHOS::Ace {
19 
GetInstance()20 StylusDetectorMgr* StylusDetectorMgr::GetInstance()
21 {
22     static StylusDetectorMgr instance;
23     return &instance;
24 }
25 
IsEnable()26 bool StylusDetectorMgr::IsEnable()
27 {
28     return false;
29 }
30 
RegisterStylusInteractionListener(const std::string & bundleName,const std::shared_ptr<IStylusDetectorCallback> & callback)31 bool StylusDetectorMgr::RegisterStylusInteractionListener(
32     const std::string& bundleName, const std::shared_ptr<IStylusDetectorCallback>& callback)
33 {
34     isRegistered_ = true;
35     return false;
36 }
UnRegisterStylusInteractionListener(const std::string & bundleName)37 void StylusDetectorMgr::UnRegisterStylusInteractionListener(const std::string& bundleName) {}
38 
Notify(const NotifyInfo & notifyInfo)39 bool StylusDetectorMgr::Notify(const NotifyInfo& notifyInfo)
40 {
41     return false;
42 }
43 
FindHitFrameNode(const TouchEvent & touchEvent,const TouchTestResult & touchTestResult)44 RefPtr<NG::FrameNode> StylusDetectorMgr::FindHitFrameNode(
45     const TouchEvent& touchEvent, const TouchTestResult& touchTestResult)
46 {
47     return nullptr;
48 }
49 
IsNeedInterceptedTouchEvent(const TouchEvent & touchEvent,std::unordered_map<size_t,TouchTestResult> touchTestResults)50 bool StylusDetectorMgr::IsNeedInterceptedTouchEvent(
51     const TouchEvent& touchEvent, std::unordered_map<size_t, TouchTestResult> touchTestResults)
52 {
53     return false;
54 }
55 
AddTextFieldFrameNode(const RefPtr<NG::FrameNode> & frameNode,const WeakPtr<NG::LayoutInfoInterface> & layoutInfo)56 void StylusDetectorMgr::AddTextFieldFrameNode(const RefPtr<NG::FrameNode>& frameNode,
57     const WeakPtr<NG::LayoutInfoInterface>& layoutInfo) {}
RemoveTextFieldFrameNode(const int32_t id)58 void StylusDetectorMgr::RemoveTextFieldFrameNode(const int32_t id) {}
59 
StylusDetectorMgr()60 StylusDetectorMgr::StylusDetectorMgr() : engine_(nullptr), isRegistered_(false) {}
61 
IsStylusTouchEvent(const TouchEvent & touchEvent) const62 bool StylusDetectorMgr::IsStylusTouchEvent(const TouchEvent& touchEvent) const
63 {
64     return false;
65 }
66 
IsHitCleanNodeResponseArea(const NG::PointF & point,const RefPtr<NG::FrameNode> & frameNode,uint64_t nanoTimestamp)67 bool StylusDetectorMgr::IsHitCleanNodeResponseArea(
68     const NG::PointF& point, const RefPtr<NG::FrameNode>& frameNode, uint64_t nanoTimestamp)
69 {
70     return false;
71 }
72 } // namespace OHOS::Ace