10#ifndef UI_QT_EXTCAP_ARGUMENT_H_
11#define UI_QT_EXTCAP_ARGUMENT_H_
20#include <QButtonGroup>
26#define EXTCAP_GUI_BLANK_LABEL "QLabel { color : ; }"
27#define EXTCAP_GUI_ERROR_LABEL "QLabel { color : red; }"
31typedef QList<ExtcapValue> ExtcapValueList;
67 if (_children.length() == 0)
68 return ExtcapValueList();
76 QString
value()
const {
return _value; }
82 const QString
call()
const {
return _call; }
119 ExtcapValueList _children;
160 virtual QWidget *
createLabel(QWidget * parent = 0);
179 virtual QString
call();
185 virtual QString
value();
230 QString
prefKey(
const QString & device_name,
231 const QString & option_name,
const QString & option_value);
248 virtual QString
group()
const;
254 virtual int argNr()
const;
361 virtual QString
value();
444 virtual QString
value();
472 void onReloadTriggered();
502 virtual QString
value();
542 virtual QString
value();
565 QButtonGroup * selectorGroup;
568 QList<QString> * callStrings;
605 virtual QString
call();
611 virtual QString
value();
694 virtual QString
value();
719 void onDateTimeChanged(QDateTime datetime);
726 QDateTimeEdit *tsBox;
Extcap argument representing a boolean toggle (checkbox).
Definition extcap_argument.h:576
virtual QString defaultValue()
Retrieves the default boolean value as a string.
Definition extcap_argument.cpp:516
virtual QString prefValue()
Retrieves the preference value for the boolean argument.
Definition extcap_argument.cpp:489
virtual QString value()
Retrieves the boolean state as a string.
Definition extcap_argument.cpp:482
virtual bool isSetDefaultValueSupported()
Checks if setting a default boolean value is supported.
Definition extcap_argument.cpp:521
virtual QWidget * createEditor(QWidget *parent)
Creates the checkbox editor widget.
Definition extcap_argument.cpp:442
virtual bool isValid()
Checks if the boolean state is valid.
Definition extcap_argument.cpp:496
virtual void setDefaultValue()
Sets the checkbox to its default state.
Definition extcap_argument.cpp:526
virtual QWidget * createLabel(QWidget *parent)
Creates the label widget for the boolean argument.
Definition extcap_argument.cpp:437
virtual QString call()
Retrieves the call string based on the boolean state.
Definition extcap_argument.cpp:471
Extcap argument representing an editable selection dropdown.
Definition extcap_argument.h:480
virtual QString value()
Retrieves the current text or selection value.
Definition extcap_argument.cpp:280
virtual void setDefaultValue()
Sets the editable selector to its default value.
Definition extcap_argument.cpp:293
virtual QWidget * createEditor(QWidget *parent)
Creates the editable combobox editor widget.
Definition extcap_argument.cpp:270
Extcap argument representing a numeric input field.
Definition extcap_argument.h:392
virtual QString defaultValue()
Retrieves the default numeric value.
Definition extcap_argument.cpp:721
virtual QWidget * createEditor(QWidget *parent)
Creates the numeric editor widget.
Definition extcap_argument.cpp:641
Extcap argument representing a set of radio buttons.
Definition extcap_argument.h:515
virtual QWidget * createEditor(QWidget *parent)
Creates the radio button group editor widget.
Definition extcap_argument.cpp:322
virtual bool isValid()
Checks if a valid radio button is selected.
Definition extcap_argument.cpp:376
virtual void setDefaultValue()
Selects the default radio button.
Definition extcap_argument.cpp:405
virtual bool isSetDefaultValueSupported()
Checks if setting a default radio button is supported.
Definition extcap_argument.cpp:400
virtual QString value()
Retrieves the value of the currently selected radio button.
Definition extcap_argument.cpp:363
virtual ~ExtArgRadio()
Destroys the ExtArgRadio.
Definition extcap_argument.cpp:317
Extcap argument representing a selection dropdown.
Definition extcap_argument.h:422
virtual bool isSetDefaultValueSupported()
Checks if setting a default selection is supported.
Definition extcap_argument.cpp:232
QComboBox * boxSelection
Definition extcap_argument.h:466
virtual void setDefaultValue()
Sets the dropdown to its default selection.
Definition extcap_argument.cpp:237
virtual bool isValid()
Checks if the current selection is valid.
Definition extcap_argument.cpp:209
virtual QString value()
Retrieves the currently selected value.
Definition extcap_argument.cpp:222
virtual QWidget * createEditor(QWidget *parent)
Creates the combobox editor widget.
Definition extcap_argument.cpp:125
Extcap argument representing a text input field.
Definition extcap_argument.h:339
virtual QWidget * createEditor(QWidget *parent)
Creates the text editor widget.
Definition extcap_argument.cpp:538
virtual bool isSetDefaultValueSupported()
Checks if setting a default text value is supported.
Definition extcap_argument.cpp:626
QLineEdit * textBox
Definition extcap_argument.h:384
virtual bool isValid()
Checks if the current text value is valid.
Definition extcap_argument.cpp:573
virtual void setDefaultValue()
Sets the text field to its default value.
Definition extcap_argument.cpp:631
virtual QString value()
Retrieves the current text value.
Definition extcap_argument.cpp:565
Extcap argument representing a timestamp input.
Definition extcap_argument.h:660
virtual bool isSetDefaultValueSupported()
Checks if setting a default timestamp is supported.
Definition extcap_argument.cpp:107
virtual void setDefaultValue()
Sets the timestamp to its default value.
Definition extcap_argument.cpp:112
virtual QString defaultValue()
Retrieves the default timestamp value.
Definition extcap_argument.cpp:82
virtual QString prefValue()
Retrieves the preference value for the timestamp.
Definition extcap_argument.cpp:102
virtual QString value()
Retrieves the current timestamp value.
Definition extcap_argument.cpp:97
virtual QWidget * createEditor(QWidget *parent)
Creates the datetime editor widget.
Definition extcap_argument.cpp:52
virtual bool isValid()
Checks if the timestamp input is valid.
Definition extcap_argument.cpp:87
Base class representing a command line argument for an extcap utility.
Definition extcap_argument.h:127
bool fileExists()
Checks if a file path specified by the argument exists.
Definition extcap_argument.cpp:984
virtual void setDefaultValue()
Slot to set the argument to its default value.
Definition extcap_argument.cpp:1059
virtual ~ExtcapArgument()
Destroys the ExtcapArgument.
Definition extcap_argument.cpp:847
extcap_arg * _argument
Definition extcap_argument.h:325
virtual extcap_arg * argument()
Retrieves the underlying extcap_arg structure.
Definition extcap_argument.h:173
virtual bool isValid()
Checks if the current state of the argument is valid.
Definition extcap_argument.cpp:899
virtual int argNr() const
Retrieves the argument number.
Definition extcap_argument.cpp:928
void onIntChanged(int val)
Slot to handle integer value changes.
Definition extcap_argument.cpp:1043
void onStringChanged(QString val)
Slot to handle string value changes.
Definition extcap_argument.cpp:1038
virtual QWidget * createLabel(QWidget *parent=0)
Creates a label widget for this argument.
Definition extcap_argument.cpp:851
virtual QString call()
Retrieves the call string for this argument.
Definition extcap_argument.cpp:876
ExtcapValueList loadValues(QString parent)
Loads the available values for this argument.
Definition extcap_argument.cpp:791
QString prefKey(const QString &device_name, const QString &option_name, const QString &option_value)
Generates a preference key for this argument.
Definition extcap_argument.cpp:933
static ExtcapArgument * create(extcap_arg *argument=Q_NULLPTR, QObject *parent=Q_NULLPTR)
Factory method to create an appropriate ExtcapArgument subclass.
Definition extcap_argument.cpp:1000
bool isSufficient()
Checks if the argument provides sufficient information on its own.
Definition extcap_argument.cpp:968
bool isRequired()
Checks if the argument is required.
Definition extcap_argument.cpp:960
void resetValue()
Resets the argument to its initial value.
Definition extcap_argument.cpp:891
bool isDefault()
Checks if the argument currently holds its default value.
Definition extcap_argument.cpp:992
ExtcapValueList values
Definition extcap_argument.h:322
int _number
Definition extcap_argument.h:331
virtual QString group() const
Retrieves the group name this argument belongs to.
Definition extcap_argument.cpp:920
virtual QWidget * createEditor(QWidget *parent=0)
Creates an editor widget for this argument.
Definition extcap_argument.cpp:871
void onBoolChanged(bool val)
Slot to handle boolean value changes.
Definition extcap_argument.cpp:1049
virtual QString prefValue()
Retrieves the preference value for this argument.
Definition extcap_argument.cpp:886
virtual QString value()
Retrieves the current value of the argument.
Definition extcap_argument.cpp:881
QLabel * _label
Definition extcap_argument.h:328
void valueChanged()
Signal emitted when the argument's value changes.
bool reload()
Reloads the argument data.
Definition extcap_argument.cpp:976
virtual bool isSetDefaultValueSupported()
Checks if setting a default value is supported by this argument type.
Definition extcap_argument.cpp:1054
virtual QString defaultValue()
Retrieves the default value of the argument.
Definition extcap_argument.cpp:909
bool reloadValues()
Reloads the values list.
Definition extcap_argument.cpp:828
Represents a single value option for an extcap argument.
Definition extcap_argument.h:37
ExtcapValue(QString value, QString call, bool enabled, bool isDefault)
Constructs a new ExtcapValue.
Definition extcap_argument.h:46
void setChildren(ExtcapValueList children)
Sets the child values for this value.
Definition extcap_argument.cpp:747
const QString call() const
Retrieves the call string.
Definition extcap_argument.h:82
QString value() const
Retrieves the display value.
Definition extcap_argument.h:76
ExtcapValueList children()
Retrieves the child values.
Definition extcap_argument.h:65
virtual ~ExtcapValue()
Destroys the ExtcapValue.
Definition extcap_argument.cpp:745
bool enabled() const
Checks if the value is enabled.
Definition extcap_argument.h:88
bool isDefault() const
Checks if the value is the default.
Definition extcap_argument.h:94
int depth()
Retrieves the hierarchical depth of this value.
Definition extcap_argument.h:100
A fully parsed extcap argument sentence with all its associated options.
Definition extcap_parser.h:118