Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ExtcapArgument Class Reference

Base class representing a command line argument for an extcap utility. More...

#include <extcap_argument.h>

Inheritance diagram for ExtcapArgument:
ExtArgBool ExtArgMultiSelect ExtArgRadio ExtArgSelector ExtArgText ExtArgTimestamp ExtcapArgumentFileSelection ExtArgTable ExtArgEditSelector ExtArgNumber

Public Slots

virtual void setDefaultValue ()
 Slot to set the argument to its default value.
 
void onBoolChanged (bool val)
 Slot to handle boolean value changes.
 
void onIntChanged (int val)
 Slot to handle integer value changes.
 
void onStringChanged (QString val)
 Slot to handle string value changes.
 

Signals

void valueChanged ()
 Signal emitted when the argument's value changes.
 

Public Member Functions

 ExtcapArgument (QObject *parent=Q_NULLPTR)
 Constructs an empty ExtcapArgument.
 
 ExtcapArgument (extcap_arg *argument, QObject *parent=Q_NULLPTR)
 Constructs an ExtcapArgument from a core extcap_arg structure.
 
 ExtcapArgument (const ExtcapArgument &obj)
 Copy constructor for ExtcapArgument.
 
virtual ~ExtcapArgument ()
 Destroys the ExtcapArgument.
 
virtual QWidget * createLabel (QWidget *parent=0)
 Creates a label widget for this argument.
 
virtual QWidget * createEditor (QWidget *parent=0)
 Creates an editor widget for this argument.
 
virtual extcap_argargument ()
 Retrieves the underlying extcap_arg structure.
 
virtual QString call ()
 Retrieves the call string for this argument.
 
virtual QString value ()
 Retrieves the current value of the argument.
 
virtual QString defaultValue ()
 Retrieves the default value of the argument.
 
bool isDefault ()
 Checks if the argument currently holds its default value.
 
virtual bool isValid ()
 Checks if the current state of the argument is valid.
 
bool isRequired ()
 Checks if the argument is required.
 
bool isSufficient ()
 Checks if the argument provides sufficient information on its own.
 
bool reload ()
 Reloads the argument data.
 
QString prefKey (const QString &device_name, const QString &option_name, const QString &option_value)
 Generates a preference key for this argument.
 
virtual QString prefValue ()
 Retrieves the preference value for this argument.
 
void resetValue ()
 Resets the argument to its initial value.
 
virtual QString group () const
 Retrieves the group name this argument belongs to.
 
virtual int argNr () const
 Retrieves the argument number.
 
virtual bool isSetDefaultValueSupported ()
 Checks if setting a default value is supported by this argument type.
 

Static Public Member Functions

static ExtcapArgumentcreate (extcap_arg *argument=Q_NULLPTR, QObject *parent=Q_NULLPTR)
 Factory method to create an appropriate ExtcapArgument subclass.
 

Protected Member Functions

bool fileExists ()
 Checks if a file path specified by the argument exists.
 
ExtcapValueList loadValues (QString parent)
 Loads the available values for this argument.
 
bool reloadValues ()
 Reloads the values list.
 

Protected Attributes

ExtcapValueList values
 
extcap_arg_argument
 
QLabel * _label
 
int _number
 

Detailed Description

Base class representing a command line argument for an extcap utility.

Constructor & Destructor Documentation

◆ ExtcapArgument() [1/3]

ExtcapArgument::ExtcapArgument ( QObject *  parent = Q_NULLPTR)

Constructs an empty ExtcapArgument.

Parameters
parentThe parent QObject, defaults to Q_NULLPTR.

◆ ExtcapArgument() [2/3]

ExtcapArgument::ExtcapArgument ( extcap_arg argument,
QObject *  parent = Q_NULLPTR 
)

Constructs an ExtcapArgument from a core extcap_arg structure.

Parameters
argumentPointer to the core extcap_arg.
parentThe parent QObject, defaults to Q_NULLPTR.

◆ ExtcapArgument() [3/3]

ExtcapArgument::ExtcapArgument ( const ExtcapArgument obj)

Copy constructor for ExtcapArgument.

Parameters
objThe ExtcapArgument to copy from.

Member Function Documentation

◆ argNr()

int ExtcapArgument::argNr ( ) const
virtual

Retrieves the argument number.

Returns
The argument number.

◆ argument()

virtual extcap_arg * ExtcapArgument::argument ( )
inlinevirtual

Retrieves the underlying extcap_arg structure.

Returns
Pointer to the extcap_arg.

◆ call()

QString ExtcapArgument::call ( )
virtual

Retrieves the call string for this argument.

Returns
The call string.

Reimplemented in ExtArgBool.

◆ create()

ExtcapArgument * ExtcapArgument::create ( extcap_arg argument = Q_NULLPTR,
QObject *  parent = Q_NULLPTR 
)
static

Factory method to create an appropriate ExtcapArgument subclass.

Parameters
argumentPointer to the core extcap_arg.
parentThe parent QObject.
Returns
A pointer to the newly created ExtcapArgument.

◆ createEditor()

