From cd26bd549ac20b73039bab11662d627895f37c1a Mon Sep 17 00:00:00 2001 From: alwin Date: Sun, 01 Aug 2004 21:26:02 +0000 Subject: reorganized zkbapplet for easier packaging within OE --- (limited to 'noncore/apps/keyz-cfg/cfgfile.h') 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 @@ -#ifndef CFGFILE_H -#define CFGFILE_H - -#include -#include "zkbxml.h" - -class CfgEntry { -public: - CfgEntry(); - CfgEntry(const QString& file, const QString& label); - - const QString& getFile() const; - void setFile(const QString& f); - const QString& getLabel() const; - void setLabel(const QString& l); - -protected: - QString file; - QString label; -}; - -class CfgFile { -public: - CfgFile(); - ~CfgFile(); - - QList& getEntries(); - bool replaceEntry(const QString& file, const QString& label, - int index = -1); - bool deleteEntry(const QString& file); - - int getAutorepeatDelay() const; - void setAutorepeatDelay(int); - int getAutorepeatPeriod() const; - void setAutorepeatPeriod(int); - -protected: - QList entries; - int ardelay; - int arperiod; -}; - -class CfgParser : public QXmlErrorHandler { -public: - CfgParser(); - virtual ~CfgParser(); - - bool load(QString file, CfgFile& cfg); - bool save(QString file, CfgFile& cfg); - - void addLabel(const QString& name, const QString& state); - void addFile(const QString& file, const QString& prefix); - - int getAutorepeatDelay() const; - void setAutorepeatDelay(int); - int getAutorepeatPeriod() const; - void setAutorepeatPeriod(int); - - virtual bool warning(const QXmlParseException& e); - virtual bool error(const QXmlParseException& e); - virtual bool fatalError(const QXmlParseException& e); - virtual QString errorString(); - - QString getError(); - -protected: - QString err; - QMap labels; - QMap includes; - QList labelList; - QList includeList; - int ardelay; - int arperiod; -}; - -class CfgHandler : public ZkbXmlHandler { -public: - CfgHandler(CfgParser &); - virtual ~CfgHandler(); - -protected: - CfgParser& cfg; - - virtual bool startKeymapElement(int ardelay, int arperiod, - const QString& author); - virtual bool startIncludeElement(const QString& file, - const QString& prfix); - virtual bool startLabelElement(const QString& label, - const QString& state); - virtual bool startStateElement(const QString& name, - const QString& parent, bool dflt); - virtual bool startMapElement(int key, bool pressed); - virtual bool startEventElement(int keycode, int unicode, int modifiers, - bool pressed, bool autorepeat); - virtual bool startNextStateElement(const QString& state); - - virtual bool endKeymapElement(); - virtual bool endIncludeElement(); - virtual bool endLabelElement(); - virtual bool endStateElement(); - virtual bool endMapElement(); - virtual bool endEventElement(); - virtual bool endNextStateElement(); -}; - -#endif -- cgit v0.9.0.2