Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EnabledProtocolItem Class Referenceabstract

Represents a protocol item that can be enabled or disabled in a tree model. More...

#include <enabled_protocols_model.h>

Inheritance diagram for EnabledProtocolItem:
ModelHelperTreeItem< EnabledProtocolItem > HeuristicTreeItem ProtocolTreeItem

Public Types

enum  EnableProtocolType { Any , Standard , Heuristic }
 Defines the type of enabled protocol. More...
 

Public Member Functions

 EnabledProtocolItem (QString name, QString description, bool enabled, EnabledProtocolItem *parent)
 Constructs a new EnabledProtocolItem.
 
virtual ~EnabledProtocolItem ()
 Destroys the EnabledProtocolItem.
 
QString name () const
 Retrieves the name of the protocol.
 
QString description () const
 Retrieves the description of the protocol.
 
bool enabled () const
 Checks if the protocol is currently marked as enabled.
 
void setEnabled (bool enable)
 Sets the enabled state of the protocol.
 
EnableProtocolType type () const
 Retrieves the type of the protocol item.
 
bool applyValue ()
 Applies the current enabled value to the underlying core structures.
 
- Public Member Functions inherited from ModelHelperTreeItem< EnabledProtocolItem >
 ModelHelperTreeItem (EnabledProtocolItem *parent)
 Constructs a new ModelHelperTreeItem.
 
virtual ~ModelHelperTreeItem ()
 Destroys the ModelHelperTreeItem and its children.
 
void appendChild (EnabledProtocolItem *child)
 Appends a child item to the end of the children list.
 
void prependChild (EnabledProtocolItem *child)
 Prepends a child item to the beginning of the children list.
 
void insertChild (int row, EnabledProtocolItem *child)
 Inserts a child item at the specified row.
 
void removeChild (int row)
 Removes and deletes the child item at the specified row.
 
EnabledProtocolItemchild (int row)
 Retrieves the child item at the specified row.
 
int childCount () const
 Gets the total number of child items.
 
int row ()
 Gets the row index of this item relative to its parent.
 
EnabledProtocolItemparentItem ()
 Retrieves the parent item.
 

Protected Member Functions

virtual void applyValuePrivate (bool value)=0
 Implements the specific logic to apply the value change to the core.
 

Protected Attributes

QString name_
 
QString description_
 
bool enabled_
 
bool enabledInit_
 
EnableProtocolType type_
 
- Protected Attributes inherited from ModelHelperTreeItem< EnabledProtocolItem >
EnabledProtocolItemparent_
 
QList< QVariant > childItems_
 

Detailed Description

Represents a protocol item that can be enabled or disabled in a tree model.

Member Enumeration Documentation

◆ EnableProtocolType

Defines the type of enabled protocol.

Enumerator
Any 

Any protocol type.

Standard 

A standard protocol.

Heuristic 

A heuristic protocol.

Constructor & Destructor Documentation

◆ EnabledProtocolItem()

EnabledProtocolItem::EnabledProtocolItem ( QString  name,
QString  description,
bool  enabled,
EnabledProtocolItem parent 
)

Constructs a new EnabledProtocolItem.

Parameters
nameThe name of the protocol.
descriptionThe description of the protocol.
enabledTrue if the protocol is enabled.
parentThe parent item in the tree.

Member Function Documentation

◆ applyValue()

bool EnabledProtocolItem::applyValue ( )

Applies the current enabled value to the underlying core structures.

Returns
True if the value was successfully applied and resulted in a change.

◆ applyValuePrivate()

virtual void EnabledProtocolItem::applyValuePrivate ( bool  value)
protectedpure virtual

Implements the specific logic to apply the value change to the core.

Parameters
valueThe value to apply.

Implemented in ProtocolTreeItem, and HeuristicTreeItem.

◆ description()

QString EnabledProtocolItem::description ( ) const
inline

Retrieves the description of the protocol.

Returns
The protocol description.

◆ enabled()

bool EnabledProtocolItem::enabled ( ) const
inline

Checks if the protocol is currently marked as enabled.

Returns
True if enabled, false otherwise.

◆ name()

QString EnabledProtocolItem::name ( ) const
inline

Retrieves the name of the protocol.

Returns
The protocol name.

◆ setEnabled()

void EnabledProtocolItem::setEnabled ( bool  enable)
inline

Sets the enabled state of the protocol.

Parameters
enableTrue to enable, false to disable.

◆ type()

EnabledProtocolItem::EnableProtocolType EnabledProtocolItem::type ( ) const

Retrieves the type of the protocol item.

Returns
The protocol type enum value.

Member Data Documentation

◆ description_

QString EnabledProtocolItem::description_
protected

The protocol description.

◆ enabled_

bool EnabledProtocolItem::enabled_
protected

The current enabled state.

◆ enabledInit_

bool EnabledProtocolItem::enabledInit_
protected

The initial enabled state, used to determine if a change occurred.

◆ name_

QString EnabledProtocolItem::name_
protected

The protocol name.

◆ type_

EnableProtocolType EnabledProtocolItem::type_
protected

The protocol classification type.


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