11 #include "settings/lib/ISettingControl.h" 12 #include "settings/lib/ISettingControlCreator.h" 14 #define SETTING_XML_ELM_CONTROL_FORMATLABEL "formatlabel" 15 #define SETTING_XML_ELM_CONTROL_HIDDEN "hidden" 16 #define SETTING_XML_ELM_CONTROL_VERIFYNEW "verifynew" 17 #define SETTING_XML_ELM_CONTROL_HEADING "heading" 18 #define SETTING_XML_ELM_CONTROL_HIDEVALUE "hidevalue" 19 #define SETTING_XML_ELM_CONTROL_MULTISELECT "multiselect" 20 #define SETTING_XML_ELM_CONTROL_POPUP "popup" 21 #define SETTING_XML_ELM_CONTROL_FORMATVALUE "value" 22 #define SETTING_XML_ELM_CONTROL_ADDBUTTONLABEL "addbuttonlabel" 23 #define SETTING_XML_ATTR_SHOW_MORE "more" 24 #define SETTING_XML_ATTR_SHOW_DETAILS "details" 25 #define SETTING_XML_ATTR_SEPARATOR_POSITION "separatorposition" 26 #define SETTING_XML_ATTR_HIDE_SEPARATOR "hideseparator" 34 std::shared_ptr<ISettingControl>
CreateControl(
const std::string &controlType)
const override;
51 std::string GetType()
const override {
return "toggle"; }
52 bool SetFormat(
const std::string &format)
override;
60 bool Deserialize(
const TiXmlNode *node,
bool update =
false)
override;
62 int GetFormatLabel()
const {
return m_formatLabel; }
63 void SetFormatLabel(
int formatLabel) { m_formatLabel = formatLabel; }
64 const std::string& GetFormatString()
const {
return m_formatString; }
65 void SetFormatString(
const std::string &formatString) { m_formatString = formatString; }
66 int GetMinimumLabel()
const {
return m_minimumLabel; }
67 void SetMinimumLabel(
int minimumLabel) { m_minimumLabel = minimumLabel; }
72 int m_formatLabel = -1;
73 std::string m_formatString =
"{}";
74 int m_minimumLabel = -1;
84 std::string GetType()
const override {
return "spinner"; }
87 bool SetFormat(
const std::string &format)
override;
100 std::string GetType()
const override {
return "edit"; }
101 bool Deserialize(
const TiXmlNode *node,
bool update =
false)
override;
102 bool SetFormat(
const std::string &format)
override;
104 bool IsHidden()
const {
return m_hidden; }
105 void SetHidden(
bool hidden) { m_hidden = hidden; }
106 bool VerifyNewValue()
const {
return m_verifyNewValue; }
107 void SetVerifyNewValue(
bool verifyNewValue) { m_verifyNewValue = verifyNewValue; }
108 int GetHeading()
const {
return m_heading; }
109 void SetHeading(
int heading) { m_heading = heading; }
112 bool m_hidden =
false;
113 bool m_verifyNewValue =
false;
124 std::string GetType()
const override {
return "button"; }
125 bool Deserialize(
const TiXmlNode *node,
bool update =
false)
override;
126 bool SetFormat(
const std::string &format)
override;
128 int GetHeading()
const {
return m_heading; }
129 void SetHeading(
int heading) { m_heading = heading; }
130 bool HideValue()
const {
return m_hideValue; }
131 void SetHideValue(
bool hideValue) { m_hideValue = hideValue; }
133 bool ShowAddonDetails()
const {
return m_showAddonDetails; }
134 void SetShowAddonDetails(
bool showAddonDetails) { m_showAddonDetails = showAddonDetails; }
135 bool ShowInstalledAddons()
const {
return m_showInstalledAddons; }
136 void SetShowInstalledAddons(
bool showInstalledAddons) { m_showInstalledAddons = showInstalledAddons; }
137 bool ShowInstallableAddons()
const {
return m_showInstallableAddons; }
138 void SetShowInstallableAddons(
bool showInstallableAddons) { m_showInstallableAddons = showInstallableAddons; }
139 bool ShowMoreAddons()
const {
return !m_showInstallableAddons && m_showMoreAddons; }
140 void SetShowMoreAddons(
bool showMoreAddons) { m_showMoreAddons = showMoreAddons; }
142 bool UseImageThumbs()
const {
return m_useImageThumbs; }
143 void SetUseImageThumbs(
bool useImageThumbs) { m_useImageThumbs = useImageThumbs; }
144 bool UseFileDirectories()
const {
return m_useFileDirectories; }
145 void SetUseFileDirectories(
bool useFileDirectories) { m_useFileDirectories = useFileDirectories; }
147 bool HasActionData()
const {
return !m_actionData.empty(); }
148 const std::string& GetActionData()
const {
return m_actionData; }
149 void SetActionData(
const std::string& actionData) { m_actionData = actionData; }
151 bool CloseDialog()
const {
return m_closeDialog; }
152 void SetCloseDialog(
bool closeDialog) { m_closeDialog = closeDialog; }
156 bool m_hideValue =
false;
158 bool m_showAddonDetails =
true;
159 bool m_showInstalledAddons =
true;
160 bool m_showInstallableAddons =
false;
161 bool m_showMoreAddons =
true;
163 bool m_useImageThumbs =
false;
164 bool m_useFileDirectories =
false;
166 std::string m_actionData;
167 bool m_closeDialog =
false;
171 using SettingControlListValueFormatter =
172 std::string (*)(
const std::shared_ptr<const CSetting>& setting);
181 std::string GetType()
const override {
return "list"; }
184 bool Deserialize(
const TiXmlNode *node,
bool update =
false)
override;
185 bool SetFormat(
const std::string &format)
override;
187 int GetHeading()
const {
return m_heading; }
188 void SetHeading(
int heading) { m_heading = heading; }
189 bool CanMultiSelect()
const {
return m_multiselect; }
190 void SetMultiSelect(
bool multiselect) { m_multiselect = multiselect; }
191 bool HideValue()
const {
return m_hideValue; }
192 void SetHideValue(
bool hideValue) { m_hideValue = hideValue; }
193 int GetAddButtonLabel()
const {
return m_addButtonLabel; }
194 void SetAddButtonLabel(
int label) { m_addButtonLabel = label; }
196 SettingControlListValueFormatter GetFormatter()
const {
return m_formatter; }
197 void SetFormatter(SettingControlListValueFormatter formatter) { m_formatter = formatter; }
199 bool UseDetails()
const {
return m_useDetails; }
200 void SetUseDetails(
bool useDetails) { m_useDetails = useDetails; }
204 bool m_multiselect =
false;
205 bool m_hideValue =
false;
206 int m_addButtonLabel = -1;
207 SettingControlListValueFormatter m_formatter =
nullptr;
208 bool m_useDetails{
false};
212 using SettingControlSliderFormatter =
213 std::string (*)(
const std::shared_ptr<const CSettingControlSlider>& control,
226 std::string GetType()
const override {
return "slider"; }
227 bool Deserialize(
const TiXmlNode *node,
bool update =
false)
override;
228 bool SetFormat(
const std::string &format)
override;
230 int GetHeading()
const {
return m_heading; }
231 void SetHeading(
int heading) { m_heading = heading; }
232 bool UsePopup()
const {
return m_popup; }
233 void SetPopup(
bool popup) { m_popup = popup; }
234 int GetFormatLabel()
const {
return m_formatLabel; }
235 void SetFormatLabel(
int formatLabel) { m_formatLabel = formatLabel; }
236 const std::string& GetFormatString()
const {
return m_formatString; }
237 void SetFormatString(
const std::string &formatString) { m_formatString = formatString; }
238 std::string GetDefaultFormatString()
const;
240 SettingControlSliderFormatter GetFormatter()
const {
return m_formatter; }
241 void SetFormatter(SettingControlSliderFormatter formatter) { m_formatter = formatter; }
245 bool m_popup =
false;
246 int m_formatLabel = -1;
247 std::string m_formatString;
248 SettingControlSliderFormatter m_formatter =
nullptr;
258 std::string GetType()
const override {
return "range"; }
259 bool Deserialize(
const TiXmlNode *node,
bool update =
false)
override;
260 bool SetFormat(
const std::string &format)
override;
262 int GetFormatLabel()
const {
return m_formatLabel; }
263 void SetFormatLabel(
int formatLabel) { m_formatLabel = formatLabel; }
264 int GetValueFormatLabel()
const {
return m_valueFormatLabel; }
265 void SetValueFormatLabel(
int valueFormatLabel) { m_valueFormatLabel = valueFormatLabel; }
266 const std::string& GetValueFormat()
const {
return m_valueFormat; }
267 void SetValueFormat(
const std::string &valueFormat) { m_valueFormat = valueFormat; }
270 int m_formatLabel = 21469;
271 int m_valueFormatLabel = -1;
272 std::string m_valueFormat =
"{}";
282 std::string GetType()
const override {
return "title"; }
283 bool Deserialize(
const TiXmlNode *node,
bool update =
false)
override;
285 bool IsSeparatorHidden()
const {
return m_separatorHidden; }
286 void SetSeparatorHidden(
bool hidden) { m_separatorHidden = hidden; }
287 bool IsSeparatorBelowLabel()
const {
return m_separatorBelowLabel; }
288 void SetSeparatorBelowLabel(
bool below) { m_separatorBelowLabel = below; }
291 bool m_separatorHidden =
false;
292 bool m_separatorBelowLabel =
true;
302 std::string GetType()
const override {
return "label"; }
312 std::string GetType()
const override {
return "colorbutton"; }
313 bool SetFormat(
const std::string& format)
override;
Definition: SettingControl.h:77
Definition: SettingControl.h:41
Definition: SettingControl.h:30
Setting base class containing all the properties which are common to all settings independent of the ...
Definition: Setting.h:46
Interface for creating a new setting control of a custom setting control type.
Definition: ISettingControlCreator.h:20
Definition: SettingControl.h:295
Definition: SettingControl.h:251
Definition: SettingControl.h:90
Definition: SettingControl.h:219
Definition: SettingControl.h:174
std::shared_ptr< ISettingControl > CreateControl(const std::string &controlType) const override
Creates a new setting control of the given custom setting control type.
Definition: SettingControl.cpp:23
Definition: SettingControl.h:275
Definition: ISettingControl.h:17