author | alwin <alwin> | 2004-08-01 21:26:02 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-08-01 21:26:02 (UTC) |
commit | cd26bd549ac20b73039bab11662d627895f37c1a (patch) (unidiff) | |
tree | a1840bf1e13ca4ff1b43572db8194eacdcbe091d /noncore/apps/keyz-cfg/cfgfile.h | |
parent | 9084969d2d4fa39d4d2c185695f0c88739a0f95c (diff) | |
download | opie-cd26bd549ac20b73039bab11662d627895f37c1a.zip opie-cd26bd549ac20b73039bab11662d627895f37c1a.tar.gz opie-cd26bd549ac20b73039bab11662d627895f37c1a.tar.bz2 |
reorganized zkbapplet for easier packaging within OE
Diffstat (limited to 'noncore/apps/keyz-cfg/cfgfile.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/keyz-cfg/cfgfile.h | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/noncore/apps/keyz-cfg/cfgfile.h b/noncore/apps/keyz-cfg/cfgfile.h deleted file mode 100644 index 9759900..0000000 --- a/noncore/apps/keyz-cfg/cfgfile.h +++ b/dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | #ifndef CFGFILE_H | ||
2 | #define CFGFILE_H | ||
3 | |||
4 | #include <qlist.h> | ||
5 | #include "zkbxml.h" | ||
6 | |||
7 | class CfgEntry { | ||
8 | public: | ||
9 | CfgEntry(); | ||
10 | CfgEntry(const QString& file, const QString& label); | ||
11 | |||
12 | const QString& getFile() const; | ||
13 | void setFile(const QString& f); | ||
14 | const QString& getLabel() const; | ||
15 | void setLabel(const QString& l); | ||
16 | |||
17 | protected: | ||
18 | QString file; | ||
19 | QString label; | ||
20 | }; | ||
21 | |||
22 | class CfgFile { | ||
23 | public: | ||
24 | CfgFile(); | ||
25 | ~CfgFile(); | ||
26 | |||
27 | QList<CfgEntry>& getEntries(); | ||
28 | bool replaceEntry(const QString& file, const QString& label, | ||
29 | int index = -1); | ||
30 | bool deleteEntry(const QString& file); | ||
31 | |||
32 | int getAutorepeatDelay() const; | ||
33 | void setAutorepeatDelay(int); | ||
34 | int getAutorepeatPeriod() const; | ||
35 | void setAutorepeatPeriod(int); | ||
36 | |||
37 | protected: | ||
38 | QList<CfgEntry> entries; | ||
39 | int ardelay; | ||
40 | int arperiod; | ||
41 | }; | ||
42 | |||
43 | class CfgParser : public QXmlErrorHandler { | ||
44 | public: | ||
45 | CfgParser(); | ||
46 | virtual ~CfgParser(); | ||
47 | |||
48 | bool load(QString file, CfgFile& cfg); | ||
49 | bool save(QString file, CfgFile& cfg); | ||
50 | |||
51 | void addLabel(const QString& name, const QString& state); | ||
52 | void addFile(const QString& file, const QString& prefix); | ||
53 | |||
54 | int getAutorepeatDelay() const; | ||
55 | void setAutorepeatDelay(int); | ||
56 | int getAutorepeatPeriod() const; | ||
57 | void setAutorepeatPeriod(int); | ||
58 | |||
59 | virtual bool warning(const QXmlParseException& e); | ||
60 | virtual bool error(const QXmlParseException& e); | ||
61 | virtual bool fatalError(const QXmlParseException& e); | ||
62 | virtual QString errorString(); | ||
63 | |||
64 | QString getError(); | ||
65 | |||
66 | protected: | ||
67 | QString err; | ||
68 | QMap<QString, QString> labels; | ||
69 | QMap<QString, QString> includes; | ||
70 | QList<QString> labelList; | ||
71 | QList<QString> includeList; | ||
72 | int ardelay; | ||
73 | int arperiod; | ||
74 | }; | ||
75 | |||
76 | class CfgHandler : public ZkbXmlHandler { | ||
77 | public: | ||
78 | CfgHandler(CfgParser &); | ||
79 | virtual ~CfgHandler(); | ||
80 | |||
81 | protected: | ||
82 | CfgParser& cfg; | ||
83 | |||
84 | virtual bool startKeymapElement(int ardelay, int arperiod, | ||
85 | const QString& author); | ||
86 | virtual bool startIncludeElement(const QString& file, | ||
87 | const QString& prfix); | ||
88 | virtual bool startLabelElement(const QString& label, | ||
89 | const QString& state); | ||
90 | virtual bool startStateElement(const QString& name, | ||
91 | const QString& parent, bool dflt); | ||
92 | virtual bool startMapElement(int key, bool pressed); | ||
93 | virtual bool startEventElement(int keycode, int unicode, int modifiers, | ||
94 | bool pressed, bool autorepeat); | ||
95 | virtual bool startNextStateElement(const QString& state); | ||
96 | |||
97 | virtual bool endKeymapElement(); | ||
98 | virtual bool endIncludeElement(); | ||
99 | virtual bool endLabelElement(); | ||
100 | virtual bool endStateElement(); | ||
101 | virtual bool endMapElement(); | ||
102 | virtual bool endEventElement(); | ||
103 | virtual bool endNextStateElement(); | ||
104 | }; | ||
105 | |||
106 | #endif | ||