1 /* 2 * Copyright (C) 2023 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 OHOS_NAPI_VCARD_H 17 #define OHOS_NAPI_VCARD_H 18 19 #include <array> 20 #include <string> 21 #include <vector> 22 23 #include "base_context.h" 24 #include "datashare_helper.h" 25 #include "datashare_predicates.h" 26 #include "napi_base_context.h" 27 #include "napi_vcard_type.h" 28 #include "telephony_napi_common_error.h" 29 30 namespace OHOS { 31 namespace Telephony { 32 const int32_t DEFAULT_ERROR = -1; 33 const int32_t DEFAULT_CARD_TYPE = 0; 34 35 struct ExportContext : BaseContext { 36 std::shared_ptr<DataShare::DataShareHelper> datashareHelper; 37 std::shared_ptr<DataShare::DataSharePredicates> predicates; 38 int32_t cardType = DEFAULT_CARD_TYPE; 39 std::string charset = "UTF-8"; 40 std::string result = ""; 41 }; 42 43 struct ImportContext : BaseContext { 44 std::shared_ptr<DataShare::DataShareHelper> datashareHelper; 45 std::string filePath = ""; 46 int32_t accountId = DEFAULT_ERROR; 47 }; 48 49 } // namespace Telephony 50 } // namespace OHOS 51 #endif // OHOS_NAPI_VCARD_H 52