summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profile.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/profile.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/profile.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/profile.h b/noncore/apps/opie-console/profile.h
new file mode 100644
index 0000000..8adc0bd
--- a/dev/null
+++ b/noncore/apps/opie-console/profile.h
@@ -0,0 +1,66 @@
1#ifndef OPIE_PROFILE_H
2#define OPIE_PROFILE_H
3
4#include <qmap.h>
5#include <qstring.h>
6#include <qstringlist.h>
7#include <qvaluelist.h>
8/**
9 * A session will be generated from a saved
10 * profile. A profile contains the iolayername
11 * a name.
12 * We can generate a Session from a Profile
13 * No configuration is contained here....
14 */
15class Profile {
16public:
17 typedef QValueList<Profile> ValueList;
18 enum Color { Black = 0,
19 White,
20 Gray };
21 enum Terminal {VT102 = 0 };
22 enum Font { Micro = 0, Small, Medium };
23 Profile();
24 Profile( const QString& name,
25 const QString& iolayerName,
26 int background,
27 int foreground,
28 int terminal);
29 Profile( const Profile& );
30 Profile &operator=( const Profile& );
31
32 ~Profile();
33 QString name()const;
34 QString ioLayerName()const;
35 int foreground()const;
36 int background()const;
37 int terminal()const;
38
39 /*
40 * config stuff
41 */
42 QMap<QString, QString> conf();
43 void clearConf();
44 void writeEntry( const QString& key, const QString& value );
45 void writeEntry( const QString& key, int num );
46 void writeEntry( const QString& key, bool b );
47 void writeEntry( const QString& key, const QStringList&, const QChar& );
48 QString readEntry( const QString& key, const QString& deflt = QString::null)const;
49 int readNumEntry( const QString& key, int = -1 )const;
50 bool readBoolEntry( const QString& key, bool = FALSE )const;
51
52 void setName( const QString& );
53 void setIOLayer( const QString& );
54 void setBackground( int back );
55 void setForeground( int fore );
56 void setTerminal( int term );
57private:
58 QMap<QString, QString> m_conf;
59 QString m_name;
60 QString m_ioLayer;
61 int m_back;
62 int m_fore;
63 int m_terminal;
64};
65
66#endif