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

#include <GUIListItem.h>

Inheritance diagram for CGUIListItem:
CFileItem CFileItemList CGUIStaticItem

Classes

struct  icompare
 

Public Types

enum  GUIIconOverlay {
  ICON_OVERLAY_NONE = 0 , ICON_OVERLAY_RAR , ICON_OVERLAY_ZIP , ICON_OVERLAY_LOCKED ,
  ICON_OVERLAY_UNWATCHED , ICON_OVERLAY_WATCHED , ICON_OVERLAY_HD
}
 
typedef std::map< std::string, std::string > ArtMap
 

Public Member Functions

 CGUIListItem (void)
 
 CGUIListItem (const CGUIListItem &item)
 
 CGUIListItem (const std::string &strLabel)
 
virtual ~CGUIListItem (void)
 
virtual CGUIListItemClone () const
 
CGUIListItemoperator= (const CGUIListItem &item)
 
virtual void SetLabel (const std::string &strLabel)
 
const std::string & GetLabel () const
 
void SetLabel2 (const std::string &strLabel)
 
const std::string & GetLabel2 () const
 
void SetOverlayImage (GUIIconOverlay icon)
 
std::string GetOverlayImage () const
 
void SetArt (const std::string &type, const std::string &url)
 Set a particular art type for an item.
 
void SetArt (const ArtMap &art)
 set artwork for an item
 
void AppendArt (const ArtMap &art, const std::string &prefix="")
 append artwork to an item
 
void SetArtFallback (const std::string &from, const std::string &to)
 set a fallback image for art
 
void ClearArt ()
 clear art on an item
 
std::string GetArt (const std::string &type) const
 Get a particular art type for an item.
 
const ArtMapGetArt () const
 get artwork for an item Retrieves artwork in a type:url map
 
bool HasArt (const std::string &type) const
 Check whether an item has a particular piece of art Equivalent to !GetArt(type).empty()
 
void SetSortLabel (const std::string &label)
 
void SetSortLabel (const std::wstring &label)
 
const std::wstring & GetSortLabel () const
 
void Select (bool bOnOff)
 
bool IsSelected () const
 
bool HasOverlay () const
 
virtual bool IsFileItem () const
 
void SetLayout (std::unique_ptr< CGUIListItemLayout > layout)
 
CGUIListItemLayoutGetLayout ()
 
void SetFocusedLayout (std::unique_ptr< CGUIListItemLayout > layout)
 
CGUIListItemLayoutGetFocusedLayout ()
 
void FreeIcons ()
 
void FreeMemory (bool immediately=false)
 
void SetInvalid ()
 
void SetProperty (const std::string &strKey, const CVariant &value)
 
void IncrementProperty (const std::string &strKey, int nVal)
 
void IncrementProperty (const std::string &strKey, int64_t nVal)
 
void IncrementProperty (const std::string &strKey, double dVal)
 
void ClearProperties ()
 
void AppendProperties (const CGUIListItem &item)
 Append the properties of one CGUIListItem to another. Any existing properties in the current item will be overridden if they are set in the passed in item.
 
void Archive (CArchive &ar)
 
void Serialize (CVariant &value)
 
bool HasProperty (const std::string &strKey) const
 
bool HasProperties () const
 
void ClearProperty (const std::string &strKey)
 
const CVariantGetProperty (const std::string &strKey) const
 
void SetCurrentItem (unsigned int position)
 Set the current item number within it's container Our container classes will set this member with the items position in the container starting at 1.
 
unsigned int GetCurrentItem () const
 Get the current item number within it's container Retrieve the items position in a container, this is useful to show for example numbering in front of entities in an arbitrary list of entities, like songs of a playlist.
 

Public Attributes

bool m_bIsFolder
 is item a folder or a file
 

Protected Types

typedef std::map< std::string, CVariant, icomparePropertyMap
 

Protected Attributes

