Loading...
Searching...
No Matches
pluginDialog.h
Go to the documentation of this file.
#ifndef BALL_VIEW_PLUGINDIALOG_H
#define BALL_VIEW_PLUGINDIALOG_H
#ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
# include <BALL/VIEW/KERNEL/preferencesEntry.h>
#endif
#ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
# include <BALL/VIEW/KERNEL/modularWidget.h>
#endif
#ifndef BALL_PLUGIN_PLUGINHANDLER_H
# include <BALL/PLUGIN/pluginHandler.h>
#endif
#include <QtCore/QModelIndex>
namespace Ui
{
class PluginDialogData;
}
namespace BALL
{
namespace VIEW
{
class VIEWPlugin;
class PluginModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit PluginModel ( QObject* parent = 0 );
int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const;
QVariant data(const QModelIndex& i, int role) const;
void pluginsLoaded();
private:
int num_rows_;
};
class PluginDirectoryModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit PluginDirectoryModel ( QObject* parent = 0 );
int rowCount(const QModelIndex& /* parent */ = QModelIndex()) const;
QVariant data(const QModelIndex& i, int role) const;
void addDirectory(const QString& dir);
void removeDirectory(const QModelIndex& index);
};
class BALL_VIEW_EXPORT PluginDialog
: public QWidget,
public ModularWidget,
public PreferencesEntry,
public PluginHandler
{
Q_OBJECT
public:
BALL_EMBEDDABLE(PluginDialog, ModularWidget)
PluginDialog(Preferences* preferences, QWidget* parent, const char *name = "PluginDialog");
virtual ~PluginDialog();
virtual void initializeWidget(MainControl& main_control);
virtual void finalizeWidget(MainControl& main_control);
virtual void writePreferenceEntries(INIFile& inifile);
virtual void readPreferenceEntries(const INIFile& inifile);
virtual void registerChildEntry(PreferencesEntry* child);
virtual void unregisterChildEntry(PreferencesEntry* child);
virtual void restoreDefaultValues(bool /* all */ = false);
bool canHandle(BALLPlugin* plugin) const;
bool specificSetup_(BALLPlugin* plugin);
bool specificShutdown_(BALLPlugin* plugin);
protected:
virtual void setDefaultPluginDirectory();
protected Q_SLOTS:
virtual void addPluginDirectory();
virtual void removePluginDirectory();
virtual void directorySelectionChanged(const QModelIndex&, const QModelIndex& /* previous */);
virtual void pluginChanged(QModelIndex current, const QModelIndex& /* previous */);
virtual void togglePluginState();
private:
QModelIndex active_index_;
PluginModel plugin_model_;
PluginDirectoryModel plugin_dir_model_;
Preferences* preferences_;
Ui::PluginDialogData* ui_;
std::list<PreferencesEntry*> child_entries_;
};
}
}
#endif
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::BALLPlugin
Definition BALLPlugin.h:21
BALL::INIFile
Definition INIFile.h:29
BALL::PluginHandler
Definition pluginHandler.h:28
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::ModularWidget::ModularWidget
ModularWidget(const char *name="<ModularWidget>")
BALL::VIEW::PluginDialog::directorySelectionChanged
virtual void directorySelectionChanged(const QModelIndex &, const QModelIndex &)
BALL::VIEW::PluginDialog::registerChildEntry
virtual void registerChildEntry(PreferencesEntry *child)
BALL::VIEW::PluginDialog::writePreferenceEntries
virtual void writePreferenceEntries(INIFile &inifile)
Store the settings of all registered objects.
BALL::VIEW::PluginDialog::togglePluginState
virtual void togglePluginState()
BALL::VIEW::PluginDialog::readPreferenceEntries
virtual void readPreferenceEntries(const INIFile &inifile)
Restore the settings of all registered objects.
BALL::VIEW::PluginDialog::restoreDefaultValues
virtual void restoreDefaultValues(bool=false)
Set all registered objects to their default values.
BALL::VIEW::PluginDialog::specificShutdown_
bool specificShutdown_(BALLPlugin *plugin)
BALL::VIEW::PluginDialog::PluginDialog
PluginDialog(Preferences *preferences, QWidget *parent, const char *name="PluginDialog")
BALL::VIEW::PluginDialog::unregisterChildEntry
virtual void unregisterChildEntry(PreferencesEntry *child)
BALL::VIEW::PluginDialog::setDefaultPluginDirectory
virtual void setDefaultPluginDirectory()
BALL::VIEW::PluginDialog::initializeWidget
virtual void initializeWidget(MainControl &main_control)
BALL::VIEW::PluginDialog::specificSetup_
bool specificSetup_(BALLPlugin *plugin)
BALL::VIEW::PluginDialog::addPluginDirectory
virtual void addPluginDirectory()
BALL::VIEW::PluginDialog::removePluginDirectory
virtual void removePluginDirectory()
BALL::VIEW::PluginDialog::finalizeWidget
virtual void finalizeWidget(MainControl &main_control)
BALL::VIEW::PluginDialog::canHandle
bool canHandle(BALLPlugin *plugin) const
BALL::VIEW::PluginDialog::pluginChanged
virtual void pluginChanged(QModelIndex current, const QModelIndex &)
BALL::VIEW::PluginDirectoryModel
Definition pluginDialog.h:52
BALL::VIEW::PluginDirectoryModel::PluginDirectoryModel
PluginDirectoryModel(QObject *parent=0)
BALL::VIEW::PluginDirectoryModel::removeDirectory
void removeDirectory(const QModelIndex &index)
BALL::VIEW::PluginDirectoryModel::addDirectory
void addDirectory(const QString &dir)
BALL::VIEW::PluginDirectoryModel::data
QVariant data(const QModelIndex &i, int role) const
BALL::VIEW::PluginDirectoryModel::rowCount
int rowCount(const QModelIndex &=QModelIndex()) const
BALL::VIEW::PluginModel
Definition pluginDialog.h:34
BALL::VIEW::PluginModel::data
QVariant data(const QModelIndex &i, int role) const
BALL::VIEW::PluginModel::rowCount
int rowCount(const QModelIndex &=QModelIndex()) const
BALL::VIEW::PluginModel::PluginModel
PluginModel(QObject *parent=0)
BALL::VIEW::PluginModel::pluginsLoaded
void pluginsLoaded()
BALL::VIEW::PreferencesEntry::PreferencesEntry
PreferencesEntry()
BALL::VIEW::Preferences
Definition preferences.h:43
QAbstractListModel
QObject
QWidget
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
modularWidget.h
BALL
Definition constants.h:13
Ui
Definition pluginDialog.h:19
std
STL namespace.
pluginHandler.h
preferencesEntry.h