X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fcommand.h;fp=src%2Fcommand.h;h=2ff7ba72cd56834922f004999fda7cee80c2d400;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/command.h b/src/command.h new file mode 100644 index 0000000..2ff7ba7 --- /dev/null +++ b/src/command.h @@ -0,0 +1,49 @@ +#ifndef COMMAND_H +#define COMMAND_H + +#include +#include + +class Command { + public: + enum SelectionType { + Any, + TreeItem, + Branch, + BranchLike, + Image, + BranchOrImage, + XLink + }; + enum ParameterType { + Undefined, + String, + Int, + Double, + Color, + Bool, + Void}; + + Command(const QString &n, SelectionType st, ParameterType retType = Void); + QString getName(); + QString getDescription(); + QString getDescriptionLaTeX(); + void addPar(ParameterType t, bool opt, const QString &c = QString()); + int parCount(); + ParameterType getParType(int n); + SelectionType getSelectionType(); + QString getSelectionTypeName(); + QString typeToString(const ParameterType &type); + bool isParOptional(int n); + QString getParComment(int n); + + private: + QString name; + SelectionType selectionType; + QList parTypes; + ParameterType returnType; + QList parOpts; + QStringList parComments; +}; + +#endif