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 VCARD_CONFIGURATION_H 17 #define VCARD_CONFIGURATION_H 18 #include <cstdint> 19 #include <vector> 20 21 namespace OHOS { 22 namespace Telephony { 23 class VCardConfiguration { 24 public: 25 static const int32_t VER_21 = 0; 26 static const int32_t VER_30 = 1; 27 static const int32_t VER_40 = 2; 28 static const int32_t VER_FLAG = 3; 29 static const int32_t FLAG_REFRAIN_PHONE_NUMBER_FORMATTING = 0x02000000; 30 static const int32_t NAME_ORDER_JAPANESE = 0x8; 31 static const int32_t FLAG_USE_DEFACT_PROPERTY = 0x40000000; 32 static const int32_t FLAG_USE_ANZHUO_PROPERTY = 0x80000000; 33 static const int32_t FLAG_CONVERT_PHONETIC_NAME_STRINGS = 0x08000000; 34 static const int32_t FLAG_REFRAIN_QP_TO_NAME_PROPERTIES = 0x10000000; 35 static const int32_t FLAG_DOCOMO = 0x20000000; 36 static const int32_t VCARD_TYPE_V21_JAPANESE = 37 (VER_21 | NAME_ORDER_JAPANESE | FLAG_USE_DEFACT_PROPERTY | FLAG_USE_ANZHUO_PROPERTY); 38 static const int32_t VCARD_TYPE_V30_JAPANESE = 39 (VER_30 | NAME_ORDER_JAPANESE | FLAG_USE_DEFACT_PROPERTY | FLAG_USE_ANZHUO_PROPERTY); 40 static const int32_t VCARD_TYPE_V21_JAPANESE_MOBILE = 41 (VER_21 | NAME_ORDER_JAPANESE | FLAG_CONVERT_PHONETIC_NAME_STRINGS | FLAG_REFRAIN_QP_TO_NAME_PROPERTIES); 42 static const int32_t VCARD_TYPE_DOCOMO = (VCARD_TYPE_V21_JAPANESE_MOBILE | FLAG_DOCOMO); 43 static bool IsVer21(int32_t vcardType); 44 static bool IsVer30(int32_t vcardType); 45 static bool IsVer40(int32_t vcardType); 46 static bool RefrainPhoneNumberFormatting(const int32_t vcardType); 47 static bool IsJapaneseDevice(const int32_t vcardType); 48 }; 49 } // namespace Telephony 50 } // namespace OHOS 51 #endif // VVCARD_CONFIGURATION_H