1 /* 2 * Copyright (C) 2021 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 TELEPHONY_CELLULAR_CALL_MMI_CODE_UTILS_H 17 #define TELEPHONY_CELLULAR_CALL_MMI_CODE_UTILS_H 18 19 #include <string> 20 #include "cellular_call_data_struct.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 // Man-Machine Interface 25 class MMICodeUtils { 26 public: 27 /** 28 * MMICodeUtils constructor 29 */ 30 MMICodeUtils() = default; 31 32 /** 33 * ~MMICodeUtils destructor 34 */ 35 ~MMICodeUtils() = default; 36 37 /** 38 * IsNeedExecuteMmi 39 * 40 * 3GPP TS 22.030 V4.0.0 (2001-03) 6.5.2 Structure of the MMI 41 * TS 24.080 [10] 42 * 43 * @param analyseString 44 * @return bool 45 */ 46 bool IsNeedExecuteMmi(const std::string &analyseString); 47 48 /** 49 * ExecuteMmiCode 50 * 51 * 3GPP TS 22.030 V16.0.0 (2020-07) 6.5.3 Handling of supplementary services Figure 3.5.3.2 52 * 53 * @param slotId 54 * @return bool 55 */ 56 bool ExecuteMmiCode(int32_t slotId); 57 58 /** 59 * GetMMIData 60 * 61 * @return MMIData 62 */ 63 MMIData GetMMIData(); 64 65 private: 66 /** 67 * RegexMatchMmi 68 * 69 * 3GPP TS 22.030 V4.0.0 (2001-03) 6.5.2 Structure of the MMI 70 * TS 24.080 [10] 71 * 72 * Regex Match Mmi Code 73 * 74 * @param analyseString 75 * @return bool 76 */ 77 bool RegexMatchMmi(const std::string &analyseString); 78 79 private: 80 MMIData mmiData_; 81 }; 82 } // namespace Telephony 83 } // namespace OHOS 84 85 #endif // TELEPHONY_CELLULAR_CALL_MMI_CODE_UTILS_H 86