1d95e75fdSopenharmony_ci/*
2d95e75fdSopenharmony_ci * Copyright (C) 2021-2022 Huawei Device Co., Ltd.
3d95e75fdSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4d95e75fdSopenharmony_ci * you may not use this file except in compliance with the License.
5d95e75fdSopenharmony_ci * You may obtain a copy of the License at
6d95e75fdSopenharmony_ci *
7d95e75fdSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8d95e75fdSopenharmony_ci *
9d95e75fdSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10d95e75fdSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11d95e75fdSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12d95e75fdSopenharmony_ci * See the License for the specific language governing permissions and
13d95e75fdSopenharmony_ci * limitations under the License.
14d95e75fdSopenharmony_ci */
15d95e75fdSopenharmony_ci
16d95e75fdSopenharmony_ci#ifndef CELLULAR_CALL_REGISTER_H
17d95e75fdSopenharmony_ci#define CELLULAR_CALL_REGISTER_H
18d95e75fdSopenharmony_ci
19d95e75fdSopenharmony_ci#include <map>
20d95e75fdSopenharmony_ci#include <mutex>
21d95e75fdSopenharmony_ci
22d95e75fdSopenharmony_ci#include "cellular_call_connection_cs.h"
23d95e75fdSopenharmony_ci#include "i_call_status_callback.h"
24d95e75fdSopenharmony_ci#include "singleton.h"
25d95e75fdSopenharmony_ci#include "ims_call_interface.h"
26d95e75fdSopenharmony_ci
27d95e75fdSopenharmony_cinamespace OHOS {
28d95e75fdSopenharmony_cinamespace Telephony {
29d95e75fdSopenharmony_ciclass CellularCallRegister {
30d95e75fdSopenharmony_ci    DECLARE_DELAYED_SINGLETON(CellularCallRegister);
31d95e75fdSopenharmony_ci
32d95e75fdSopenharmony_cipublic:
33d95e75fdSopenharmony_ci    void ReportCallsInfo(const CallsReportInfo &callsReportInfo);
34d95e75fdSopenharmony_ci
35d95e75fdSopenharmony_ci    void ReportSingleCallInfo(const CallReportInfo &info, TelCallState callState);
36d95e75fdSopenharmony_ci
37d95e75fdSopenharmony_ci    void ReportEventResultInfo(const CellularCallEventInfo &info);
38d95e75fdSopenharmony_ci
39d95e75fdSopenharmony_ci    void ReportGetWaitingResult(const CallWaitResponse &response);
40d95e75fdSopenharmony_ci
41d95e75fdSopenharmony_ci    void ReportSetWaitingResult(int32_t result);
42d95e75fdSopenharmony_ci
43d95e75fdSopenharmony_ci    void ReportGetRestrictionResult(const CallRestrictionResponse &response);
44d95e75fdSopenharmony_ci
45d95e75fdSopenharmony_ci    void ReportSetRestrictionResult(int32_t result);
46d95e75fdSopenharmony_ci
47d95e75fdSopenharmony_ci    void ReportGetTransferResult(const CallTransferResponse &response);
48d95e75fdSopenharmony_ci
49d95e75fdSopenharmony_ci    void ReportSetBarringPasswordResult(int32_t result);
50d95e75fdSopenharmony_ci
51d95e75fdSopenharmony_ci    void ReportSetTransferResult(int32_t result);
52d95e75fdSopenharmony_ci
53d95e75fdSopenharmony_ci    void ReportGetClipResult(const ClipResponse &response);
54d95e75fdSopenharmony_ci
55d95e75fdSopenharmony_ci    void ReportGetClirResult(const ClirResponse &response);
56d95e75fdSopenharmony_ci
57d95e75fdSopenharmony_ci    void ReportSetClirResult(int32_t result);
58d95e75fdSopenharmony_ci
59d95e75fdSopenharmony_ci    void ReportGetImsConfigResult(const GetImsConfigResponse &response);
60d95e75fdSopenharmony_ci
61d95e75fdSopenharmony_ci    void ReportSetImsConfigResult(int32_t result);
62d95e75fdSopenharmony_ci
63d95e75fdSopenharmony_ci    void ReportGetImsFeatureResult(const GetImsFeatureValueResponse &response);
64d95e75fdSopenharmony_ci
65d95e75fdSopenharmony_ci    void ReportSetImsFeatureResult(int32_t result);
66d95e75fdSopenharmony_ci
67d95e75fdSopenharmony_ci    void ReportCallRingBackResult(int32_t status);
68d95e75fdSopenharmony_ci
69d95e75fdSopenharmony_ci    void ReportSetMuteResult(const MuteControlResponse &response);
70d95e75fdSopenharmony_ci
71d95e75fdSopenharmony_ci    void ReportGetMuteResult(const MuteControlResponse &response);
72d95e75fdSopenharmony_ci
73d95e75fdSopenharmony_ci    void ReportCallFailReason(const DisconnectedDetails &details);
74d95e75fdSopenharmony_ci
75d95e75fdSopenharmony_ci    void ReportInviteToConferenceResult(int32_t result);
76d95e75fdSopenharmony_ci
77d95e75fdSopenharmony_ci    void ReportGetCallDataResult(int32_t result);
78d95e75fdSopenharmony_ci
79d95e75fdSopenharmony_ci    void ReportStartDtmfResult(int32_t result);
80d95e75fdSopenharmony_ci
81d95e75fdSopenharmony_ci    void ReportStopDtmfResult(int32_t result);
82d95e75fdSopenharmony_ci
83d95e75fdSopenharmony_ci    void ReportStartRttResult(int32_t result);
84d95e75fdSopenharmony_ci
85d95e75fdSopenharmony_ci    void ReportStopRttResult(int32_t result);
86d95e75fdSopenharmony_ci
87d95e75fdSopenharmony_ci    void ReportSendUssdResult(int32_t result);
88d95e75fdSopenharmony_ci
89d95e75fdSopenharmony_ci    void ReportCloseUnFinishedUssdResult(int32_t result);
90d95e75fdSopenharmony_ci
91d95e75fdSopenharmony_ci    int32_t RegisterCallManagerCallBack(const sptr<ICallStatusCallback> &callback);
92d95e75fdSopenharmony_ci
93d95e75fdSopenharmony_ci    int32_t UnRegisterCallManagerCallBack();
94d95e75fdSopenharmony_ci
95d95e75fdSopenharmony_ci    void ReportMmiCodeResult(const MmiCodeInfo &info);
96d95e75fdSopenharmony_ci
97d95e75fdSopenharmony_ci    void ReportSetEmergencyCallListResponse(const SetEccListResponse &response);
98d95e75fdSopenharmony_ci
99d95e75fdSopenharmony_ci    bool IsCallManagerCallBackRegistered();
100d95e75fdSopenharmony_ci
101d95e75fdSopenharmony_ci    void ReportPostDialChar(char c);
102d95e75fdSopenharmony_ci
103d95e75fdSopenharmony_ci    void ReportPostDialDelay(std::string str);
104d95e75fdSopenharmony_ci
105d95e75fdSopenharmony_ci    void ReceiveUpdateCallMediaModeRequest(int32_t slotId, ImsCallModeReceiveInfo &callModeInfo);
106d95e75fdSopenharmony_ci
107d95e75fdSopenharmony_ci    void ReceiveUpdateCallMediaModeResponse(int32_t slotId, ImsCallModeReceiveInfo &callModeInfo);
108d95e75fdSopenharmony_ci
109d95e75fdSopenharmony_ci    void HandleCallSessionEventChanged(ImsCallSessionEventInfo &callSessionEventInfo);
110d95e75fdSopenharmony_ci
111d95e75fdSopenharmony_ci    void HandlePeerDimensionsChanged(ImsCallPeerDimensionsInfo &callPeerDimensionsInfo);
112d95e75fdSopenharmony_ci
113d95e75fdSopenharmony_ci    void HandleCallDataUsageChanged(ImsCallDataUsageInfo &callDataUsageInfo);
114d95e75fdSopenharmony_ci
115d95e75fdSopenharmony_ci    void HandleCameraCapabilitiesChanged(CameraCapabilitiesInfo &cameraCapabilitiesInfo);
116d95e75fdSopenharmony_ci
117d95e75fdSopenharmony_ci    ImsCallMode ConverToImsCallMode(ImsCallType callType);
118d95e75fdSopenharmony_ci
119d95e75fdSopenharmony_ciprivate:
120d95e75fdSopenharmony_ci    sptr<ICallStatusCallback> callManagerCallBack_;
121d95e75fdSopenharmony_ci    std::mutex mutex_;
122d95e75fdSopenharmony_ci};
123d95e75fdSopenharmony_ci} // namespace Telephony
124d95e75fdSopenharmony_ci} // namespace OHOS
125d95e75fdSopenharmony_ci
126d95e75fdSopenharmony_ci#endif // CELLULAR_CALL_REGISTER_H
127