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 16 #ifndef CONTACTS_H 17 #define CONTACTS_H 18 19 #include <cstdint> 20 #include "contacts_utils.h" 21 #include "datashare_values_bucket.h" 22 23 namespace OHOS { 24 namespace ContactsFfi { 25 26 class Contacts { 27 public: 28 static const int INVALID_CONTACT_ID = -1; 29 Contacts()30 Contacts() {} 31 ~Contacts() = default; 32 33 static int64_t CJaddContact(int64_t contextId, OHOS::DataShare::DataShareValuesBucket rawContact, 34 std::vector<OHOS::DataShare::DataShareValuesBucket> contact, int32_t *errCode); 35 static void CJdeleteContact(int64_t contextId, int64_t predicatesId, int32_t *errCode); 36 static void CJupdateContact(int64_t contextId, int64_t contactId, 37 std::vector<OHOS::DataShare::DataShareValuesBucket> contactData, 38 int64_t predicatesId, int32_t *errCode); 39 static bool CJisLocalContact(int64_t contextId, int64_t contactId, int32_t *errCode); 40 static bool CJisMyCard(int64_t contextId, int64_t contactId, int32_t *errCode); 41 static ContactsData* CJqueryMyCard(int64_t contextId, int64_t predicatesId, int32_t *errCode); 42 static HoldersData* CJqueryHolders(int64_t contextId, int32_t *errCode); 43 static ContactsData* CJqueryContacts(int64_t contextId, int64_t predicatesId, int32_t *errCode); 44 static GroupsData* CJqueryGroups(int64_t contextId, int64_t predicatesId, int32_t *errCode); 45 }; 46 } // namespace ContactsFfi 47 } // namespace OHOS 48 49 #endif // CONTACTS_H 50