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);
95 typedef std::function<std::string(const std::string&)> StringReplacerFunc;
105 static bool ReplaceSpecialKeywordReferences(
const std::string &strInput,
const std::string &strKeyword,
const StringReplacerFunc &func, std::string &strOutput);
120 CInfoPortion(
int info,
const std::string &prefix,
const std::string &postfix,
bool escaped =
false);
121 bool NeedsUpdate(
const std::string &label)
const;
122 std::string Get()
const;
126 mutable std::string m_label;
127 std::string m_prefix;
128 std::string m_postfix;
138 void Parse(
const std::string& label, std::vector<CInfoPortion>& infoPortion,
int context);
144 const std::string& CacheLabel(
bool rebuild)
const;
150 void RebuildLabel(std::string& label,
const std::vector<CInfoPortion>& infoPortion)
const;
160 bool LabelNeedsUpdate(
int context,
162 std::string* fallback,
163 const std::vector<CInfoPortion>& infoPortion)
const;
174 std::string* fallback,
175 const std::vector<CInfoPortion>& infoPortion)
const;
177 mutable bool m_dirty =
false;
178 mutable std::string m_label;
179 mutable std::string m_fallback;
180 std::vector<CInfoPortion> m_infoLabel;
181 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:168
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:238
Controller configuration window.
Definition: AudioDecoder.h:18
int GetIntValue(int contextWindow) const
Gets the label and returns it as an int value.
Definition: GUIInfoLabel.cpp:27
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:111
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:65
static std::string ReplaceAddonStrings(std::string &&label)
Replaces instances of $ADDON[id number] with the appropriate localized addon string.
Definition: GUIInfoLabel.cpp:246