00001 #ifndef BALL_VIEW_PLUGINDIALOG_H
00002 #define BALL_VIEW_PLUGINDIALOG_H
00003
00004
00005 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00006 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00007 #endif
00008
00009 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
00010 # include <BALL/VIEW/KERNEL/modularWidget.h>
00011 #endif
00012
00013 #ifdef BALL_COMPILER_MSVC
00014 # include <BALL/VIEW/UIC/ui_pluginData.h>
00015 #else
00016 # include <BALL/VIEW/UIC/pluginDialogData.h>
00017 #endif
00018
00019 #include <QtCore/QModelIndex>
00020 #include <QtGui/QItemDelegate>
00021 #include <QtGui/QDialog>
00022
00023 namespace BALL
00024 {
00025 namespace VIEW
00026 {
00027 class VIEWPlugin;
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class PluginModel :
00039 public QAbstractListModel
00040 {
00041 Q_OBJECT
00042
00043 public:
00044 PluginModel();
00045
00046 int rowCount(const QModelIndex& parent = QModelIndex()) const;
00047 QVariant data(const QModelIndex& i, int role) const;
00048 void pluginsLoaded();
00049 private:
00050 int num_rows_;
00051 };
00052
00053
00054
00057 class PluginDialog
00058 : public QDialog,
00059 private Ui_PluginDialogData,
00060 public ModularWidget,
00061 public PreferencesEntry
00062 {
00063 Q_OBJECT
00064
00065 BALL_EMBEDDABLE(PluginDialog, ModularWidget)
00066
00067 public:
00068 PluginDialog(QWidget* parent, const char *name = "PluginDialog");
00069 virtual ~PluginDialog() {}
00070
00076 virtual void initializeWidget(MainControl& main_control);
00077
00082 virtual void finalizeWidget(MainControl& main_control);
00083
00084 virtual void readPreferenceEntries(const INIFile& inifile);
00085
00086 protected slots:
00087 virtual void addPluginDirectory();
00088 virtual void removePluginDirectory();
00089 virtual void directorySelectionChanged();
00090
00091
00092 virtual void pluginChanged(QModelIndex i);
00093 virtual void togglePluginState();
00094
00095 private:
00096 QModelIndex active_index_;
00097 PluginModel model_;
00098 };
00099
00100 }
00101 }
00102
00103 #endif
00104