Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
JSONRPC Namespace Reference

Classes

class  CAddonsOperations
 
class  CApplicationOperations
 
class  CAudioLibrary
 
class  CDatabaseOperations
 
class  CFavouritesOperations
 
class  CFileItemHandler
 
class  CFileOperations
 
class  CGUIOperations
 
class  CInputOperations
 
class  CJSONRPC
 JSON RPC handler. More...
 
class  CJSONRPCUtils
 
class  CJSONServiceDescription
 Helper class for json schema service descriptor based service descriptions for the json rpc API. More...
 
class  CJSONUtils
 Helper class containing utility methods to handle json rpc method calls. More...
 
class  CPlayerOperations
 
class  CPlaylistOperations
 
class  CProfilesOperations
 
class  CPVROperations
 
class  CSettingsOperations
 
class  CSystemOperations
 
class  CTCPServer
 
class  CTextureOperations
 
class  CVideoLibrary
 
class  CXBMCOperations
 
class  IClient
 
class  IJSONRPCAnnouncer
 
class  ITransportLayer
 
class  JsonRpcMethod
 Structure for a published json rpc method. More...
 
struct  JsonRpcMethodMap
 Structure mapping a json rpc method definition to an actual method implementation. More...
 
struct  JsonRpcStatusDescription
 Describes a JSONRPC_STATUS that is reported to a client as an error. More...
 
class  JSONSchemaTypeDefinition
 Class for a parameter of a json rpc method. More...
 
struct  ParsedSetSourceContent
 

Typedefs

