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 I_SEND_SHORT_MESSAGE_CALLBACK_H 17 #define I_SEND_SHORT_MESSAGE_CALLBACK_H 18 19 #include "iremote_broker.h" 20 21 namespace OHOS { 22 namespace Telephony { 23 class ISendShortMessageCallback : public IRemoteBroker { 24 public: 25 virtual ~ISendShortMessageCallback() = default; 26 enum SmsSendResult { 27 /** 28 * Indicates that the SMS message is successfully sent. 29 */ 30 SEND_SMS_SUCCESS = 0, 31 /** 32 * Indicates that sending the SMS message fails due to an unknown reason. 33 */ 34 SEND_SMS_FAILURE_UNKNOWN = 1, 35 /** 36 * Indicates that sending the SMS fails because the modem is powered off. 37 */ 38 SEND_SMS_FAILURE_RADIO_OFF = 2, 39 /** 40 * Indicates that sending the SMS message fails because the network is unavailable 41 * or does not support sending or reception of SMS messages. 42 */ 43 SEND_SMS_FAILURE_SERVICE_UNAVAILABLE = 3 44 }; 45 46 enum SendCallback { ON_SMS_SEND_RESULT }; 47 48 /** 49 * @brief OnSmsDeliveryResult 50 * Status of sending SMS messages to the SMS service center. 51 * @param result [in] 52 */ 53 virtual void OnSmsSendResult(const SmsSendResult result) = 0; 54 55 public: 56 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ISendShortMessageCallback"); 57 }; 58 } // namespace Telephony 59 } // namespace OHOS 60 #endif