filters
command.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __LATEXPARSER_COMMAND_H__
00021 #define __LATEXPARSER_COMMAND_H__
00022
00023 #include "param.h"
00024
00025 #include "element.h"
00026
00027 #include <qstring.h>
00028 #include <qmap.h>
00029 #include <qptrlist.h>
00030
00031 class Command: public Element
00032 {
00033 public:
00034 Command();
00038 Command(const char* command);
00039
00043 Command(const char* name, QPtrList<QPtrList<Element> >* groups);
00044
00049 Command(const char* name, QPtrList<QPtrList<Param> >* options,
00050 QPtrList<QPtrList<Element> >* groups);
00051
00056 Command(const char* name, QPtrList<QPtrList<Param> >* params, QPtrList<Param>* options, QPtrList<QPtrList<Element> >* groups);
00057
00058 ~Command();
00059
00060 QString getName() const { return _name; }
00061
00062 QPtrList<QPtrList<Param> > getParams() const { return _params; }
00063
00064 QPtrList<Param> getOptions() const { return _options; }
00065
00066 QPtrList<QPtrList<Element> > getChildren() const { return _elements; }
00067
00068 void setName(const char* name) { _name = name; }
00069 void addParam(const char* param);
00070
00071
00072 void addGroups(QPtrList<QPtrList<Element> >* elts) { _elements = *elts; }
00073
00074 void addOption(const char* option);
00075 void addOption(QString key, QString value) { _options.append(new Param(key, value)); }
00076
00077 void addChild(QPtrList<Element>* elt) { _elements.append(elt); }
00078
00079
00080 void print(int tab = 0);
00081
00082 private:
00083 QString _name;
00084 QPtrList<QPtrList<Param> > _params;
00085 QPtrList<Param> _options;
00086 QPtrList<QPtrList<Element> > _elements;
00087
00088 };
00089
00090 #endif
00091
|