1 /*
2  * Copyright (C) 2022-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 TELEPHONY_IMS_SMS_INTERFACE_H
17 #define TELEPHONY_IMS_SMS_INTERFACE_H
18 
19 #include "iremote_broker.h"
20 #include "ims_sms_callback_interface.h"
21 #include "ims_sms_ipc_interface_code.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 class ImsSmsInterface : public IRemoteBroker {
26 public:
27     /**
28      * @brief IMS send message interface.
29      *
30      * @param slotId Indicates the card slot index number,
31      * ranging from {@code 0} to the maximum card slot index number supported by the device.
32      * @param imsMessageInfo Indicates the information of IMS message.
33      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
34      */
35     virtual int32_t ImsSendMessage(int32_t slotId, const ImsMessageInfo &imsMessageInfo) = 0;
36 
37     /**
38      * @brief IMS set ims sms config interface.
39      *
40      * @param slotId Indicates the card slot index number,
41      * ranging from {@code 0} to the maximum card slot index number supported by the device.
42      * @param imsSmsConfig 1:enable ims sms, 0:disable ims sms
43      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
44      */
45     virtual int32_t ImsSetSmsConfig(int32_t slotId, int32_t imsSmsConfig) = 0;
46 
47     /**
48      * @brief IMS get sms config interface.
49      *
50      * @param slotId Indicates the card slot index number,
51      * ranging from {@code 0} to the maximum card slot index number supported by the device.
52      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
53      */
54     virtual int32_t ImsGetSmsConfig(int32_t slotId) = 0;
55 
56     /**
57      * @brief Register CallBack to listen the response from ImsSms.
58      *
59      * @param sptr<ImsSmsCallbackInterface>
60      * @return Returns TELEPHONY_SUCCESS on success, others on failure.
61      */
62     virtual int32_t RegisterImsSmsCallback(const sptr<ImsSmsCallbackInterface> &callback) = 0;
63 
64 public:
65     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ImsSmsInterface");
66 };
67 } // namespace Telephony
68 } // namespace OHOS
69 
70 #endif // TELEPHONY_IMS_SMS_INTERFACE_H
71