atcommand.h
00001 #ifndef ATCOMMAND_H
00002 #define ATCOMMAND_H
00003
00004
00005 #include <qstring.h>
00006 #include <qstringlist.h>
00007 #include <qptrlist.h>
00008
00009 class ATParameter {
00010 public:
00011 ATParameter();
00012 ATParameter(const QString &value,const QString &name="",
00013 bool userInput=false);
00014
00015 void setName(const QString &name) { mName = name; }
00016 QString name() const { return mName; }
00017 void setValue(const QString &value) { mValue = value; }
00018 QString value() const { return mValue; }
00019 void setUserInput(bool userInput) { mUserInput = userInput; }
00020 bool userInput() const { return mUserInput; }
00021
00022 private:
00023 QString mName;
00024 QString mValue;
00025 bool mUserInput;
00026 };
00027
00031
00032 class ATCommand {
00033 public:
00034 ATCommand();
00035 ATCommand(const QString &cmdString);
00036 ATCommand(const QString &cmdName,const QString &cmdString,
00037 bool hexOutput=false);
00038 virtual ~ATCommand();
00039
00040 void setCmdName(const QString &);
00041 QString cmdName();
00042
00043 void setCmdString(const QString &);
00044 QString cmdString();
00045
00046 QString cmd();
00047
00048 QString id();
00049
00050 void setHexOutput(bool);
00051 bool hexOutput();
00052
00053 QString processOutput(const QString &);
00054 QString processOutput();
00055
00056 void setResultString(const QString &);
00057 QString resultString();
00058 QString resultField(int index);
00059 QPtrList<QStringList> *resultFields();
00060
00061 void addParameter(ATParameter *);
00062 void clearParameters();
00063 QPtrList<ATParameter> parameters();
00064
00065 void setParameter(int index,const QString &value);
00066 void setParameter(int index,int value);
00067
00068 void setAutoDelete(bool autoDelete) { mAutoDelete = autoDelete; }
00069 bool autoDelete() { return mAutoDelete; }
00070
00071 private:
00072 void construct();
00073 void setResultFields(QString fieldsString);
00074 void extractParameters();
00075
00076 QString mCmdName;
00077 QString mCmdString;
00078 QString mId;
00079 bool mHexOutput;
00080
00081 QString mResultString;
00082 QPtrList<QStringList> mResultFieldsList;
00083
00084 QPtrList<ATParameter> mParameters;
00085
00086 bool mAutoDelete;
00087 };
00088
00089 #endif
This file is part of the documentation for kdelibs Version 3.1.4.