00001
00002
00003
00004
00005 #ifndef BALL_VIEW_DIALOGS_PREFERENCES_H
00006 #define BALL_VIEW_DIALOGS_PREFERENCES_H
00007
00008 #ifndef BALL_COMMON_GLOBAL_H
00009 # include <BALL/COMMON/global.h>
00010 #endif
00011
00012 #ifndef BALL_DATATYPE_STRING_H
00013 # include <BALL/DATATYPE/string.h>
00014 #endif
00015
00016 #ifndef BALL_DATATYPE_HASHSET_H
00017 # include <BALL/DATATYPE/hashSet.h>
00018 #endif
00019
00020 #ifndef BALL_DATATYPE_HASHMAP_H
00021 # include <BALL/DATATYPE/hashMap.h>
00022 #endif
00023
00024 #include <BALL/VIEW/UIC/ui_preferences.h>
00025
00026 namespace BALL
00027 {
00028 class INIFile;
00029
00030 namespace VIEW
00031 {
00032 class PreferencesEntry;
00033
00040 class BALL_VIEW_EXPORT Preferences
00041 : public QDialog,
00042 public Ui_PreferencesData
00043 {
00044 Q_OBJECT
00045
00046 public:
00047
00051
00062 Preferences(QWidget *parent = NULL, const char *name = "Preferences");
00063
00065 Preferences(const Preferences& preferences);
00066
00068 virtual ~Preferences();
00069
00071
00074
00078 bool hasPages();
00079
00086 void insertEntry(PreferencesEntry *child);
00087
00093 void removeEntry(PreferencesEntry *child);
00094
00100 void fetchPreferences(INIFile &inifile);
00101
00107 void writePreferences(INIFile &inifile);
00108
00110 const QWidget* currentEntry() const;
00111
00113 const QWidget* currentPage() const;
00114
00116 void setApplyEnabled(bool enabled);
00117
00118 signals:
00119 void applied();
00120
00121 public slots:
00122
00124
00127
00130 void show();
00131
00133 void showEntry(QWidget* page);
00134
00136 void entrySelected();
00137
00139 void setDefaultValues();
00140
00142 void reject();
00143
00145 void applyPreferences();
00146
00148 void showHelp();
00149
00150 protected slots:
00151 void dialogButtonsClicked_(QAbstractButton* button);
00152
00153 protected:
00154
00155 void removeItem_(QTreeWidgetItem* item, bool update);
00156
00157 HashSet<PreferencesEntry*> entries_;
00158 HashMap<QTreeWidgetItem*, QWidget*> item_to_widget_;
00159 HashMap<QTreeWidgetItem*, PreferencesEntry*> item_to_entry_;
00160 HashMap<QWidget*, QTreeWidgetItem*> widget_to_item_;
00161
00163 };
00164
00165 }
00166 }
00167
00168 #endif // BALL_VIEW_DIALOGS_PREFERENCES_H