| 1 |
/* |
| 2 |
* Copyright (C) 2012-2023 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "pvr/channels/PVRChannelGroup.h" |
| 12 |
|
| 13 |
namespace PVR |
| 14 |
{ |
| 15 |
|
| 16 |
class CPVRChannelGroupFromClient : public CPVRChannelGroup |
| 17 |
{ |
| 18 |
public: |
| 19 |
/*! |
| 20 |
* @brief Create a new channel group instance. |
| 21 |
* @param path The channel group path. |
| 22 |
* @param allChannelsGroup The channel group containing all TV or radio channels. |
| 23 |
*/ |
| 24 |
CPVRChannelGroupFromClient(const CPVRChannelsPath& path, |
| 25 |
const std::shared_ptr<const CPVRChannelGroup>& allChannelsGroup); |
| 26 |
|
| 27 |
/*! |
| 28 |
* @brief Create a new channel group instance from a channel group provided by a PVR client. |
| 29 |
* @param group The channel group provided by the client. |
| 30 |
* @param clientID The id of the client providing the group. |
| 31 |
* @param allChannelsGroup The channel group containing all TV or radio channels. |
| 32 |
*/ |
| 33 |
CPVRChannelGroupFromClient(const PVR_CHANNEL_GROUP& group, |
| 34 |
int clientID, |
| 35 |
const std::shared_ptr<const CPVRChannelGroup>& allChannelsGroup); |
| 36 |
|
| 37 |
/*! |
| 38 |
* @brief Check whether this group could be deleted by the user. |
| 39 |
* @return True if the group could be deleted, false otherwise. |
| 40 |
*/ |
| 41 |
bool SupportsDelete() const override { return false; } |
| 42 |
|
| 43 |
/*! |
| 44 |
* @brief Check whether members could be added to this group by the user. |
| 45 |
* @return True if members could be added, false otherwise. |
| 46 |
*/ |
| 47 |
bool SupportsMemberAdd() const override { return false; } |
| 48 |
|
| 49 |
/*! |
| 50 |
* @brief Check whether members could be removed from this group by the user. |
| 51 |
* @return True if members could be removed, false otherwise. |
| 52 |
*/ |
| 53 |
bool SupportsMemberRemove() const override { return false; } |
| 54 |
|
| 55 |
/*! |
| 56 |
* @brief Check whether this group is owner of the channel instances it contains. |
| 57 |
* @return True if owner, false otherwise. |
| 58 |
*/ |
| 59 |
bool IsChannelsOwner() const override { return false; } |
| 60 |
|
| 61 |
/*! |
| 62 |
* @brief Update data with channel group members from the given clients, sync with local data. |
| 63 |
* @param clients The clients to fetch data from. Leave empty to fetch data from all created clients. |
| 64 |
* @return True on success, false otherwise. |
| 65 |
*/ |
| 66 |
bool UpdateFromClients(const std::vector<std::shared_ptr<CPVRClient>>& clients) override; |
| 67 |
|
| 68 |
private: |
| 69 |
/*! |
| 70 |
* @brief Return the type of this group. |
| 71 |
*/ |
| 72 |
int GroupType() const override { return PVR_GROUP_TYPE_REMOTE; } |
| 73 |
}; |
| 74 |
} // namespace PVR |