std::string m_strLabel2
 
GUIIconOverlay m_overlayIcon
 
std::unique_ptr< CGUIListItemLayoutm_layout
 
std::unique_ptr< CGUIListItemLayoutm_focusedLayout
 
bool m_bSelected
 
unsigned int m_currentItem
 
PropertyMap m_mapProperties
 

Member Typedef Documentation

◆ ArtMap

typedef std::map<std::string, std::string> CGUIListItem::ArtMap

◆ PropertyMap

typedef std::map<std::string, CVariant, icompare> CGUIListItem::PropertyMap
protected

Constructor & Destructor Documentation

◆ CGUIListItem() [1/3]

CGUIListItem::CGUIListItem ( void )

◆ CGUIListItem() [2/3]

CGUIListItem::CGUIListItem ( const CGUIListItem & item)
explicit

◆ CGUIListItem() [3/3]

CGUIListItem::CGUIListItem ( const std::string & strLabel)
explicit

◆ ~CGUIListItem()

CGUIListItem::~CGUIListItem ( void )
virtual

Member Function Documentation

◆ AppendArt()

void CGUIListItem::AppendArt ( const ArtMap & art,
const std::string & prefix = "" )

append artwork to an item

Parameters
arta type:url map for artwork
prefixa prefix for the art, if applicable.
See also
GetArt

◆ AppendProperties()

void CGUIListItem::AppendProperties ( const CGUIListItem & item)

Append the properties of one CGUIListItem to another. Any existing properties in the current item will be overridden if they are set in the passed in item.

Parameters
itemthe item containing the properties to append.

◆ Archive()

void CGUIListItem::Archive ( CArchive & ar)

◆ ClearArt()

void CGUIListItem::ClearArt ( )

clear art on an item

See also
SetArt

◆ ClearProperties()

void CGUIListItem::ClearProperties ( )

◆ ClearProperty()

void CGUIListItem::ClearProperty ( const std::string & strKey)

◆ Clone()

virtual CGUIListItem * CGUIListItem::Clone ( ) const
inlinevirtual

Reimplemented in CFileItem, and CGUIStaticItem.

◆ FreeIcons()

void CGUIListItem::FreeIcons ( )

◆ FreeMemory()

void CGUIListItem::FreeMemory ( bool immediately = false)

◆ GetArt() [1/2]

const CGUIListItem::ArtMap & CGUIListItem::GetArt ( ) const

get artwork for an item Retrieves artwork in a type:url map

Returns
a type:url map for artwork
See also
SetArt

◆ GetArt() [2/2]

std::string CGUIListItem::GetArt ( const std::string & type) const

Get a particular art type for an item.

Parameters
typetype of art to fetch.
Returns
the art URL, if available, else empty.

◆ GetCurrentItem()

unsigned int CGUIListItem::GetCurrentItem ( ) const

Get the current item number within it's container Retrieve the items position in a container, this is useful to show for example numbering in front of entities in an arbitrary list of entities, like songs of a playlist.

◆ GetFocusedLayout()

CGUIListItemLayout * CGUIListItem::GetFocusedLayout ( )

◆ GetLabel()

const std::string & CGUIListItem::GetLabel ( ) const

◆ GetLabel2()

const std::string & CGUIListItem::GetLabel2 ( ) const

◆ GetLayout()

CGUIListItemLayout * CGUIListItem::GetLayout ( )

◆ GetOverlayImage()

std::string CGUIListItem::GetOverlayImage ( ) const

◆ GetProperty()

const CVariant & CGUIListItem::GetProperty ( const std::string & strKey) const

◆ GetSortLabel()

const std::wstring & CGUIListItem::GetSortLabel ( ) const

◆ HasArt()

bool CGUIListItem::HasArt ( const std::string & type) const

Check whether an item has a particular piece of art Equivalent to !GetArt(type).empty()

