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 service base class. 15 * Author: zhangge 16 * Create: 2022-6-15 17 */ 18 19 #ifndef I_CAST_SESSION_MANAGER_SERVICE_H 20 #define I_CAST_SESSION_MANAGER_SERVICE_H 21 22 #include "cast_engine_common.h" 23 #include "i_cast_session_manager_listener.h" 24 #include "i_cast_session_impl.h" 25 #include "i_cast_service_listener_impl.h" 26 #include "iremote_broker.h" 27 28 namespace OHOS { 29 namespace CastEngine { 30 class ICastSessionManagerService : public IRemoteBroker { 31 public: 32 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.CastEngine.ICastSessionManagerService"); 33 34 ICastSessionManagerService() = default; 35 ICastSessionManagerService(const ICastSessionManagerService &) = delete; 36 ICastSessionManagerService &operator=(const ICastSessionManagerService &) = delete; 37 ICastSessionManagerService(ICastSessionManagerService &&) = delete; 38 ICastSessionManagerService &operator=(ICastSessionManagerService &&) = delete; 39 ~ICastSessionManagerService() override = default; 40 41 virtual int32_t RegisterListener(sptr<ICastServiceListenerImpl> listener) = 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, sptr<ICastSessionImpl> &castSession) = 0; 46 virtual int32_t SetSinkSessionCapacity(int sessionCapacity) = 0; 47 virtual int32_t StartDiscovery(int protocols) = 0; 48 virtual int32_t SetDiscoverable(bool enable) = 0; 49 virtual int32_t StopDiscovery() = 0; 50 virtual int32_t GetCastSession(std::string sessionId, sptr<ICastSessionImpl> &castSession) = 0; 51 52 protected: 53 enum { 54 REGISTER_LISTENER = 0, 55 UNREGISTER_LISTENER, 56 RELEASE, 57 SET_LOCAL_DEVICE, 58 CREATE_CAST_SESSION, 59 SET_SINK_SESSION_CAPACITY, 60 START_DISCOVERY, 61 SET_DISCOVERABLE, 62 STOP_DISCOVERY, 63 GET_CAST_SESSION 64 }; 65 }; 66 } // namespace CastEngine 67 } // namespace OHOS 68 #endif