Loading...
Searching...
No Matches
preferences.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_DIALOGS_PREFERENCES_H
#define BALL_VIEW_DIALOGS_PREFERENCES_H
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/COMMON/global.h>
#endif
#ifndef BALL_DATATYPE_STRING_H
# include <BALL/DATATYPE/string.h>
#endif
#ifndef BALL_DATATYPE_HASHSET_H
# include <BALL/DATATYPE/hashSet.h>
#endif
#ifndef BALL_DATATYPE_HASHMAP_H
# include <BALL/DATATYPE/hashMap.h>
#endif
#include <BALL/VIEW/UIC/ui_preferences.h>
namespace BALL
{
class INIFile;
namespace VIEW
{
class PreferencesEntry;
class BALL_VIEW_EXPORT Preferences
: public QDialog,
public Ui_PreferencesData
{
Q_OBJECT
public:
Preferences(QWidget *parent = NULL, const char *name = "Preferences");
Preferences(const Preferences& preferences);
virtual ~Preferences();
bool hasPages();
void insertEntry(PreferencesEntry *child);
void removeEntry(PreferencesEntry *child);
void insertChildEntry(PreferencesEntry* parent, PreferencesEntry *child);
void insertChildEntry(const std::string& category, PreferencesEntry *child);
void fetchPreferences(INIFile &inifile);
void writePreferences(INIFile &inifile);
const QWidget* currentEntry() const;
const QWidget* currentPage() const;
void setApplyEnabled(bool enabled);
Q_SIGNALS:
void applied();
public Q_SLOTS:
void show();
void showEntry(QWidget* page);
void entrySelected();
void setDefaultValues();
void reject();
void applyPreferences();
BALL_DEPRECATED void showHelp();
protected Q_SLOTS:
void dialogButtonsClicked_(QAbstractButton* button);
protected:
void removeItem_(QTreeWidgetItem* item, bool update);
HashSet<PreferencesEntry*> entries_;
HashMap<QTreeWidgetItem*, QWidget*> item_to_widget_;
HashMap<QTreeWidgetItem*, PreferencesEntry*> item_to_entry_;
HashMap<QWidget*, QTreeWidgetItem*> widget_to_item_;
};
} // namespace VIEW
} // namespace BALL
#endif // BALL_VIEW_DIALOGS_PREFERENCES_H
global.h
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::HashSet
Definition hashSet.h:46
BALL::INIFile
Definition INIFile.h:29
BALL::VIEW::PreferencesEntry
Definition preferencesEntry.h:69
BALL::VIEW::Preferences::Preferences
Preferences(const Preferences &preferences)
Copy constructur.
BALL::VIEW::Preferences::Preferences
Preferences(QWidget *parent=NULL, const char *name="Preferences")
BALL::VIEW::Preferences::widget_to_item_
HashMap< QWidget *, QTreeWidgetItem * > widget_to_item_
Definition preferences.h:164
BALL::VIEW::Preferences::writePreferences
void writePreferences(INIFile &inifile)
BALL::VIEW::Preferences::show
void show()
BALL::VIEW::Preferences::entrySelected
void entrySelected()
BALL::VIEW::Preferences::reject
void reject()
BALL::VIEW::Preferences::removeItem_
void removeItem_(QTreeWidgetItem *item, bool update)
BALL::VIEW::Preferences::setDefaultValues
void setDefaultValues()
BALL::VIEW::Preferences::entries_
HashSet< PreferencesEntry * > entries_
Definition preferences.h:161
BALL::VIEW::Preferences::removeEntry
void removeEntry(PreferencesEntry *child)
BALL::VIEW::Preferences::insertChildEntry
void insertChildEntry(const std::string &category, PreferencesEntry *child)
BALL::VIEW::Preferences::currentPage
const QWidget * currentPage() const
BALL::VIEW::Preferences::item_to_entry_
HashMap< QTreeWidgetItem *, PreferencesEntry * > item_to_entry_
Definition preferences.h:163
BALL::VIEW::Preferences::insertChildEntry
void insertChildEntry(PreferencesEntry *parent, PreferencesEntry *child)
BALL::VIEW::Preferences::currentEntry
const QWidget * currentEntry() const
BALL::VIEW::Preferences::insertEntry
void insertEntry(PreferencesEntry *child)
BALL::VIEW::Preferences::dialogButtonsClicked_
void dialogButtonsClicked_(QAbstractButton *button)
BALL::VIEW::Preferences::item_to_widget_
HashMap< QTreeWidgetItem *, QWidget * > item_to_widget_
Definition preferences.h:162
BALL::VIEW::Preferences::fetchPreferences
void fetchPreferences(INIFile &inifile)
BALL::VIEW::Preferences::~Preferences
virtual ~Preferences()
Destructor.
BALL::VIEW::Preferences::showHelp
BALL_DEPRECATED void showHelp()
BALL::VIEW::Preferences::showEntry
void showEntry(QWidget *page)
Show the given page.
BALL::VIEW::Preferences::setApplyEnabled
void setApplyEnabled(bool enabled)
Activate or deactivate the apply and ok buttons.
BALL::VIEW::Preferences::applied
void applied()
BALL::VIEW::Preferences::applyPreferences
void applyPreferences()
Store the last applied values for undo.
BALL::VIEW::Preferences::hasPages
bool hasPages()
QDialog
QTreeWidgetItem
QWidget
hashMap.h
hashSet.h
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
string.h