1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "FileItemHandler.h"
#include "JSONRPC.h"
class CFileItemList;
class CVariant;
namespace PLAYLIST
{
using Id = int;
} // namespace PLAYLIST
namespace JSONRPC
{
class CPlaylistOperations : public CFileItemHandler
{
public:
static JSONRPC_STATUS GetPlaylists(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS GetItems(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS Add(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS Remove(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS Insert(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS Clear(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS Swap(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
private:
static PLAYLIST::Id GetPlaylist(const CVariant& playlist);
static JSONRPC_STATUS GetPropertyValue(PLAYLIST::Id playlistId,
const std::string& property,
CVariant& result);
static bool CheckMediaParameter(PLAYLIST::Id playlistId, const CVariant& itemObject);
static bool HandleItemsParameter(PLAYLIST::Id playlistId,
const CVariant& itemParam,
CFileItemList& items);
};
}
|