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_INTERFACE_H 17 #define TELEPHONY_IMS_SMS_INTERFACE_H 18 19 #include "iremote_broker.h" 20 #include "ims_sms_callback_interface.h" 21 22 namespace OHOS { 23 namespace Telephony { 24 class ImsSmsInterface : public IRemoteBroker { 25 public: 26 enum { 27 /****************** sms basic ******************/ 28 IMS_SEND_MESSAGE = 6000, 29 30 /****************** sms config ******************/ 31 IMS_SET_SMS_CONFIG = 6100, 32 IMS_GET_SMS_CONFIG, 33 34 /****************** callback ******************/ 35 IMS_SMS_REGISTER_CALLBACK = 6500, 36 }; 37 38 /** 39 * IMS send message interface 40 * 41 * @param slotId 42 * @param imsMessageInfo 43 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 44 */ 45 virtual int32_t ImsSendMessage(int32_t slotId, const ImsMessageInfo &imsMessageInfo) = 0; 46 47 /** 48 * IMS set ims sms config interface 49 * 50 * @param slotId 51 * @param imsSmsConfig 1:enable ims sms, 0:disable ims sms 52 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 53 */ 54 virtual int32_t ImsSetSmsConfig(int32_t slotId, int32_t imsSmsConfig) = 0; 55 56 /** 57 * IMS get sms config interface 58 * 59 * @param slotId 60 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 61 */ 62 virtual int32_t ImsGetSmsConfig(int32_t slotId) = 0; 63 64 /** 65 * Register CallBack 66 * 67 * @param sptr<ImsSmsCallbackInterface> 68 * @return Returns TELEPHONY_SUCCESS on success, others on failure. 69 */ 70 virtual int32_t RegisterImsSmsCallback(const sptr<ImsSmsCallbackInterface> &callback) = 0; 71 72 public: 73 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.ImsSmsInterface"); 74 }; 75 } // namespace Telephony 76 } // namespace OHOS 77 78 #endif // TELEPHONY_IMS_SMS_INTERFACE_H 79