• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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_VOIP_CALL_MANAGER_SERVICE_H
17 #define I_VOIP_CALL_MANAGER_SERVICE_H
18 #include <cstdio>
19 #include <string>
20 #include <vector>
21 
22 #include "i_call_status_callback.h"
23 #include "i_voip_call_manager_callback.h"
24 #include "iremote_broker.h"
25 #include "pac_map.h"
26 #include "voip_call_manager_info.h"
27 
28 namespace OHOS {
29 namespace Telephony {
30 
31 class IVoipCallManagerService : public IRemoteBroker {
32 public:
33     enum {
34         INTERFACE_REPORT_INCOMING_CALL = 0,
35         INTERFACE_REPORT_INCOMING_CALL_ERROR,
36         INTERFACE_REPORT_CALL_STATE_CHANGE,
37         INTERFACE_REGISTER_CALLBACK,
38         INTERFACE_UN_REGISTER_CALLBACK,
39         INTERFACE_REPORT_VOIP_INCOMING_CALL,
40         INTERFACE_REPORT_VOIP_CALL_EXTENSIONID,
41         INTERFACE_REGISTER_CALL_MANAGER_CALLBACK,
42         INTERFACE_UNREGISTER_CALL_MANAGER_CALLBACK,
43         INTERFACE_ANSWER_VOIP_CALL,
44         INTERFACE_HANGUP_VOIP_CALL,
45         INTERFACE_REJECT_VOIP_CALL,
46         INTERFACE_UNLOAD_VOIP_SA
47     };
48     virtual ~IVoipCallManagerService() = default;
49     virtual int32_t ReportIncomingCall(
50         AppExecFwk::PacMap &extras, std::vector<uint8_t> &userProfile, ErrorReason &reason) = 0;
51     virtual int32_t ReportIncomingCallError(AppExecFwk::PacMap &extras) = 0;
52     virtual int32_t ReportCallStateChange(std::string &callId, const VoipCallState &state) = 0;
53     virtual int32_t RegisterCallBack(const sptr<IVoipCallManagerCallback> &callback) = 0;
54     virtual int32_t UnRegisterCallBack() = 0;
55 
56     virtual int32_t ReportVoipIncomingCall(std::string &callId, std::string &bundleName) = 0;
57     virtual int32_t ReportVoipCallExtensionId(
58         std::string &callId, std::string &bundleName, std::string &extensionId) = 0;
59 
60     virtual int32_t RegisterCallManagerCallBack(const sptr<ICallStatusCallback> &callback) = 0;
61     virtual int32_t UnRegisterCallManagerCallBack() = 0;
62     virtual int32_t Answer(const VoipCallEventInfo &events, int32_t videoState) = 0;
63     virtual int32_t Reject(const VoipCallEventInfo &events) = 0;
64     virtual int32_t HangUp(const VoipCallEventInfo &events) = 0;
65     virtual int32_t UnloadVoipSa() = 0;
66 
67 public:
68     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Telephony.IVoipCallManagerService");
69 };
70 } // namespace Telephony
71 } // namespace OHOS
72 
73 #endif
74