1 /* 2 * Copyright (c) 2021-2022 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 #ifndef CONTACT_UPDATE_HELPER_H 17 #define CONTACT_UPDATE_HELPER_H 18 19 #include "datashare_predicates.h" 20 #include "rdb_errno.h" 21 #include "rdb_helper.h" 22 #include "rdb_store.h" 23 24 namespace OHOS { 25 namespace Contacts { 26 class ContactsUpdateHelper { 27 public: 28 ContactsUpdateHelper(); 29 ~ContactsUpdateHelper(); 30 int UpdateDisplay(std::vector<int> rawContactIdVector, std::vector<std::string> types, 31 std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore, OHOS::NativeRdb::ValuesBucket linkDataDataValues, 32 bool isDelete); 33 OHOS::NativeRdb::ValuesBucket GetUpdateDisPlayNameValuesBucket( 34 OHOS::NativeRdb::ValuesBucket linkDataDataValues, bool isDelete); 35 OHOS::NativeRdb::ValuesBucket GetUpdateSearchNameValuesBucket( 36 OHOS::NativeRdb::ValuesBucket linkDataDataValues, bool isDelete); 37 OHOS::NativeRdb::ValuesBucket GetUpdateCompanyValuesBucket( 38 OHOS::NativeRdb::ValuesBucket linkDataDataValues, bool isDelete); 39 int UpdateName(OHOS::NativeRdb::ValuesBucket linkDataDataValues, bool isDelete, int rawId, std::string type, 40 std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore); 41 void UpdateCallLogByPhoneNum( 42 std::vector<int> &rawContactIdVector, std::shared_ptr<OHOS::NativeRdb::RdbStore> &rdbStore, bool isDelete); 43 std::unique_ptr<OHOS::NativeRdb::AbsSharedResultSet> QueryDataForCallLog( 44 std::shared_ptr<OHOS::NativeRdb::RdbStore> &rdbStore, int contactId); 45 void DataToUpdateCallLog( 46 bool isDelete, int contactId, std::unique_ptr<OHOS::NativeRdb::AbsSharedResultSet> &resultSet); 47 int UpdateCallLog( 48 std::string &phoneNumber, std::string &name, std::string &quickSearch, bool isDelete, bool isCallLog); 49 int UpdateCallLogNameNull(std::string &name, std::string &quickSearch, bool isCallLog); 50 }; 51 } // namespace Contacts 52 } // namespace OHOS 53 54 #endif // CONTACT_UPDATE_HELPER_H 55