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

#include <GUIInfoManager.h>

Inheritance diagram for CGUIInfoManager:
KODI::MESSAGING::IMessageTarget

Public Member Functions

 CGUIInfoManager (void)
 
 ~CGUIInfoManager (void) override
 
void Initialize ()
 
void Clear ()
 
void ResetCache ()
 
int GetMessageMask () override
 Should return the message mask that it wishes to receive messages for.
 
void OnApplicationMessage (KODI::MESSAGING::ThreadMessage *pMsg) override
 This gets called whenever a message matching the registered message mask is processed.
 
INFO::InfoPtr Register (const std::string &expression, int context=0)
 Register a boolean condition/expression This routine allows controls or other clients of the info manager to register to receive updates of particular expressions, in a particular context (currently windows).
 
void UnRegister (const INFO::InfoPtr &expression)
 Unregister a boolean condition/expression This routine allows controls or other clients of the info manager to unregister a previously registered boolean condition/expression.
 
bool ConditionsChangedValues (const std::map< INFO::InfoPtr, bool > &map)
 iterates through boolean conditions and compares their stored values to current values. Returns true if any condition changed value.
 
bool EvaluateBool (const std::string &expression, int context, const std::shared_ptr< CGUIListItem > &item=nullptr)
 Evaluate a boolean expression.
 
int TranslateString (const std::string &strCondition)
 Translates a string as given by the skin into an int that we use for more efficient retrieval of data. Can handle combined strings on the form Player.Caching + VideoPlayer.IsFullscreen (Logical and) Player.HasVideo | Player.HasAudio (Logical or)
 
int TranslateSingleString (const std::string &strCondition, bool &listItemDependent)
 
std::string GetLabel (int info, int contextWindow, std::string *fallback=nullptr) const
 
std::string GetImage (int info, int contextWindow, std::string *fallback=nullptr)
 Obtains the filename of the image to show from whichever subsystem is needed.
 
bool GetInt (int &value, int info, int contextWindow, const CGUIListItem *item=nullptr) const
 
bool GetBool (int condition, int contextWindow, const CGUIListItem *item=nullptr)
 
std::string GetItemLabel (const CFileItem *item, int contextWindow, int info, std::string *fallback=nullptr) const
 
std::string GetItemImage (const CGUIListItem *item, int contextWindow, int info, std::string *fallback=nullptr) const
 
bool GetItemInt (int &value, const CGUIListItem *item, int contextWindow, int info) const
 Get integer value of info.
 
bool GetItemBool (const CGUIListItem *item, int contextWindow, int condition) const
 
void SetCurrentItem (const CFileItem &item)
 Set currently playing file item.
 
void ResetCurrentItem ()
 
void UpdateCurrentItem (const CFileItem &item)
 
void SetCurrentAlbumThumb (const std::string &thumbFileName)
 
const MUSIC_INFO::CMusicInfoTagGetCurrentSongTag () const
 
const CVideoInfoTagGetCurrentMovieTag () const
 
const KODI::GAME::CGameInfoTagGetCurrentGameTag () const
 
void UpdateAVInfo ()
 
int RegisterSkinVariableString (const INFO::CSkinVariableString *info)
 
int TranslateSkinVariableString (const std::string &name, int context)
 
void RegisterInfoProvider (KODI::GUILIB::GUIINFO::IGUIInfoProvider *provider)
 register a guiinfo provider
 
void UnregisterInfoProvider (KODI::GUILIB::GUIINFO::IGUIInfoProvider *provider)
 unregister a guiinfo provider
 
KODI::GUILIB::GUIINFO::CGUIInfoProvidersGetInfoProviders ()
 get access to the registered guiinfo providers
 
- Public Member Functions inherited from KODI::MESSAGING::IMessageTarget
virtual ~IMessageTarget ()=default
 

Constructor & Destructor Documentation

◆ CGUIInfoManager()

CGUIInfoManager::CGUIInfoManager ( void )

◆ ~CGUIInfoManager()

CGUIInfoManager::~CGUIInfoManager ( void )
override

Member Function Documentation

◆ Clear()

void CGUIInfoManager::Clear ( )

◆ ConditionsChangedValues()

bool CGUIInfoManager::ConditionsChangedValues ( const std::map< INFO::InfoPtr, bool > & map)

iterates through boolean conditions and compares their stored values to current values. Returns true if any condition changed value.

◆ EvaluateBool()

bool CGUIInfoManager::EvaluateBool ( const std::string & expression,
int context,
const std::shared_ptr< CGUIListItem > & item = nullptr )

Evaluate a boolean expression.

Parameters
expressionthe expression to evaluate
contextthe context in which to evaluate the expression (currently windows)
Returns
the value of the evaluated expression.
See also
Register

◆ GetBool()

bool CGUIInfoManager::GetBool ( int condition,
int contextWindow,
const CGUIListItem * item = nullptr )

◆ GetCurrentGameTag()

const KODI::GAME::CGameInfoTag * CGUIInfoManager::GetCurrentGameTag ( ) const

◆ GetCurrentMovieTag()

const CVideoInfoTag * CGUIInfoManager::GetCurrentMovieTag ( ) const

◆ GetCurrentSongTag()

const MUSIC_INFO::CMusicInfoTag * CGUIInfoManager::GetCurrentSongTag ( ) const

◆ GetImage()

std::string CGUIInfoManager::GetImage ( int info,
int contextWindow,
std::string * fallback = nullptr )

Obtains the filename of the image to show from whichever subsystem is needed.

◆ GetInfoProviders()

KODI::GUILIB::GUIINFO::CGUIInfoProviders & CGUIInfoManager::GetInfoProviders ( )
inline

