1 /* 2 * Copyright (C) 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 TELEPHONY_IMS_SMS_CALLBACK_INTERFACE_H 17 #define TELEPHONY_IMS_SMS_CALLBACK_INTERFACE_H 18 19 #include "iremote_broker.h" 20 21 #include "ims_sms_types.h" 22 #include "hril_types.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 class ImsSmsCallbackInterface : public IRemoteBroker { 27 public: 28 virtual ~ImsSmsCallbackInterface() = default; 29 30 enum { 31 /****************** sms basic ******************/ 32 IMS_SEND_MESSAGE = 0, 33 34 /****************** sms config ******************/ 35 IMS_SET_SMS_CONFIG, 36 IMS_GET_SMS_CONFIG, 37 }; 38 39 /** 40 * @brief ImsSendMessageResponse the result of send the sms by IMS. 41 * 42 * @param slotId Indicates the card slot index number, 43 * ranging from {@code 0} to the maximum card slot index number supported by the device. 44 * @param result Indicates the result of send action. 45 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 46 */ 47 virtual int32_t ImsSendMessageResponse(int32_t slotId, const SendSmsResultInfo &result) = 0; 48 49 /** 50 * @brief ImsSendMessageResponse the fail result of send the sms by IMS. 51 * 52 * @param slotId Indicates the card slot index number, 53 * ranging from {@code 0} to the maximum card slot index number supported by the device. 54 * @param info Indicates details of failure. 55 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 56 */ 57 virtual int32_t ImsSendMessageResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 58 59 /** 60 * @brief ImsSetSmsConfigResponse the result for enable or disable IMS SMS. 61 * 62 * @param slotId Indicates the card slot index number, 63 * ranging from {@code 0} to the maximum card slot index number supported by the device. 64 * @param info Indicates set action was success or failure. 65 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 66 */ 67 virtual int32_t ImsSetSmsConfigResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 68 69 /** 70 * @brief ImsGetSmsConfigResponse the result for get IMS SMS config. 71 * 72 * @param slotId Indicates the card slot index number, 73 * ranging from {@code 0} to the maximum card slot index number supported by the device. 74 * @param imsSmsConfig Indicates Ims sms was enabled or disabled. 75 * ranging {@code 0} Ims sms was disabled {@code 1} Ims sms was enabled. 76 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 77 */ 78 virtual int32_t ImsGetSmsConfigResponse(int32_t slotId, int32_t imsSmsConfig) = 0; 79 80 /** 81 * @brief ImsGetSmsConfigResponse the fail result for get IMS SMS config. 82 * 83 * @param slotId Indicates the card slot index number, 84 * ranging from {@code 0} to the maximum card slot index number supported by the device. 85 * @param info Indicates details of failure. 86 * @return Returns {@code TELEPHONY_SUCCESS} on success, others on failure. 87 */ 88 virtual int32_t ImsGetSmsConfigResponse(int32_t slotId, const HRilRadioResponseInfo &info) = 0; 89 90 public: 91 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ImsSmsCallback"); 92 }; 93 } // namespace Telephony 94 } // namespace OHOS 95 96 #endif // TELEPHONY_IMS_SMS_CALLBACK_INTERFACE_H 97