typedef JSONRPC_STATUS(* MethodCall) (const std::string &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
 Function pointer for JSON-RPC methods.
 
typedef std::shared_ptr< JSONSchemaTypeDefinitionJSONSchemaTypeDefinitionPtr
 

Enumerations

enum  TransportLayerCapability { Response = 0x1 , Announcing = 0x2 , FileDownloadRedirect = 0x4 , FileDownloadDirect = 0x8 }
 
enum  JSONRPC_STATUS {
  OK = 0 , ACK = -1 , InvalidRequest = -32600 , MethodNotFound = -32601 ,
  InvalidParams = -32602 , InternalError = -32603 , ParseError = -32700 , BadPermission = -32099 ,
  NotFound = -32098 , Unavailable = -32097 , FailedToExecute = -32100
}
 Possible status codes of a response to a JSON-RPC request. More...
 
enum  OperationPermission {
  ReadData = 0x1 , ControlPlayback = 0x2 , ControlNotify = 0x4 , ControlPower = 0x8 ,
  UpdateData = 0x10 , RemoveData = 0x20 , Navigate = 0x40 , WriteFile = 0x80 ,
  ControlSystem = 0x100 , ControlGUI = 0x200 , ManageAddon = 0x400 , ExecuteAddon = 0x800 ,
  ControlPVR = 0x1000
}
 Permission categories for json rpc methods. More...
 
enum  JSONSchemaType {
  NullValue = 0x01 , StringValue = 0x02 , NumberValue = 0x04 , IntegerValue = 0x08 ,
  BooleanValue = 0x10 , ArrayValue = 0x20 , ObjectValue = 0x40 , AnyValue = 0x80
}
 Possible value types of a parameter or return type. More...
 
enum  PlayerType {
  None = 0 , Video = 0x1 , Audio = 0x2 , Picture = 0x4 ,
  External = 0x8 , Remote = 0x10
}
 
enum class  SourceContentClearMode { CLEAR , EXCLUDE , REMOVE }
 What clearing a path's content binding should do to the items already scraped from it. More...
 

Functions

const JsonRpcStatusDescriptionStatusToDescription (JSONRPC_STATUS status)
 Returns the description of the given JSONRPC_STATUS.
 
const char * PermissionToString (const OperationPermission &permission)
 Returns a string representation for the given OperationPermission.
 
OperationPermission StringToPermission (const std::string &permission)
 Returns a OperationPermission value for the given string representation.
 
JSONRPC_STATUS ParseSetSourceContentParams (const CVariant &parameterObject, ParsedSetSourceContent &parsed)
 Parse and validate the parameters of VideoLibrary.SetSourceContent.
 

Variables

constexpr std::array< JsonRpcStatusDescription, 9 > JSONRPC_STATUS_DESCRIPTIONS
 The error taxonomy of the JSON-RPC API.
 
const int OPERATION_PERMISSION_ALL
 
const int OPERATION_PERMISSION_NOTIFICATION
 

Typedef Documentation

◆ JSONSchemaTypeDefinitionPtr

◆ MethodCall

typedef JSONRPC_STATUS(* JSONRPC::MethodCall) (const std::string &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)

Function pointer for JSON-RPC methods.

Enumeration Type Documentation

◆ JSONSchemaType

Possible value types of a parameter or return type.

Enumerator
NullValue 
StringValue 
NumberValue 
IntegerValue 
BooleanValue 
ArrayValue 
ObjectValue 
AnyValue 

◆ PlayerType

Enumerator
None 
Video 
Audio 
Picture 
External 
Remote 

◆ SourceContentClearMode

What clearing a path's content binding should do to the items already scraped from it.

Enumerator
CLEAR 
EXCLUDE 
REMOVE 

◆ TransportLayerCapability

Enumerator
Response 
Announcing 
FileDownloadRedirect 
FileDownloadDirect 

Function Documentation

◆ ParseSetSourceContentParams()

JSONRPC_STATUS JSONRPC::ParseSetSourceContentParams ( const CVariant & parameterObject,
ParsedSetSourceContent & parsed )

Parse and validate the parameters of VideoLibrary.SetSourceContent.

The scan settings produced are those CGUIDialogContentSettings::Show() writes for the same choices. The caller's three flags do not map onto SScanSettings one for one, because parent_name_root has no column and is derived on read from parent_name and recurse.

Parameters
parameterObjectthe JSON-RPC parameters, with schema defaults already applied
parsedfilled in on success
Returns
OK, or InvalidParams

◆ PermissionToString()

const char * JSONRPC::PermissionToString ( const OperationPermission & permission)
inline

Returns a string representation for the given OperationPermission.

Parameters
permissionSpecific OperationPermission
Returns
String representation of the given OperationPermission

◆ StatusToDescription()

const JsonRpcStatusDescription * JSONRPC::StatusToDescription ( JSONRPC_STATUS status)
inline

Returns the description of the given JSONRPC_STATUS.

Parameters
statusSpecific JSONRPC_STATUS
Returns
Description of the given status, or nullptr if it is not reported as an error

◆ StringToPermission()

OperationPermission JSONRPC::StringToPermission ( const std::string & permission)
inline

Returns a OperationPermission value for the given string representation.

Parameters
permissionString representation of the OperationPermission
Returns
OperationPermission value of the given string representation

Variable Documentation

◆ OPERATION_PERMISSION_ALL

const int JSONRPC::OPERATION_PERMISSION_ALL
Initial value:
=
@ ReadData
Definition JSONRPCUtils.h:132
@ ControlPower
Definition JSONRPCUtils.h:135
@ UpdateData
Definition JSONRPCUtils.h:136
@ ExecuteAddon
Definition JSONRPCUtils.h:143
@ ControlPlayback
Definition JSONRPCUtils.h:133
@ WriteFile
Definition JSONRPCUtils.h:139
@ ManageAddon
Definition JSONRPCUtils.h:142
@ ControlNotify
Definition JSONRPCUtils.h:134
@ Navigate
Definition JSONRPCUtils.h:138
@ RemoveData
Definition JSONRPCUtils.h:137
@ ControlPVR
Definition JSONRPCUtils.h:144
@ ControlSystem
Definition JSONRPCUtils.h:140
@ ControlGUI
Definition JSONRPCUtils.h:141

◆ OPERATION_PERMISSION_NOTIFICATION

const int JSONRPC::OPERATION_PERMISSION_NOTIFICATION