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 #include "core/common/ai/data_detector_adapter.h"
16 
17 namespace OHOS::Ace {
InitTextDetect(int32_t startPos,std::string detectText)18 void DataDetectorAdapter::InitTextDetect(int32_t startPos, std::string detectText) {}
SetTextDetectTypes(const std::string & types)19 void DataDetectorAdapter::SetTextDetectTypes(const std::string& types) {}
ParseOriText(const std::unique_ptr<JsonValue> & entityJson,std::string & text)20 bool DataDetectorAdapter::ParseOriText(const std::unique_ptr<JsonValue>& entityJson, std::string& text)
21 {
22     return false;
23 }
ParseAIResult(const TextDataDetectResult & result,int32_t startPos)24 void DataDetectorAdapter::ParseAIResult(const TextDataDetectResult& result, int32_t startPos) {}
ParseAIJson(const std::unique_ptr<JsonValue> & jsonValue,TextDataDetectType type,int32_t startPos)25 void DataDetectorAdapter::ParseAIJson(
26     const std::unique_ptr<JsonValue>& jsonValue, TextDataDetectType type, int32_t startPos) {}
StartAITask()27 void DataDetectorAdapter::StartAITask() {}
28 
ShowAIEntityMenu(const AISpan & aiSpan,const NG::RectF & aiRect,const RefPtr<NG::FrameNode> & targetNode,bool isShowCopy,bool isShowSelectText)29 bool DataDetectorAdapter::ShowAIEntityMenu(const AISpan& aiSpan, const NG::RectF& aiRect,
30     const RefPtr<NG::FrameNode>& targetNode, bool isShowCopy, bool isShowSelectText)
31 {
32     return true;
33 }
34 
ResponseBestMatchItem(const AISpan & aiSpan)35 void DataDetectorAdapter::ResponseBestMatchItem(const AISpan& aiSpan) {}
36 
OnClickAIMenuOption(const AISpan & aiSpan,const std::pair<std::string,FuncVariant> & menuOption,const RefPtr<NG::FrameNode> & targetNode)37 void DataDetectorAdapter::OnClickAIMenuOption(const AISpan& aiSpan,
38     const std::pair<std::string, FuncVariant>& menuOption, const RefPtr<NG::FrameNode>& targetNode)
39 {}
40 
GetAIEntityMenu()41 void DataDetectorAdapter::GetAIEntityMenu() {}
GetDetectDelayTask(const std::map<int32_t,AISpan> & aiSpanMap)42 std::function<void()> GetDetectDelayTask(const std::map<int32_t, AISpan>& aiSpanMap)
43 {
44     return []() {};
45 }
46 } // namespace OHOS::Ace
47