1e5d0e473Sopenharmony_ci/*
2e5d0e473Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd.
3e5d0e473Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4e5d0e473Sopenharmony_ci * you may not use this file except in compliance with the License.
5e5d0e473Sopenharmony_ci * You may obtain a copy of the License at
6e5d0e473Sopenharmony_ci *
7e5d0e473Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8e5d0e473Sopenharmony_ci *
9e5d0e473Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10e5d0e473Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11e5d0e473Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12e5d0e473Sopenharmony_ci * See the License for the specific language governing permissions and
13e5d0e473Sopenharmony_ci * limitations under the License.
14e5d0e473Sopenharmony_ci */
15e5d0e473Sopenharmony_ci
16e5d0e473Sopenharmony_ci#ifndef TELEPHONY_IMS_SMS_PROXY_H
17e5d0e473Sopenharmony_ci#define TELEPHONY_IMS_SMS_PROXY_H
18e5d0e473Sopenharmony_ci
19e5d0e473Sopenharmony_ci#include "ims_sms_interface.h"
20e5d0e473Sopenharmony_ci#include "iremote_proxy.h"
21e5d0e473Sopenharmony_ci
22e5d0e473Sopenharmony_ci#include "telephony_log_wrapper.h"
23e5d0e473Sopenharmony_ci
24e5d0e473Sopenharmony_cinamespace OHOS {
25e5d0e473Sopenharmony_cinamespace Telephony {
26e5d0e473Sopenharmony_ciclass ImsSmsProxy : public IRemoteProxy<ImsSmsInterface> {
27e5d0e473Sopenharmony_cipublic:
28e5d0e473Sopenharmony_ci    explicit ImsSmsProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<ImsSmsInterface>(impl) {}
29e5d0e473Sopenharmony_ci    ~ImsSmsProxy() = default;
30e5d0e473Sopenharmony_ci
31e5d0e473Sopenharmony_ci    /**
32e5d0e473Sopenharmony_ci     * @brief IMS send message interface.
33e5d0e473Sopenharmony_ci     *
34e5d0e473Sopenharmony_ci     * @param slotId Indicates the card slot index number,
35e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
36e5d0e473Sopenharmony_ci     * @param imsMessageInfo Indicates the information of IMS message.
37e5d0e473Sopenharmony_ci     * @return Returns TELEPHONY_SUCCESS on success, others on failure.
38e5d0e473Sopenharmony_ci     */
39e5d0e473Sopenharmony_ci    int32_t ImsSendMessage(int32_t slotId, const ImsMessageInfo &imsMessageInfo) override;
40e5d0e473Sopenharmony_ci
41e5d0e473Sopenharmony_ci    /**
42e5d0e473Sopenharmony_ci     * @brief IMS set ims sms config interface.
43e5d0e473Sopenharmony_ci     *
44e5d0e473Sopenharmony_ci     * @param slotId Indicates the card slot index number,
45e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
46e5d0e473Sopenharmony_ci     * @param imsSmsConfig 1:enable ims sms, 0:disable ims sms
47e5d0e473Sopenharmony_ci     * @return Returns TELEPHONY_SUCCESS on success, others on failure.
48e5d0e473Sopenharmony_ci     */
49e5d0e473Sopenharmony_ci    int32_t ImsSetSmsConfig(int32_t slotId, int32_t imsSmsConfig) override;
50e5d0e473Sopenharmony_ci
51e5d0e473Sopenharmony_ci    /**
52e5d0e473Sopenharmony_ci     * @brief IMS get sms config interface.
53e5d0e473Sopenharmony_ci     *
54e5d0e473Sopenharmony_ci     * @param slotId Indicates the card slot index number,
55e5d0e473Sopenharmony_ci     * ranging from {@code 0} to the maximum card slot index number supported by the device.
56e5d0e473Sopenharmony_ci     * @return Returns TELEPHONY_SUCCESS on success, others on failure.
57e5d0e473Sopenharmony_ci     */
58e5d0e473Sopenharmony_ci    int32_t ImsGetSmsConfig(int32_t slotId) override;
59e5d0e473Sopenharmony_ci
60e5d0e473Sopenharmony_ci    /**
61e5d0e473Sopenharmony_ci     * @brief Register CallBack to listen the response from ImsSms.
62e5d0e473Sopenharmony_ci     *
63e5d0e473Sopenharmony_ci     * @param sptr<ImsSmsCallbackInterface>
64e5d0e473Sopenharmony_ci     * @return Returns TELEPHONY_SUCCESS on success, others on failure.
65e5d0e473Sopenharmony_ci     */
66e5d0e473Sopenharmony_ci    int32_t RegisterImsSmsCallback(const sptr<ImsSmsCallbackInterface> &callback) override;
67e5d0e473Sopenharmony_ci
68e5d0e473Sopenharmony_ciprivate:
69e5d0e473Sopenharmony_ci    int32_t WriteCommonInfo(std::string funcName, MessageParcel &in, int32_t slotId);
70e5d0e473Sopenharmony_ci    int32_t SendRequest(MessageParcel &in, int32_t slotId, int32_t eventId);
71e5d0e473Sopenharmony_ci
72e5d0e473Sopenharmony_ciprivate:
73e5d0e473Sopenharmony_ci    static inline BrokerDelegator<ImsSmsProxy> delegator_;
74e5d0e473Sopenharmony_ci};
75e5d0e473Sopenharmony_ci} // namespace Telephony
76e5d0e473Sopenharmony_ci} // namespace OHOS
77e5d0e473Sopenharmony_ci
78e5d0e473Sopenharmony_ci#endif // TELEPHONY_IMS_SMS_PROXY_H
79