Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CGUIControlFactory Class Reference

#include <GUIControlFactory.h>

Public Member Functions

 CGUIControlFactory (void)
 
virtual ~CGUIControlFactory (void)
 
CGUIControlCreate (int parentID, const CRect &rect, TiXmlElement *pControlNode, bool insideContainer=false)
 

Static Public Member Functions

static CGUIControl::GUICONTROLTYPES TranslateControlType (const std::string &type)
 translate from control name to control type More...
 
static std::string TranslateControlType (CGUIControl::GUICONTROLTYPES type)
 translate from control type to control name More...
 
static bool GetAspectRatio (const TiXmlNode *pRootNode, const char *strTag, CAspectRatio &aspectRatio)
 
static bool GetInfoTexture (const TiXmlNode *pRootNode, const char *strTag, CTextureInfo &image, KODI::GUILIB::GUIINFO::CGUIInfoLabel &info, int parentID)
 
static bool GetTexture (const TiXmlNode *pRootNode, const char *strTag, CTextureInfo &image)
 
static bool GetAlignment (const TiXmlNode *pRootNode, const char *strTag, uint32_t &dwAlignment)
 
static bool GetAlignmentY (const TiXmlNode *pRootNode, const char *strTag, uint32_t &dwAlignment)
 
static bool GetAnimations (TiXmlNode *control, const CRect &rect, int context, std::vector< CAnimation > &animation)
 
static float ParsePosition (const char *pos, const float parentSize)
 Create an info label from an XML element Processes XML elements of the form <xmltag fallback="fallback_value">info_value</xmltag> where info_value may use $INFO[], $LOCALIZE[], $NUMBER[] etc. If either the fallback_value or info_value are natural numbers they are interpreted as ids for lookup in strings.xml. The fallback attribute is optional. More...
 
static bool GetInfoLabelFromElement (const TiXmlElement *element, KODI::GUILIB::GUIINFO::CGUIInfoLabel &infoLabel, int parentID)
 
static void GetInfoLabel (const TiXmlNode *pControlNode, const std::string &labelTag, KODI::GUILIB::GUIINFO::CGUIInfoLabel &infoLabel, int parentID)
 
static void GetInfoLabels (const TiXmlNode *pControlNode, const std::string &labelTag, std::vector< KODI::GUILIB::GUIINFO::CGUIInfoLabel > &infoLabels, int parentID)
 
static bool GetColor (const TiXmlNode *pRootNode, const char *strTag, UTILS::Color &value)
 
static bool GetInfoColor (const TiXmlNode *pRootNode, const char *strTag, KODI::GUILIB::GUIINFO::CGUIInfoColor &value, int parentID)
 
static std::string FilterLabel (const std::string &label)
 
static bool GetConditionalVisibility (const TiXmlNode *control, std::string &condition)
 
static bool GetActions (const TiXmlNode *pRootNode, const char *strTag, CGUIAction &actions)
 
static void GetRectFromString (const std::string &string, CRect &rect)
 
static bool GetHitRect (const TiXmlNode *pRootNode, CRect &rect, const CRect &parentRect)
 
static bool GetScroller (const TiXmlNode *pControlNode, const std::string &scrollerTag, CScroller &scroller)
 

Constructor & Destructor Documentation

◆ CGUIControlFactory()

CGUIControlFactory::CGUIControlFactory ( void  )
default

◆ ~CGUIControlFactory()

CGUIControlFactory::~CGUIControlFactory ( void  )
virtualdefault

Member Function Documentation

◆ Create()

CGUIControl * CGUIControlFactory::Create ( int  parentID,
const CRect rect,
TiXmlElement *  pControlNode,
bool  insideContainer = false 
)
Todo:
Perhaps we should check here whether id is valid for focusable controls such as buttons etc. For labels/fadelabels/images it does not matter

◆ FilterLabel()

std::string CGUIControlFactory::FilterLabel ( const std::string &  label)
static

◆ GetActions()

bool CGUIControlFactory::GetActions ( const TiXmlNode *  pRootNode,
const char *  strTag,
CGUIAction actions 
)
static

◆ GetAlignment()

bool CGUIControlFactory::GetAlignment ( const TiXmlNode *  pRootNode,
const char *  strTag,
uint32_t &  dwAlignment 
)
static

