api.h
author insilmaril
Fri, 05 Jan 2007 11:17:32 +0000
changeset 417 1cc7bbf75f0b
parent 395 7ced3733ba60
permissions -rw-r--r--
1.8.64 various fixes
insilmaril@105
     1
#ifndef API_H
insilmaril@105
     2
#define API_H
insilmaril@105
     3
insilmaril@395
     4
#include <QColor>
insilmaril@394
     5
#include <QStringList>
insilmaril@394
     6
insilmaril@394
     7
enum ErrorLevel {NoError,Warning,Aborted};
insilmaril@105
     8
insilmaril@105
     9
class API
insilmaril@105
    10
{
insilmaril@105
    11
public:
insilmaril@133
    12
	API();
insilmaril@133
    13
	void initCommand();
insilmaril@394
    14
	void parseInput (const QString &input);
insilmaril@133
    15
	QString command();
insilmaril@133
    16
	QStringList parameters();
insilmaril@394
    17
	int paramCount();
insilmaril@394
    18
	QString errorMessage();
insilmaril@394
    19
	QString errorDescription();
insilmaril@394
    20
	ErrorLevel errorLevel();
insilmaril@394
    21
	void setError (ErrorLevel level,const QString &description);
insilmaril@394
    22
	void resetError();
insilmaril@394
    23
	bool checkParamCount (QList <int> plist);
insilmaril@394
    24
	bool checkParamCount (const int &index);
insilmaril@394
    25
	bool checkParamIsInt (const int &index);
insilmaril@394
    26
	int parInt (bool &,const uint &index);
insilmaril@394
    27
	QString parString(bool &ok,const int &index);
insilmaril@394
    28
	bool parBool (bool &ok, const int &index);
insilmaril@395
    29
	QColor parColor (bool &ok, const int &index);
insilmaril@133
    30
private:
insilmaril@394
    31
	QString input;
insilmaril@133
    32
	QString com;
insilmaril@133
    33
	QStringList paramList;
insilmaril@394
    34
	QString errMessage;
insilmaril@394
    35
	QString errDescription;
insilmaril@394
    36
	ErrorLevel errLevel;
insilmaril@105
    37
};
insilmaril@105
    38
insilmaril@105
    39
#endif