16 #include "interfaces/info/Info.h" 36 const std::string& fallback =
"",
37 int context = INFO::DEFAULT_CONTEXT);
39 void SetLabel(
const std::string& label,
40 const std::string& fallback,
41 int context = INFO::DEFAULT_CONTEXT);
50 const std::string &
GetLabel(
int contextWindow,
bool preferImage =
false, std::string *fallback = NULL)
const;
68 bool preferImage =
false,
69 std::string* fallback =
nullptr)
const;
71 bool IsConstant()
const;
74 const std::string& GetFallback()
const {
return m_fallback; }
76 static std::string
GetLabel(
const std::string& label,
78 bool preferImage =
false);
105 typedef std::function<std::string(const std::string&)> StringReplacerFunc;
115 static bool ReplaceSpecialKeywordReferences(
const std::string &strInput,
const std::string &strKeyword,
const StringReplacerFunc &func, std::string &strOutput);
130 CInfoPortion(
int info,
const std::string &prefix,
const std::string &postfix,
bool escaped =
false);
131 bool NeedsUpdate(
const std::string &label)
const;
132 std::string Get()
const;
136 mutable std::string m_label;
137 std::string m_prefix;
138 std::string m_postfix;
148 void Parse(
const std::string& label, std::vector<CInfoPortion>& infoPortion,
int context);
154 const std::string& CacheLabel(
bool rebuild)
const;
160 void RebuildLabel(std::string& label,
const std::vector<CInfoPortion>& infoPortion)
const;
170 bool LabelNeedsUpdate(
int context,
172 std::string* fallback,
173 const std::vector<CInfoPortion>& infoPortion)
const;
184 std::string* fallback,
185 const std::vector<CInfoPortion>& infoPortion)
const;
187 mutable bool m_dirty =
false;
188 mutable std::string m_label;
189 mutable std::string m_fallback;
190 std::vector<CInfoPortion> m_infoLabel;
191 std::vector<CInfoPortion> m_infoFallback;
Definition: GUIListItem.h:30
static bool ReplaceSpecialKeywordReferences(const std::string &strInput, const std::string &strKeyword, const StringReplacerFunc &func, std::string &strOutput)
Replaces instances of $strKeyword[value] with the appropriate resolved string.
Definition: GUIInfoLabel.cpp:170
Definition: GUIInfoLabel.h:31
static std::string ReplaceLocalize(const std::string &label)
Replaces instances of $LOCALIZE[number] with the appropriate localized string.
Definition: GUIInfoLabel.cpp:250
Definition: AudioDecoder.h:18
int GetIntValue(int contextWindow) const
Gets the label and returns it as an int value.
Definition: GUIInfoLabel.cpp:29
const std::string & GetItemLabel(const CGUIListItem *item, bool preferImage=false, std::string *fallback=nullptr) const
Gets a label (or image) for a given listitem from the info manager.
Definition: GUIInfoLabel.cpp:113
const std::string & GetLabel(int contextWindow, bool preferImage=false, std::string *fallback=NULL) const
Gets a label (or image) for a given window context from the info manager.
Definition: GUIInfoLabel.cpp:67
static std::string ReplaceControllerStrings(std::string &&label)
Replaces instances of $FEATURE[feature name, controller ID] with the appropriate localized controller...
Definition: GUIInfoLabel.cpp:264
static std::string ReplaceAddonStrings(std::string &&label)
Replaces instances of $ADDON[id number] with the appropriate localized addon string.
Definition: GUIInfoLabel.cpp:258