QWidget * ExtcapArgument::createEditor ( QWidget *  parent = 0)
virtual

Creates an editor widget for this argument.

Parameters
parentThe parent widget for the editor.
Returns
A pointer to the created editor widget.

Reimplemented in ExtArgText, ExtArgNumber, ExtArgSelector, ExtArgEditSelector, ExtArgRadio, ExtArgBool, ExtArgTimestamp, ExtcapArgumentFileSelection, ExtArgMultiSelect, and ExtArgTable.

◆ createLabel()

QWidget * ExtcapArgument::createLabel ( QWidget *  parent = 0)
virtual

Creates a label widget for this argument.

Parameters
parentThe parent widget for the label.
Returns
A pointer to the created label widget.

Reimplemented in ExtArgBool.

◆ defaultValue()

QString ExtcapArgument::defaultValue ( )
virtual

Retrieves the default value of the argument.

Returns
The default value string.

Reimplemented in ExtArgNumber, ExtArgBool, ExtArgTimestamp, and ExtArgMultiSelect.

◆ fileExists()

bool ExtcapArgument::fileExists ( )
protected

Checks if a file path specified by the argument exists.

Returns
True if the file exists, false otherwise.

◆ group()

QString ExtcapArgument::group ( ) const
virtual

Retrieves the group name this argument belongs to.

Returns
The group name string.

◆ isDefault()

bool ExtcapArgument::isDefault ( )

Checks if the argument currently holds its default value.

Returns
True if it holds the default value, false otherwise.

◆ isRequired()

bool ExtcapArgument::isRequired ( )

Checks if the argument is required.

Returns
True if required, false otherwise.

◆ isSetDefaultValueSupported()

bool ExtcapArgument::isSetDefaultValueSupported ( )
virtual

Checks if setting a default value is supported by this argument type.

Returns
True if supported, false otherwise.

Reimplemented in ExtArgText, ExtArgSelector, ExtArgRadio, ExtArgBool, ExtArgTimestamp, and ExtArgMultiSelect.

◆ isSufficient()

bool ExtcapArgument::isSufficient ( )

Checks if the argument provides sufficient information on its own.

Returns
True if sufficient, false otherwise.

◆ isValid()

bool ExtcapArgument::isValid ( )
virtual

Checks if the current state of the argument is valid.

Returns
True if valid, false otherwise.

Reimplemented in ExtArgText, ExtArgSelector, ExtArgRadio, ExtArgBool, ExtArgTimestamp, ExtcapArgumentFileSelection, and ExtArgMultiSelect.

◆ loadValues()

ExtcapValueList ExtcapArgument::loadValues ( QString  parent)
protected

Loads the available values for this argument.

Parameters
parentThe parent hierarchy string.
Returns
A list of loaded ExtcapValue objects.

◆ onBoolChanged

void ExtcapArgument::onBoolChanged ( bool  val)
slot

Slot to handle boolean value changes.

Parameters
valThe new boolean value.

◆ onIntChanged

void ExtcapArgument::onIntChanged ( int  val)
slot

Slot to handle integer value changes.

Parameters
valThe new integer value.

◆ onStringChanged

void ExtcapArgument::onStringChanged ( QString  val)
slot

Slot to handle string value changes.

Parameters
valThe new string value.

◆ prefKey()

QString ExtcapArgument::prefKey ( const QString &  device_name,
const QString &  option_name,
const QString &  option_value 
)

Generates a preference key for this argument.

Parameters
device_nameThe extcap device name.
option_nameThe extcap option name.
option_valueThe extcap option value.
Returns
The preference key string.

◆ prefValue()

QString ExtcapArgument::prefValue ( )
virtual

Retrieves the preference value for this argument.

Returns
The preference value string.

Reimplemented in ExtArgBool, and ExtArgTimestamp.

◆ reload()

bool ExtcapArgument::reload ( )

Reloads the argument data.

Returns
True if successful, false otherwise.

◆ reloadValues()

bool ExtcapArgument::reloadValues ( )
protected

Reloads the values list.

Returns
True if successful, false otherwise.

◆ setDefaultValue

void ExtcapArgument::setDefaultValue ( )
virtualslot

Slot to set the argument to its default value.

Reimplemented in ExtcapArgumentFileSelection.

◆ value()

QString ExtcapArgument::value ( )
virtual

Retrieves the current value of the argument.

Returns
The value string.

Reimplemented in ExtArgText, ExtArgSelector, ExtArgEditSelector, ExtArgRadio, ExtArgBool, ExtArgTimestamp, ExtcapArgumentFileSelection, ExtArgMultiSelect, and ExtArgTable.

Member Data Documentation

◆ _argument

extcap_arg* ExtcapArgument::_argument
protected

Pointer to the core extcap_arg structure.

◆ _label

QLabel* ExtcapArgument::_label
protected

Pointer to the associated label widget.

◆ _number

int ExtcapArgument::_number
protected

The argument number identifier.

◆ values

ExtcapValueList ExtcapArgument::values
protected

The list of available values for this argument.


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