1 /* 2 * Copyright (C) 2023-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 * Description: connection manager session listener 15 * Author: jiangfan 16 * Create: 2023-11-08 17 */ 18 19 #ifndef CONNECTION_MANAGER_LISTENER_H 20 #define CONNECTION_MANAGER_LISTENER_H 21 22 #include "cast_engine_common.h" 23 24 namespace OHOS { 25 namespace CastEngine { 26 namespace CastEngineService { 27 28 class IConnectionManagerListener { 29 public: 30 IConnectionManagerListener() = default; 31 virtual ~IConnectionManagerListener() = default; 32 33 virtual int NotifySessionIsReady() = 0; 34 virtual void ReportSessionCreate(int castSessionId) = 0; 35 virtual void NotifyDeviceIsOffline(const std::string &deviceId) = 0; 36 virtual bool NotifyRemoteDeviceIsReady(int castSessionId, const CastInnerRemoteDevice &device) = 0; 37 virtual void GrabDevice(int32_t sessionId) = 0; 38 virtual int32_t GetSessionProtocolType(int sessionId, ProtocolType &protocolType) = 0; 39 virtual int32_t SetSessionProtocolType(int sessionId, ProtocolType protocolType) = 0; 40 virtual bool LoadSinkSA(const std::string &networkId) = 0; 41 }; 42 43 class IConnectManagerSessionListener { 44 public: ~IConnectManagerSessionListener()45 virtual ~IConnectManagerSessionListener() {} 46 47 virtual void NotifyConnectStage(const std::string &deviceId, int result, int32_t reasonCode) = 0; 48 }; 49 } // namespace CastEngineService 50 } // namespace CastEngine 51 } // namespace OHOS 52 53 #endif // CONNECTION_MANAGER_LISTENER_H