prefscontext.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef PREFSCONTEXT_H
00028 #define PREFSCONTEXT_H
00029
00030 #include <string>
00031 #include <QMap>
00032 #include <QString>
00033
00034 #include "scribusapi.h"
00035 #include "prefstable.h"
00036
00037 typedef QMap<QString, QString> AttributeMap;
00038 typedef QMap<QString, PrefsTable*> TableMap;
00039
00040 class SCRIBUS_API PrefsContext
00041 {
00042 private:
00043 QString name;
00044 bool isplugin;
00045 bool ispersistent;
00046 public:
00047 AttributeMap values;
00048 TableMap tables;
00049 PrefsContext();
00050 PrefsContext(QString contextName, bool persistent = true, bool plugin = false);
00051 ~PrefsContext();
00052 QString getName();
00053 bool isPersistent();
00054 bool isPlugin();
00055 bool isEmpty();
00056 bool contains(const QString& key);
00057 bool containsTable(const QString& key);
00058 QString get(const QString& key, const QString& defValue = "");
00059 void set(const QString& key, const char* value);
00060 void set(const QString& key, const std::string& value);
00061 void set(const QString& key, const QString& value);
00062 int getInt(const QString& key, int defValue = -1);
00063 void set(const QString& key, int value);
00064 void set(const QString& key, uint value);
00065 uint getUInt(const QString& key, uint defValue = 0);
00066 double getDouble(const QString& key, double defValue = -1.0);
00067 void set(const QString& key, double value);
00068 bool getBool(const QString& key, bool defValue = false);
00069 void set(const QString& key, bool value);
00070 PrefsTable* getTable(const QString& name);
00071 void removeTable(const QString& name);
00072 };
00073
00074 #endif // PREFSCONTEXTS_H