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  CaseInsensitiveCompare
 

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
}
 
using PropertyMap = std::map< std::string, CVariant, CaseInsensitiveCompare >
 

Public Member Functions

 CGUIListItem ()
 
 CGUIListItem (const CGUIListItem &item)
 
 CGUIListItem (const std::string &strLabel)
 
virtual ~CGUIListItem ()
 
virtual CGUIListItemClone () const
 
CGUIListItemoperator= (const CGUIListItem &item)
 
virtual void SetLabel (const std::string &strLabel)
 
const std::string & GetLabel () const
 
void SetLabel2 (std::string_view strLabel)
 
const std::string & GetLabel2 () const
 
void SetFolder (bool isFolder)
 
bool IsFolder () const
 
void SetOverlayImage (GUIIconOverlay icon)
 
std::string GetOverlayImage () const
 
void SetArt (const std::string &type, std::string_view url)
 Set a particular art type for an item.
 
void SetArt (const KODI::ART::Artwork &art)
 set artwork for an item
 
void AppendArt (const KODI::ART::Artwork &art, const std::string &prefix="")
 append artwork to an item
 
void SetArtFallback (const std::string &from, std::string_view 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 KODI::ART::ArtworkGetArt () 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) const
 
bool HasProperty (const std::string &strKey) const
 
bool HasProperties () const
 
void ClearProperty (const std::string &strKey)
 
const CVariantGetProperty (const std::string &strKey) const
 
const PropertyMapGetProperties () const
 
void SetProperties (const PropertyMap &props)
 
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.
 

Member Typedef Documentation

◆ PropertyMap

Constructor & Destructor Documentation

◆ CGUIListItem() [1/3]

CGUIListItem::CGUIListItem ( )
default

◆ CGUIListItem() [2/3]

CGUIListItem::CGUIListItem ( const CGUIListItem item)
explicit

◆ CGUIListItem() [3/3]

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

◆ ~CGUIListItem()

CGUIListItem::~CGUIListItem ( )
virtual

Member Function Documentation

◆ AppendArt()

void CGUIListItem::AppendArt ( const KODI::ART::Artwork 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 KODI::ART::Artwork & 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

◆ GetProperties()

const PropertyMap & CGUIListItem::GetProperties ( ) const
inline

◆ 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.

◆ IsFolder()

bool CGUIListItem::IsFolder ( ) const
inline

◆ IsSelected()

bool CGUIListItem::IsSelected ( ) const

◆ operator=()

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

◆ Select()

void CGUIListItem::Select ( bool  bOnOff)

◆ Serialize()

void CGUIListItem::Serialize ( CVariant value) const

◆ SetArt() [1/2]

void CGUIListItem::SetArt ( const KODI::ART::Artwork 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,
std::string_view  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,
std::string_view  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)

◆ SetFolder()

void CGUIListItem::SetFolder ( bool  isFolder)
inline

◆ SetInvalid()

void CGUIListItem::SetInvalid ( )

◆ SetLabel()

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

Reimplemented in CFileItem.

◆ SetLabel2()

void CGUIListItem::SetLabel2 ( std::string_view  strLabel)

◆ SetLayout()

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

◆ SetOverlayImage()

void CGUIListItem::SetOverlayImage ( GUIIconOverlay  icon)

◆ SetProperties()

void CGUIListItem::SetProperties ( const PropertyMap props)

◆ 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)

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