settings.h
author insilmaril
Tue May 06 10:45:26 2008 +0000 (2008-05-06)
changeset 701 b4143a8907d5
parent 378 1ab7353f8f44
permissions -rw-r--r--
German translations
     1 #ifndef SETTINGS_H
     2 #define SETTINGS_H
     3 
     4 #include <qsettings.h>
     5 #include <qstring.h>
     6 #include <qstringlist.h>
     7 
     8 #include "xmlobj.h"
     9 
    10 // Some helper functions and simplified settings class
    11 // to read and parse settings e.g.  in undo/redo directories
    12 
    13 class SimpleSettings
    14 {
    15 public:
    16     SimpleSettings ();
    17 	~SimpleSettings ();
    18 	void clear();
    19 	void readSettings(const QString &);
    20 	void writeSettings(const QString &);
    21 	QString readEntry (const QString &key, const QString &def=QString());
    22 	int readNumEntry (const QString &, const int &def=0);
    23 	void setEntry (const QString &,const QString &);
    24 private:	
    25 	QStringList keylist;
    26 	QStringList valuelist;
    27 };
    28 
    29 
    30 // Overloaded QSettings class, used to save some settings in 
    31 // a map instead of users home directory
    32 class Settings:public QSettings,public XMLObj
    33 {
    34 public:
    35     Settings ();
    36     Settings (const QString & , const QString &);
    37 	~Settings ();
    38 	void clear();
    39 	void clearLocal (const QString &);
    40 	QString readLocalEntry ( const QString &, const QString &, const QString &);
    41 	void setLocalEntry (const QString &, const QString &, const QString &);
    42 	QString getDataXML (const QString &);
    43 
    44 protected:
    45 	QStringList pathlist;
    46 	QStringList keylist;
    47 	QStringList valuelist;
    48 };
    49 
    50 #endif