Parameters
typetype of art to set.
Returns
true if the item has that art set, false otherwise.

◆ HasOverlay()

bool CGUIListItem::HasOverlay ( ) const

◆ HasProperties()

bool CGUIListItem::HasProperties ( ) const
inline

◆ HasProperty()

bool CGUIListItem::HasProperty ( const std::string & strKey) const

◆ IncrementProperty() [1/3]

void CGUIListItem::IncrementProperty ( const std::string & strKey,
double dVal )

◆ IncrementProperty() [2/3]

void CGUIListItem::IncrementProperty ( const std::string & strKey,
int nVal )

◆ IncrementProperty() [3/3]

void CGUIListItem::IncrementProperty ( const std::string & strKey,
int64_t nVal )

◆ IsFileItem()

virtual bool CGUIListItem::IsFileItem ( ) const
inlinevirtual

Reimplemented in CFileItem.

◆ IsSelected()

bool CGUIListItem::IsSelected ( ) const

◆ operator=()

CGUIListItem & CGUIListItem::operator= ( const CGUIListItem & item)

◆ Select()

void CGUIListItem::Select ( bool bOnOff)

◆ Serialize()

void CGUIListItem::Serialize ( CVariant & value)

◆ SetArt() [1/2]

void CGUIListItem::SetArt ( const ArtMap & art)

set artwork for an item

Parameters
arta type:url map for artwork
See also
GetArt

◆ SetArt() [2/2]

void CGUIListItem::SetArt ( const std::string & type,
const std::string & url )

Set a particular art type for an item.

Parameters
typetype of art to set.
urlthe url of the art.

◆ SetArtFallback()

void CGUIListItem::SetArtFallback ( const std::string & from,
const std::string & to )

set a fallback image for art

Parameters
fromthe type to fallback from
tothe type to fallback to
See also
SetArt

◆ SetCurrentItem()

void CGUIListItem::SetCurrentItem ( unsigned int position)

Set the current item number within it's container Our container classes will set this member with the items position in the container starting at 1.

Parameters
positionPosition of the item in the container starting at 1.

◆ SetFocusedLayout()

void CGUIListItem::SetFocusedLayout ( std::unique_ptr< CGUIListItemLayout > layout)

◆ SetInvalid()

void CGUIListItem::SetInvalid ( )

◆ SetLabel()

void CGUIListItem::SetLabel ( const std::string & strLabel)
virtual

Reimplemented in CFileItem.

◆ SetLabel2()

void CGUIListItem::SetLabel2 ( const std::string & strLabel)

◆ SetLayout()

void CGUIListItem::SetLayout ( std::unique_ptr< CGUIListItemLayout > layout)

◆ SetOverlayImage()

void CGUIListItem::SetOverlayImage ( GUIIconOverlay icon)

◆ SetProperty()

void CGUIListItem::SetProperty ( const std::string & strKey,
const CVariant & value )

◆ SetSortLabel() [1/2]

void CGUIListItem::SetSortLabel ( const std::string & label)

◆ SetSortLabel() [2/2]

void CGUIListItem::SetSortLabel ( const std::wstring & label)

Member Data Documentation

◆ m_bIsFolder

bool CGUIListItem::m_bIsFolder

is item a folder or a file

◆ m_bSelected

bool CGUIListItem::m_bSelected
protected

◆ m_currentItem

unsigned int CGUIListItem::m_currentItem
protected

◆ m_focusedLayout

std::unique_ptr<CGUIListItemLayout> CGUIListItem::m_focusedLayout
protected

◆ m_layout

std::unique_ptr<CGUIListItemLayout> CGUIListItem::m_layout
protected

◆ m_mapProperties

PropertyMap CGUIListItem::m_mapProperties
protected

◆ m_overlayIcon

GUIIconOverlay CGUIListItem::m_overlayIcon
protected

◆ m_strLabel2

std::string CGUIListItem::m_strLabel2
protected

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