get access to the registered guiinfo providers

Returns
the guiinfo providers

◆ GetInt()

bool CGUIInfoManager::GetInt ( int & value,
int info,
int contextWindow,
const CGUIListItem * item = nullptr ) const

◆ GetItemBool()

bool CGUIInfoManager::GetItemBool ( const CGUIListItem * item,
int contextWindow,
int condition ) const

◆ GetItemImage()

std::string CGUIInfoManager::GetItemImage ( const CGUIListItem * item,
int contextWindow,
int info,
std::string * fallback = nullptr ) const

◆ GetItemInt()

bool CGUIInfoManager::GetItemInt ( int & value,
const CGUIListItem * item,
int contextWindow,
int info ) const

Get integer value of info.

Parameters
valueint reference to pass value of given info
infoid of info
contextthe context in which to evaluate the expression (currently windows)
itemoptional listitem if want to get listitem related int
Returns
true if given info was handled
See also
GetItemInt, GetMultiInfoInt

◆ GetItemLabel()

std::string CGUIInfoManager::GetItemLabel ( const CFileItem * item,
int contextWindow,
int info,
std::string * fallback = nullptr ) const

◆ GetLabel()

std::string CGUIInfoManager::GetLabel ( int info,
int contextWindow,
std::string * fallback = nullptr ) const

◆ GetMessageMask()

int CGUIInfoManager::GetMessageMask ( )
overridevirtual

Should return the message mask that it wishes to receive messages for.

The message mask is defined in "messaging/ApplicationMessenger.h" pick the next one available when creating a new

Implements KODI::MESSAGING::IMessageTarget.

◆ Initialize()

void CGUIInfoManager::Initialize ( )

◆ OnApplicationMessage()

void CGUIInfoManager::OnApplicationMessage ( KODI::MESSAGING::ThreadMessage * msg)
overridevirtual

This gets called whenever a message matching the registered message mask is processed.

There are no ordering guarantees here so implementations should never rely on a certain ordering of messages.

Cleaning up any pointers stored in the message payload is not specified and is decided by the implementer of the message. In general prefer to delete any data in this method to keep the callsites cleaner and simpler but if data is to be passed back it's perfectly valid to handle it any way that fits the situation as long as it's documented along with the message.

To return a simple value the result parameter of

See also
ThreadMessage can be used as it will be used as the return value for
CApplicationMessenger::SendMsg. It is up to the implementer to decide if this is to be used and it should be documented along with any new message implemented.

Implements KODI::MESSAGING::IMessageTarget.

◆ Register()

INFO::InfoPtr CGUIInfoManager::Register ( const std::string & expression,
int context = 0 )

Register a boolean condition/expression This routine allows controls or other clients of the info manager to register to receive updates of particular expressions, in a particular context (currently windows).

In the future, it will allow clients to receive pushed callbacks when the expression changes.

Parameters
expressionthe boolean condition or expression
contextthe context window
Returns
an identifier used to reference this expression

◆ RegisterInfoProvider()

void CGUIInfoManager::RegisterInfoProvider ( KODI::GUILIB::GUIINFO::IGUIInfoProvider * provider)

register a guiinfo provider

Parameters
theguiinfo provider to register

◆ RegisterSkinVariableString()

int CGUIInfoManager::RegisterSkinVariableString ( const INFO::CSkinVariableString * info)

◆ ResetCache()

void CGUIInfoManager::ResetCache ( )

◆ ResetCurrentItem()

void CGUIInfoManager::ResetCurrentItem ( )

◆ SetCurrentAlbumThumb()

void CGUIInfoManager::SetCurrentAlbumThumb ( const std::string & thumbFileName)

◆ SetCurrentItem()

void CGUIInfoManager::SetCurrentItem ( const CFileItem & item)

Set currently playing file item.

◆ TranslateSingleString()

int CGUIInfoManager::TranslateSingleString ( const std::string & strCondition,
bool & listItemDependent )
Todo
change to IsScanning(Video)
Todo
remove these, they're repeats
Todo
remove these, they're repeats
Todo
this doesn't support foo.xml
Todo
The parameter for these should really be on the first not the second property
Todo
The parameter for these should really be on the first not the second property
Todo
replace with a single system.platform
Todo
these two don't allow duration(foo) and also don't allow more than this number of levels...
Todo
these two don't allow duration(foo) and also don't allow more than this number of levels...
Todo
these two don't allow duration(foo) and also don't allow more than this number of levels...
Todo
The parameter for these should really be on the first not the second property

◆ TranslateSkinVariableString()

int CGUIInfoManager::TranslateSkinVariableString ( const std::string & name,
int context )

◆ TranslateString()

int CGUIInfoManager::TranslateString ( const std::string & strCondition)

Translates a string as given by the skin into an int that we use for more efficient retrieval of data. Can handle combined strings on the form Player.Caching + VideoPlayer.IsFullscreen (Logical and) Player.HasVideo | Player.HasAudio (Logical or)

◆ UnRegister()

void CGUIInfoManager::UnRegister ( const INFO::InfoPtr & expression)

Unregister a boolean condition/expression This routine allows controls or other clients of the info manager to unregister a previously registered boolean condition/expression.

Parameters
expressionthe boolean condition or expression

◆ UnregisterInfoProvider()

void CGUIInfoManager::UnregisterInfoProvider ( KODI::GUILIB::GUIINFO::IGUIInfoProvider * provider)

unregister a guiinfo provider

Parameters
theguiinfo provider to unregister

◆ UpdateAVInfo()

void CGUIInfoManager::UpdateAVInfo ( )

◆ UpdateCurrentItem()

void CGUIInfoManager::UpdateCurrentItem ( const CFileItem & item)

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