settings.h
author insilmaril
Tue Jan 24 15:09:48 2006 +0000 (2006-01-24)
changeset 182 2747c4145c71
parent 0 7a96bd401351
child 188 90969608255c
permissions -rw-r--r--
Introduced basic export to Open Document format
     1 #ifndef SETTINGS_H
     2 #define SETTINGS_H
     3 
     4 #include <qsettings.h>
     5 #include <qstring.h>
     6 #include <qstringlist.h>
     7 
     8 #include "misc.h"
     9 
    10 // Some helper functions and simplified settings class
    11 // to read and parse settings e.g.  in undo/redo directories
    12 bool loadStringFromDisk (const QString &, QString &);
    13 bool saveStringToDisk (const QString &, const QString &s);
    14 
    15 class SimpleSettings
    16 {
    17 public:
    18     SimpleSettings ();
    19 	~SimpleSettings ();
    20 	void clear();
    21 	void readSettings(const QString &);
    22 	void writeSettings(const QString &);
    23 	QString readEntry (const QString &);
    24 	void setEntry (const QString &,const QString &);
    25 private:	
    26 	QStringList keylist;
    27 	QStringList valuelist;
    28 };
    29 
    30 
    31 // Overloaded QSettings class, used to save some settings in 
    32 // a map instead of users home directory
    33 class Settings:public QSettings,public xmlObj
    34 {
    35 public:
    36     Settings ();
    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 getXMLData (const QString &);
    43 
    44 protected:
    45 	QStringList pathlist;
    46 	QStringList keylist;
    47 	QStringList valuelist;
    48 };
    49 
    50 #endif