10#ifndef PREFERENCE_MANAGER_H
11#define PREFERENCE_MANAGER_H
18#include <QActionGroup>
76 static QMap<int, PreferenceFactory*> & factories();
103#define REGISTER_PREFERENCE_TYPE(pref_id, preference_class) \
104 class preference_class##pref_id##Factory : public PreferenceFactory { \
106 preference_class##pref_id##Factory() \
108 PreferenceManager::instance()->registerType(pref_id, this); \
110 virtual WiresharkPreference *create(QObject * parent) { \
111 WiresharkPreference * newPrefHandler = new preference_class(parent); \
112 return newPrefHandler; \
115 static preference_class##pref_id##Factory global_##preference_class##pref_id##Factory;
Abstract base class for creating Wireshark preference objects.
Definition preference_manager.h:83
virtual WiresharkPreference * create(QObject *parent=Q_NULLPTR)=0
Creates a new WiresharkPreference object.
virtual ~PreferenceFactory()
Destroys the PreferenceFactory.
Definition preference_manager.cpp:17
Manages the registration and creation of Wireshark preferences.
Definition preference_manager.h:30
void reuseType(int pref, int reuseFor)
Maps an existing preference factory to another preference type.
virtual ~PreferenceManager()
Destroys the PreferenceManager.
Definition preference_manager.cpp:29
void registerType(int pref, PreferenceFactory *factory)
Registers a preference factory for a specific preference type.
Definition preference_manager.cpp:44
WiresharkPreference * getPreference(PrefsItem *item)
Retrieves a WiresharkPreference instance for the given PrefsItem.
Definition preference_manager.cpp:54
static PreferenceManager * instance()
Retrieves the singleton instance of the PreferenceManager.
Definition preference_manager.cpp:35
A single node in the PrefsModel tree.
Definition pref_models.h:136
Base class for preference editor delegates used in the preferences tree view.
Definition wireshark_preference.h:27