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_CONTROL_H 17 #define CONTACT_CONTROL_H 18 19 #include "ability.h" 20 #include "ability_context.h" 21 #include "context.h" 22 #include "datashare_helper.h" 23 #include "datashare_predicates.h" 24 #include "rdb_errno.h" 25 #include "rdb_helper.h" 26 #include "rdb_open_callback.h" 27 #include "rdb_predicates.h" 28 #include "rdb_store.h" 29 #include "result_set.h" 30 31 namespace OHOS { 32 namespace ContactsFfi { 33 class ContactsControl { 34 public: 35 ContactsControl(); 36 ~ContactsControl(); 37 int RawContactInsert(std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, 38 DataShare::DataShareValuesBucket rawContactValues); 39 int ContactDataInsert(std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, 40 std::vector<DataShare::DataShareValuesBucket> contactsDataValues); 41 int RawContactUpdate(std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, 42 DataShare::DataShareValuesBucket updateValues, DataShare::DataSharePredicates predicates); 43 int ContactDataUpdate(std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, 44 DataShare::DataShareValuesBucket updateValues, DataShare::DataSharePredicates predicates); 45 int ContactDelete(std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, 46 DataShare::DataSharePredicates predicates); 47 int ContactDataDelete(std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, 48 DataShare::DataSharePredicates predicates); 49 std::shared_ptr<DataShare::DataShareResultSet> ContactQuery( 50 std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, std::vector<std::string> columns, 51 DataShare::DataSharePredicates predicates); 52 std::shared_ptr<DataShare::DataShareResultSet> ContactDataQuery( 53 std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, std::vector<std::string> columns, 54 DataShare::DataSharePredicates predicates); 55 std::shared_ptr<DataShare::DataShareResultSet> GroupsQuery( 56 std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, std::vector<std::string> columns, 57 DataShare::DataSharePredicates predicates); 58 std::shared_ptr<DataShare::DataShareResultSet> MyCardQuery( 59 std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, std::vector<std::string> columns, 60 DataShare::DataSharePredicates predicates); 61 std::shared_ptr<DataShare::DataShareResultSet> HolderQuery( 62 std::shared_ptr<DataShare::DataShareHelper> dataShareHelper, std::vector<std::string> columns, 63 DataShare::DataSharePredicates predicates); 64 }; 65 } // namespace ContactsApi 66 } // namespace OHOS 67 #endif // CONTACT_CONTROL_H 68