◆ GetAlignmentY()

bool CGUIControlFactory::GetAlignmentY ( const TiXmlNode *  pRootNode,
const char *  strTag,
uint32_t &  dwAlignment 
)
static

◆ GetAnimations()

bool CGUIControlFactory::GetAnimations ( TiXmlNode *  control,
const CRect rect,
int  context,
std::vector< CAnimation > &  animation 
)
static

◆ GetAspectRatio()

bool CGUIControlFactory::GetAspectRatio ( const TiXmlNode *  pRootNode,
const char *  strTag,
CAspectRatio aspectRatio 
)
static

◆ GetColor()

bool CGUIControlFactory::GetColor ( const TiXmlNode *  pRootNode,
const char *  strTag,
UTILS::Color value 
)
static

◆ GetConditionalVisibility()

bool CGUIControlFactory::GetConditionalVisibility ( const TiXmlNode *  control,
std::string &  condition 
)
static

◆ GetHitRect()

bool CGUIControlFactory::GetHitRect ( const TiXmlNode *  pRootNode,
CRect rect,
const CRect parentRect 
)
static

◆ GetInfoColor()

bool CGUIControlFactory::GetInfoColor ( const TiXmlNode *  pRootNode,
const char *  strTag,
KODI::GUILIB::GUIINFO::CGUIInfoColor value,
int  parentID 
)
static

◆ GetInfoLabel()

void CGUIControlFactory::GetInfoLabel ( const TiXmlNode *  pControlNode,
const std::string &  labelTag,
KODI::GUILIB::GUIINFO::CGUIInfoLabel infoLabel,
int  parentID 
)
static

◆ GetInfoLabelFromElement()

bool CGUIControlFactory::GetInfoLabelFromElement ( const TiXmlElement *  element,
KODI::GUILIB::GUIINFO::CGUIInfoLabel infoLabel,
int  parentID 
)
static

◆ GetInfoLabels()

void CGUIControlFactory::GetInfoLabels ( const TiXmlNode *  pControlNode,
const std::string &  labelTag,
std::vector< KODI::GUILIB::GUIINFO::CGUIInfoLabel > &  infoLabels,
int  parentID 
)
static

◆ GetInfoTexture()

bool CGUIControlFactory::GetInfoTexture ( const TiXmlNode *  pRootNode,
const char *  strTag,
CTextureInfo image,
KODI::GUILIB::GUIINFO::CGUIInfoLabel info,
int  parentID 
)
static

◆ GetRectFromString()

void CGUIControlFactory::GetRectFromString ( const std::string &  string,
CRect rect 
)
static

◆ GetScroller()

bool CGUIControlFactory::GetScroller ( const TiXmlNode *  pControlNode,
const std::string &  scrollerTag,
CScroller scroller 
)
static

◆ GetTexture()

bool CGUIControlFactory::GetTexture ( const TiXmlNode *  pRootNode,
const char *  strTag,
CTextureInfo image 
)
static

◆ ParsePosition()

float CGUIControlFactory::ParsePosition ( const char *  pos,
const float  parentSize 
)
static

Create an info label from an XML element Processes XML elements of the form <xmltag fallback="fallback_value">info_value</xmltag> where info_value may use $INFO[], $LOCALIZE[], $NUMBER[] etc. If either the fallback_value or info_value are natural numbers they are interpreted as ids for lookup in strings.xml. The fallback attribute is optional.

Parameters
elementXML element to process
infoLabelReturned infoLabel
parentIDThe parent id
Returns
true if a valid info label was read, false otherwise

Parse a position string Handles strings of the form

number of pixels

r number of pixels measured from the right

% percentage of parent size

Parameters
posthe string to parse.
parentSizethe size of the parent.
See also
GetPosition

◆ TranslateControlType() [1/2]

std::string CGUIControlFactory::TranslateControlType ( CGUIControl::GUICONTROLTYPES  type)
static

translate from control type to control name

Parameters
typetype of the control
Returns
name of control

◆ TranslateControlType() [2/2]

CGUIControl::GUICONTROLTYPES CGUIControlFactory::TranslateControlType ( const std::string &  type)
static

translate from control name to control type

Parameters
typename of the control
Returns
type of control

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