123b3eb3cSopenharmony_ci/* 223b3eb3cSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 323b3eb3cSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 423b3eb3cSopenharmony_ci * you may not use this file except in compliance with the License. 523b3eb3cSopenharmony_ci * You may obtain a copy of the License at 623b3eb3cSopenharmony_ci * 723b3eb3cSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 823b3eb3cSopenharmony_ci * 923b3eb3cSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1023b3eb3cSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1123b3eb3cSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1223b3eb3cSopenharmony_ci * See the License for the specific language governing permissions and 1323b3eb3cSopenharmony_ci * limitations under the License. 1423b3eb3cSopenharmony_ci */ 1523b3eb3cSopenharmony_ci 1623b3eb3cSopenharmony_ci#include "adapter/preview/entrance/udmf/udmf_impl.h" 1723b3eb3cSopenharmony_ci 1823b3eb3cSopenharmony_ci#include <memory> 1923b3eb3cSopenharmony_ci#include <unordered_map> 2023b3eb3cSopenharmony_ci 2123b3eb3cSopenharmony_ci#include "js_native_api_types.h" 2223b3eb3cSopenharmony_ci 2323b3eb3cSopenharmony_ci#include "base/utils/utils.h" 2423b3eb3cSopenharmony_ci#include "core/common/udmf/unified_data.h" 2523b3eb3cSopenharmony_cinamespace OHOS::Ace { 2623b3eb3cSopenharmony_ciUdmfClient* UdmfClient::GetInstance() 2723b3eb3cSopenharmony_ci{ 2823b3eb3cSopenharmony_ci static UdmfClientImpl instance; 2923b3eb3cSopenharmony_ci return &instance; 3023b3eb3cSopenharmony_ci} 3123b3eb3cSopenharmony_ci 3223b3eb3cSopenharmony_ciRefPtr<UnifiedData> UdmfClientImpl::TransformUnifiedDataForNative(void* rawData) 3323b3eb3cSopenharmony_ci{ 3423b3eb3cSopenharmony_ci return nullptr; 3523b3eb3cSopenharmony_ci} 3623b3eb3cSopenharmony_ci 3723b3eb3cSopenharmony_civoid* UdmfClientImpl::TransformUnifiedDataPtr(RefPtr<UnifiedData>& unifiedData) 3823b3eb3cSopenharmony_ci{ 3923b3eb3cSopenharmony_ci return nullptr; 4023b3eb3cSopenharmony_ci} 4123b3eb3cSopenharmony_ci 4223b3eb3cSopenharmony_ciRefPtr<UnifiedData> UdmfClientImpl::TransformUnifiedData(napi_value napiValue) 4323b3eb3cSopenharmony_ci{ 4423b3eb3cSopenharmony_ci return nullptr; 4523b3eb3cSopenharmony_ci} 4623b3eb3cSopenharmony_ci 4723b3eb3cSopenharmony_cinapi_value UdmfClientImpl::TransformUdmfUnifiedData(RefPtr<UnifiedData>& UnifiedData) 4823b3eb3cSopenharmony_ci{ 4923b3eb3cSopenharmony_ci return nullptr; 5023b3eb3cSopenharmony_ci} 5123b3eb3cSopenharmony_ci 5223b3eb3cSopenharmony_cinapi_value UdmfClientImpl::TransformSummary(std::map<std::string, int64_t>& summary) 5323b3eb3cSopenharmony_ci{ 5423b3eb3cSopenharmony_ci return nullptr; 5523b3eb3cSopenharmony_ci} 5623b3eb3cSopenharmony_ci 5723b3eb3cSopenharmony_ciRefPtr<UnifiedData> UdmfClientImpl::CreateUnifiedData() 5823b3eb3cSopenharmony_ci{ 5923b3eb3cSopenharmony_ci return nullptr; 6023b3eb3cSopenharmony_ci} 6123b3eb3cSopenharmony_ci 6223b3eb3cSopenharmony_ciint32_t UdmfClientImpl::SetData(const RefPtr<UnifiedData>& unifiedData, std::string& key) 6323b3eb3cSopenharmony_ci{ 6423b3eb3cSopenharmony_ci return -1; 6523b3eb3cSopenharmony_ci} 6623b3eb3cSopenharmony_ci 6723b3eb3cSopenharmony_ciint32_t UdmfClientImpl::GetData(const RefPtr<UnifiedData>& unifiedData, const std::string& key) 6823b3eb3cSopenharmony_ci{ 6923b3eb3cSopenharmony_ci return -1; 7023b3eb3cSopenharmony_ci} 7123b3eb3cSopenharmony_ci 7223b3eb3cSopenharmony_ciint32_t UdmfClientImpl::GetSummary(std::string& key, std::map<std::string, int64_t>& summaryMap) 7323b3eb3cSopenharmony_ci{ 7423b3eb3cSopenharmony_ci return -1; 7523b3eb3cSopenharmony_ci} 7623b3eb3cSopenharmony_ci 7723b3eb3cSopenharmony_cibool UdmfClientImpl::GetRemoteStatus(std::string& key) 7823b3eb3cSopenharmony_ci{ 7923b3eb3cSopenharmony_ci return false; 8023b3eb3cSopenharmony_ci} 8123b3eb3cSopenharmony_ci 8223b3eb3cSopenharmony_civoid UdmfClientImpl::AddFormRecord( 8323b3eb3cSopenharmony_ci const RefPtr<UnifiedData>& unifiedData, int32_t formId, const RequestFormInfo& cardInfo) 8423b3eb3cSopenharmony_ci{} 8523b3eb3cSopenharmony_ci 8623b3eb3cSopenharmony_civoid UdmfClientImpl::AddLinkRecord( 8723b3eb3cSopenharmony_ci const RefPtr<UnifiedData>& unifiedData, const std::string& url, const std::string& description) 8823b3eb3cSopenharmony_ci{} 8923b3eb3cSopenharmony_ci 9023b3eb3cSopenharmony_civoid UdmfClientImpl::GetLinkRecord(const RefPtr<UnifiedData>& unifiedData, std::string& url, std::string& description) 9123b3eb3cSopenharmony_ci{} 9223b3eb3cSopenharmony_ci 9323b3eb3cSopenharmony_cibool UdmfClientImpl::GetFileUriRecord(const RefPtr<UnifiedData>& unifiedData, std::vector<std::string>& uri) 9423b3eb3cSopenharmony_ci{ 9523b3eb3cSopenharmony_ci return false; 9623b3eb3cSopenharmony_ci} 9723b3eb3cSopenharmony_ci 9823b3eb3cSopenharmony_cibool UdmfClientImpl::AddFileUriRecord(const RefPtr<UnifiedData>& unifiedData, std::vector<std::string>& uri) 9923b3eb3cSopenharmony_ci{ 10023b3eb3cSopenharmony_ci return false; 10123b3eb3cSopenharmony_ci} 10223b3eb3cSopenharmony_ci 10323b3eb3cSopenharmony_civoid UdmfClientImpl::AddHtmlRecord( 10423b3eb3cSopenharmony_ci const RefPtr<UnifiedData>& unifiedData, const std::string& htmlContent, const std::string& plainContent) 10523b3eb3cSopenharmony_ci{} 10623b3eb3cSopenharmony_ci 10723b3eb3cSopenharmony_civoid UdmfClientImpl::GetHtmlRecord( 10823b3eb3cSopenharmony_ci const RefPtr<UnifiedData>& unifiedData, std::string& htmlContent, std::string& plainContent) 10923b3eb3cSopenharmony_ci{} 11023b3eb3cSopenharmony_ci 11123b3eb3cSopenharmony_civoid UdmfClientImpl::AddPixelMapRecord( 11223b3eb3cSopenharmony_ci const RefPtr<UnifiedData>& unifiedData, std::vector<uint8_t>& data, PixelMapRecordDetails& details) 11323b3eb3cSopenharmony_ci{} 11423b3eb3cSopenharmony_ci 11523b3eb3cSopenharmony_civoid UdmfClientImpl::AddImageRecord(const RefPtr<UnifiedData>& unifiedData, const std::string& uri) {} 11623b3eb3cSopenharmony_ci 11723b3eb3cSopenharmony_civoid UdmfClientImpl::AddPlainTextRecord(const RefPtr<UnifiedData>& unifiedData, const std::string& selectedStr) {} 11823b3eb3cSopenharmony_ci 11923b3eb3cSopenharmony_cistd::string UdmfClientImpl::GetSinglePlainTextRecord(const RefPtr<UnifiedData>& unifiedData) 12023b3eb3cSopenharmony_ci{ 12123b3eb3cSopenharmony_ci return ""; 12223b3eb3cSopenharmony_ci} 12323b3eb3cSopenharmony_ci 12423b3eb3cSopenharmony_cistd::vector<std::string> UdmfClientImpl::GetPlainTextRecords(const RefPtr<UnifiedData>& unifiedData) 12523b3eb3cSopenharmony_ci{ 12623b3eb3cSopenharmony_ci return {}; 12723b3eb3cSopenharmony_ci} 12823b3eb3cSopenharmony_ci 12923b3eb3cSopenharmony_ciint32_t UdmfClientImpl::GetVideoRecordUri(const RefPtr<UnifiedData>& unifiedData, std::string& uri) 13023b3eb3cSopenharmony_ci{ 13123b3eb3cSopenharmony_ci return -1; 13223b3eb3cSopenharmony_ci} 13323b3eb3cSopenharmony_ci 13423b3eb3cSopenharmony_cistd::pair<int32_t, std::string> UdmfClientImpl::GetErrorInfo(int32_t errorCode) 13523b3eb3cSopenharmony_ci{ 13623b3eb3cSopenharmony_ci return {}; 13723b3eb3cSopenharmony_ci} 13823b3eb3cSopenharmony_ci 13923b3eb3cSopenharmony_cistd::shared_ptr<UnifiedData> UnifiedDataImpl::GetUnifiedData() 14023b3eb3cSopenharmony_ci{ 14123b3eb3cSopenharmony_ci return nullptr; 14223b3eb3cSopenharmony_ci} 14323b3eb3cSopenharmony_ci 14423b3eb3cSopenharmony_civoid UnifiedDataImpl::SetUnifiedData(std::shared_ptr<UnifiedData> unifiedData) 14523b3eb3cSopenharmony_ci{ 14623b3eb3cSopenharmony_ci return; 14723b3eb3cSopenharmony_ci} 14823b3eb3cSopenharmony_ci 14923b3eb3cSopenharmony_civoid UdmfClientImpl::AddSpanStringRecord( 15023b3eb3cSopenharmony_ci const RefPtr<UnifiedData>& unifiedData, std::vector<uint8_t>& data) 15123b3eb3cSopenharmony_ci{ 15223b3eb3cSopenharmony_ci return; 15323b3eb3cSopenharmony_ci} 15423b3eb3cSopenharmony_cistd::vector<uint8_t> UdmfClientImpl::GetSpanStringRecord(const RefPtr<UnifiedData>& unifiedData) 15523b3eb3cSopenharmony_ci{ 15623b3eb3cSopenharmony_ci return {}; 15723b3eb3cSopenharmony_ci} 15823b3eb3cSopenharmony_ci 15923b3eb3cSopenharmony_ci} // namespace OHOS::Ace