]> git.sven.stormbind.net Git - sven/vym.git/blobdiff - src/command.h
New upstream version 2.9.22
[sven/vym.git] / src / command.h
diff --git a/src/command.h b/src/command.h
new file mode 100644 (file)
index 0000000..2ff7ba7
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef COMMAND_H
+#define COMMAND_H
+
+#include <QColor>
+#include <QStringList>
+
+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<ParameterType> parTypes;
+    ParameterType returnType;
+    QList<bool> parOpts;
+    QStringList parComments;
+};
+
+#endif