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

Class encapsulating information regarding a particular user action to be sent to windows and controls. More...

#include <Action.h>

Public Member Functions

 CAction ()
 
 CAction (int actionID, float amount1=1.0f, float amount2=0.0f, const std::string &name="", unsigned int holdTime=0, unsigned int buttonCode=0)
 
 CAction (int actionID, wchar_t unicode)
 
 CAction (int actionID, unsigned int state, float posX, float posY, float offsetX, float offsetY, float velocityX=0.0f, float velocityY=0.0f, const std::string &name="")
 
 CAction (int actionID, const std::string &name, const CKey &key)
 
 CAction (int actionID, const std::string &name)
 
 CAction (const CAction &other)
 
CActionoperator= (const CAction &rhs)
 
int GetID () const
 Identifier of the action.
 
bool IsMouse () const
 Is this an action from the mouse.
 
bool IsGesture () const
 
const std::string & GetName () const
 Human-readable name of the action.
 
const std::string & GetText () const
 Text of the action if any.
 
void SetText (const std::string &text)
 Set the text payload of the action.
 
float GetAmount (unsigned int index=0) const
 Get an amount associated with this action.
 
void ClearAmount ()
 Reset all amount values to zero.
 
wchar_t GetUnicode () const
 Unicode value associated with this action.
 
unsigned int GetHoldTime () const
 Time in ms that the key has been held.
 
float GetRepeat () const
 Time since last repeat in ms.
 
unsigned int GetButtonCode () const
 Button code that triggered this action.
 
bool IsAnalog () const
 

Detailed Description

Class encapsulating information regarding a particular user action to be sent to windows and controls.

Constructor & Destructor Documentation

◆ CAction() [1/7]

CAction::CAction ( )

◆ CAction() [2/7]

CAction::CAction ( int actionID,
float amount1 = 1.0f,
float amount2 = 0.0f,
const std::string & name = "",
unsigned int holdTime = 0,
unsigned int buttonCode = 0 )

◆ CAction() [3/7]

CAction::CAction ( int actionID,
wchar_t unicode )

◆ CAction() [4/7]

CAction::CAction ( int actionID,
unsigned int state,
float posX,
float posY,
float offsetX,
float offsetY,
float velocityX = 0.0f,
float velocityY = 0.0f,
const std::string & name = "" )

◆ CAction() [5/7]

CAction::CAction ( int actionID,
const std::string & name,
const CKey & key )

◆ CAction() [6/7]

CAction::CAction ( int actionID,
const std::string & name )

◆ CAction() [7/7]

CAction::CAction ( const CAction & other)
inline

Member Function Documentation

◆ ClearAmount()

void CAction::ClearAmount ( )

Reset all amount values to zero.

◆ GetAmount()

float CAction::GetAmount ( unsigned int index = 0) const
inline

Get an amount associated with this action.

Parameters
zero-basedindex of amount to retrieve, defaults to 0
Returns
an amount associated with this action

◆ GetButtonCode()

unsigned int CAction::GetButtonCode ( ) const
inline

Button code that triggered this action.

Returns
button code

◆ GetHoldTime()

unsigned int CAction::GetHoldTime ( ) const
inline

Time in ms that the key has been held.

Returns
time that the key has been held down in ms.

◆ GetID()

int CAction::GetID ( ) const
inline

Identifier of the action.

Returns
id of the action

◆ GetName()

const std::string & CAction::GetName ( ) const
inline

Human-readable name of the action.

Returns
name of the action

◆ GetRepeat()

float CAction::GetRepeat ( ) const
inline

Time since last repeat in ms.

Returns
time since last repeat in ms. Returns 0 if unknown.

◆ GetText()

const std::string & CAction::GetText ( ) const
inline

Text of the action if any.

Returns
text payload of this action.

◆ GetUnicode()

wchar_t CAction::GetUnicode ( ) const
inline

Unicode value associated with this action.

Returns
unicode value associated with this action, for keyboard input.

◆ IsAnalog()

bool CAction::IsAnalog ( ) const

◆ IsGesture()

bool CAction::IsGesture ( ) const

◆ IsMouse()

bool CAction::IsMouse ( ) const

Is this an action from the mouse.

Returns
true if this is a mouse action, false otherwise

◆ operator=()

CAction & CAction::operator= ( const CAction & rhs)

◆ SetText()

void CAction::SetText ( const std::string & text)
inline

Set the text payload of the action.

Parameters
textto be set

The documentation for this class was generated from the following files: