1 /*
2  * Copyright (C) 2021-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 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     /**
27      * @brief Indicates the result of sending SMS.
28      */
29     enum SmsSendResult {
30         /**
31          * Indicates that the SMS message is successfully sent.
32          */
33         SEND_SMS_SUCCESS = 0,
34         /**
35          * Indicates that sending the SMS message fails due to an unknown reason.
36          */
37         SEND_SMS_FAILURE_UNKNOWN = 1,
38         /**
39          * Indicates that sending the SMS fails because the modem is powered off.
40          */
41         SEND_SMS_FAILURE_RADIO_OFF = 2,
42         /**
43          * Indicates that sending the SMS message fails because the network is unavailable
44          * or does not support sending or reception of SMS messages.
45          */
46         SEND_SMS_FAILURE_SERVICE_UNAVAILABLE = 3
47     };
48 
49     /**
50      * @brief OnSmsSendResult
51      * Callback to indicate status of sending SMS messages to the SMS service center.
52      *
53      * @param result [in], result of sending sms.
54      */
55     virtual void OnSmsSendResult(const SmsSendResult result) = 0;
56 
57 public:
58     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ISendShortMessageCallback");
59 };
60 } // namespace Telephony
61 } // namespace OHOS
62 #endif