180922886Sopenharmony_ci/*
280922886Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
380922886Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
480922886Sopenharmony_ci * you may not use this file except in compliance with the License.
580922886Sopenharmony_ci * You may obtain a copy of the License at
680922886Sopenharmony_ci *
780922886Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
880922886Sopenharmony_ci *
980922886Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1080922886Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1180922886Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1280922886Sopenharmony_ci * See the License for the specific language governing permissions and
1380922886Sopenharmony_ci * limitations under the License.
1480922886Sopenharmony_ci */
1580922886Sopenharmony_ci
1680922886Sopenharmony_ci#ifndef COLLABORATION_MANAGER_H
1780922886Sopenharmony_ci#define COLLABORATION_MANAGER_H
1880922886Sopenharmony_ci
1980922886Sopenharmony_ci#include <string>
2080922886Sopenharmony_ci#include "avsession_log.h"
2180922886Sopenharmony_ci#include "avsession_errors.h"
2280922886Sopenharmony_ci#include "collaboration_manager_utils.h"
2380922886Sopenharmony_ci#include "plugin_lib.h"
2480922886Sopenharmony_ci
2580922886Sopenharmony_cinamespace OHOS::AVSession {
2680922886Sopenharmony_ciclass CollaborationManager {
2780922886Sopenharmony_cipublic:
2880922886Sopenharmony_ci    static CollaborationManager& GetInstance();
2980922886Sopenharmony_ci    CollaborationManager();
3080922886Sopenharmony_ci    virtual ~CollaborationManager();
3180922886Sopenharmony_ci    void SendRejectStateToStopCast(const std::function<void(const int32_t code)>& callback);
3280922886Sopenharmony_ci    int32_t ReadCollaborationManagerSo();
3380922886Sopenharmony_ci    int32_t RegisterLifecycleCallback();
3480922886Sopenharmony_ci    int32_t UnRegisterLifecycleCallback();
3580922886Sopenharmony_ci    int32_t PublishServiceState(const char* peerNetworkId, ServiceCollaborationManagerBussinessStatus state);
3680922886Sopenharmony_ci    int32_t ApplyAdvancedResource(const char* peerNetworkId);
3780922886Sopenharmony_ci
3880922886Sopenharmony_ci    std::function<void(const int32_t code)> sendRejectStateToStopCast_;
3980922886Sopenharmony_ci
4080922886Sopenharmony_ciprivate:
4180922886Sopenharmony_ci    const int32_t remoteHardwareListSize_ = 2;
4280922886Sopenharmony_ci    const int32_t localHardwareListSize_ = 0;
4380922886Sopenharmony_ci    const std::string serviceName_ = "URLCasting";
4480922886Sopenharmony_ci    const std::string dataType_ = "DATA_TYPE_BYTES";
4580922886Sopenharmony_ci    PluginLib pluginLib_ {"/system/lib64/libcfwk_allconnect_client.z.so"};
4680922886Sopenharmony_ci    ServiceCollaborationManager_ResourceRequestInfoSets *resourceRequest_ =
4780922886Sopenharmony_ci        new ServiceCollaborationManager_ResourceRequestInfoSets();
4880922886Sopenharmony_ci    ServiceCollaborationManager_API exportapi_;
4980922886Sopenharmony_ci
5080922886Sopenharmony_ci    using CollaborationManagerExportFunType = int32_t (*)(ServiceCollaborationManager_API *exportapi);
5180922886Sopenharmony_ci    CollaborationManagerExportFunType collaborationManagerExportFun_;
5280922886Sopenharmony_ci    ServiceCollaborationManager_HardwareRequestInfo localHardwareList_;
5380922886Sopenharmony_ci    ServiceCollaborationManager_HardwareRequestInfo remoteHardwareList_[2];
5480922886Sopenharmony_ci    ServiceCollaborationManager_CommunicationRequestInfo communicationRequest_;
5580922886Sopenharmony_ci};
5680922886Sopenharmony_ci}   // namespace OHOS::AVSession
5780922886Sopenharmony_ci#endif //COLLABORATION_MANAGER_H