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: supply cast session manager base adaptor 15 * Author: zhangge 16 * Create: 2022-5-29 17 */ 18 19 #ifndef I_CAST_SESSION_MANAGER_ADAPTOR_H 20 #define I_CAST_SESSION_MANAGER_ADAPTOR_H 21 22 #include <memory> 23 24 #include "cast_engine_common.h" 25 #include "i_cast_session.h" 26 #include "i_cast_session_manager_listener.h" 27 #include "iremote_object.h" 28 29 namespace OHOS { 30 namespace CastEngine { 31 class EXPORT ICastSessionManagerAdaptor { 32 public: 33 ICastSessionManagerAdaptor() = default; 34 ICastSessionManagerAdaptor(const ICastSessionManagerAdaptor &) = delete; 35 ICastSessionManagerAdaptor &operator = (const ICastSessionManagerAdaptor &) = delete; 36 ICastSessionManagerAdaptor(ICastSessionManagerAdaptor &&) = delete; 37 ICastSessionManagerAdaptor &operator = (ICastSessionManagerAdaptor &&) = delete; 38 virtual ~ICastSessionManagerAdaptor() = default; 39 40 virtual int32_t RegisterListener(std::shared_ptr<ICastSessionManagerListener> listener, 41 sptr<IRemoteObject::DeathRecipient> deathRecipient) = 0; 42 virtual int32_t UnregisterListener() = 0; 43 virtual int32_t Release() = 0; 44 virtual int32_t SetLocalDevice(const CastLocalDevice &localDevice) = 0; 45 virtual int32_t CreateCastSession(const CastSessionProperty &property, 46 std::shared_ptr<ICastSession> &castSession) = 0; 47 virtual int32_t SetSinkSessionCapacity(int sessionCapacity) = 0; 48 virtual int32_t StartDiscovery(int protocols) = 0; 49 virtual int32_t SetDiscoverable(bool enable) = 0; 50 virtual int32_t StopDiscovery() = 0; 51 virtual int32_t GetCastSession(std::string sessionId, std::shared_ptr<ICastSession> &castSession) = 0; 52 }; 53 } // namespace CastEngine 54 } // namespace OHOS 55 56 #endif // I_CAST_SESSION_MANAGER_ADAPTOR_H