1 /* 2 * Copyright (C) 2021-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 CALL_ABILITY_CALLBACK_H 17 #define CALL_ABILITY_CALLBACK_H 18 19 #include <memory> 20 #include <mutex> 21 22 #include "ipc_types.h" 23 24 #include "call_ability_callback_stub.h" 25 #include "call_manager_callback.h" 26 27 namespace OHOS { 28 namespace Telephony { 29 class CallAbilityCallback : public CallAbilityCallbackStub { 30 public: 31 CallAbilityCallback(); 32 ~CallAbilityCallback() override; 33 int32_t SetProcessCallback(std::unique_ptr<CallManagerCallback> callback); 34 int32_t OnCallDetailsChange(const CallAttributeInfo &info) override; 35 int32_t OnCallEventChange(const CallEventInfo &info) override; 36 int32_t OnCallDisconnectedCause(const DisconnectedDetails &details) override; 37 int32_t OnReportAsyncResults(CallResultReportId reportId, AppExecFwk::PacMap &resultInfo) override; 38 int32_t OnOttCallRequest(OttCallRequestId requestId, AppExecFwk::PacMap &info) override; 39 int32_t OnReportMmiCodeResult(const MmiCodeInfo &info) override; 40 int32_t OnReportAudioDeviceChange(const AudioDeviceInfo &info) override; 41 int32_t OnReportPostDialDelay(const std::string &str) override; 42 int32_t OnReportImsCallModeChange(const CallMediaModeInfo &imsCallModeInfo) override; 43 int32_t OnReportCallSessionEventChange(const CallSessionEvent &callSessionEventOptions) override; 44 int32_t OnReportPeerDimensionsChange(const PeerDimensionsDetail &peerDimensionsDetail) override; 45 int32_t OnReportCallDataUsageChange(const int64_t dataUsage) override; 46 int32_t OnReportCameraCapabilities(const CameraCapabilities &cameraCapabilities) override; 47 48 private: 49 std::unique_ptr<CallManagerCallback> callbackPtr_; 50 std::mutex mutex_; 51 }; 52 } // namespace Telephony 53 } // namespace OHOS 54 55 #endif 56