12#ifndef INTERFACE_SORT_FILTER_MODEL_H
13#define INTERFACE_SORT_FILTER_MODEL_H
19#include <QSortFilterProxyModel>
80#ifdef HAVE_PCAP_REMOTE
85 void setRemoteDisplay(
bool remoteDisplay);
96 void toggleRemoteDisplay();
102 bool remoteInterfacesExist();
148 void setColumns(QList<InterfaceTreeColumns> columns);
162 QModelIndex
mapToSource(
const QModelIndex &proxyIndex)
const;
169 QModelIndex
mapFromSource(
const QModelIndex &sourceIndex)
const;
184 bool filterAcceptsRow(
int source_row,
const QModelIndex & source_parent)
const;
200 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right)
const;
210 bool _invertTypeFilter;
216 bool _sortByActivity;
218#ifdef HAVE_PCAP_REMOTE
224 QList<int> displayHiddenTypes;
227 QList<InterfaceTreeColumns> _columns;
233 void resetPreferenceData();
A proxy model that provides custom sorting and filtering for the list of interfaces.
Definition interface_sort_filter_model.h:25
bool filterHidden() const
Checks if hidden interfaces are currently being filtered out.
Definition interface_sort_filter_model.cpp:166
bool sortByActivity() const
Checks if the interfaces are currently being sorted by activity.
Definition interface_sort_filter_model.cpp:79
void setStoreOnChange(bool storeOnChange)
Configures whether changes to interface visibility state should be stored persistently.
Definition interface_sort_filter_model.cpp:55
void setFilterByType(bool filter, bool invert=false)
Enables or disables filtering by interface type.
Definition interface_sort_filter_model.cpp:133
bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const
Determines whether a column from the source model matches active column filters.
Definition interface_sort_filter_model.cpp:360
bool filterByType() const
Checks if filtering by interface type is currently active.
Definition interface_sort_filter_model.cpp:193
void setInterfaceTypeVisible(int ifType, bool visible)
Sets the visibility for a specific interface type.
Definition interface_sort_filter_model.cpp:230
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
Maps a source model index to its corresponding proxy model index.
Definition interface_sort_filter_model.cpp:401
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
Compares two source indices to determine their sort order.
Definition interface_sort_filter_model.cpp:427
int interfacesHidden()
Gets the count of interfaces that are currently hidden by the filter.
Definition interface_sort_filter_model.cpp:198
QModelIndex mapToSource(const QModelIndex &proxyIndex) const
Maps a proxy model index to its corresponding source model index.
Definition interface_sort_filter_model.cpp:387
QList< int > typesDisplayed()
Retrieves a list of interface types that are currently set to be displayed.
Definition interface_sort_filter_model.cpp:208
void resetAllFilter()
Resets all current filters to their default states.
Definition interface_sort_filter_model.cpp:29
void setSortByActivity(bool sort)
Sets whether the interfaces should be dynamically sorted based on network activity.
Definition interface_sort_filter_model.cpp:73
QString interfaceError()
Retrieves any current interface-related error messages.
Definition interface_sort_filter_model.cpp:413
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
Determines whether a row from the source model matches all active filters.
Definition interface_sort_filter_model.cpp:295
void setColumns(QList< InterfaceTreeColumns > columns)
Configures which specific columns from the source model should be displayed.
Definition interface_sort_filter_model.cpp:373
void setFilterHidden(bool filter)
Sets whether hidden interfaces should be filtered out (not displayed).
Definition interface_sort_filter_model.cpp:65
void toggleTypeVisibility(int ifType)
Toggles the visibility state for a specific interface type.
Definition interface_sort_filter_model.cpp:276
int mapSourceToColumn(InterfaceTreeColumns mdlIndex)
Maps a logical column identifier to its actual display column index.
Definition interface_sort_filter_model.cpp:379
void toggleFilterHidden()
Toggles the filter state for hidden interfaces.
Definition interface_sort_filter_model.cpp:171
bool isInterfaceTypeShown(int ifType) const
Checks if a specific interface type is currently set to be visible.
Definition interface_sort_filter_model.cpp:283
InterfaceTreeColumns
Column indices for the interface tree model shared across interface-related views.
Definition interface_tree_model.h:42