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 RAW_CONTACT_H 17 #define RAW_CONTACT_H 18 19 #include "datashare_predicates.h" 20 #include "rdb_errno.h" 21 #include "rdb_store.h" 22 23 namespace OHOS { 24 namespace Contacts { 25 class RawContacts { 26 public: 27 RawContacts(); 28 ~RawContacts(); 29 int InsertRawContact(std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore, int64_t &outRawContactId, 30 OHOS::NativeRdb::ValuesBucket rawContactValues); 31 int UpdateRawContact(std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore, 32 OHOS::NativeRdb::ValuesBucket rawContactValues, std::string whereClause, std::vector<std::string> whereArgs); 33 int UpdateRawContactById(int &rawContactId, std::string type, std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore, 34 OHOS::NativeRdb::ValuesBucket rawContactValues); 35 int GetDeleteContactIdByAccountId(std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore, int accountId); 36 int GetDeleteRawContactIdByAccountId(std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore, int accountId); 37 int DeleteRawcontactByRawId(std::shared_ptr<OHOS::NativeRdb::RdbStore> rdbStore, int needDeleteRawContactId); 38 }; 39 } // namespace Contacts 40 } // namespace OHOS 41 #endif // RAW_CONTACT_H 42