]> git.sven.stormbind.net Git - sven/vym.git/blob - src/command.h
New upstream version 2.9.22
[sven/vym.git] / src / command.h
1 #ifndef COMMAND_H
2 #define COMMAND_H
3
4 #include <QColor>
5 #include <QStringList>
6
7 class Command {
8   public:
9     enum SelectionType {
10         Any,
11         TreeItem,
12         Branch,
13         BranchLike,
14         Image,
15         BranchOrImage,
16         XLink
17     };
18     enum ParameterType {
19         Undefined,
20         String,
21         Int,
22         Double,
23         Color,
24         Bool,
25         Void};
26
27     Command(const QString &n, SelectionType st, ParameterType retType = Void);
28     QString getName();
29     QString getDescription();
30     QString getDescriptionLaTeX();
31     void addPar(ParameterType t, bool opt, const QString &c = QString());
32     int parCount();
33     ParameterType getParType(int n);
34     SelectionType getSelectionType();
35     QString getSelectionTypeName();
36     QString typeToString(const ParameterType &type);
37     bool isParOptional(int n);
38     QString getParComment(int n);
39
40   private:
41     QString name;
42     SelectionType selectionType;
43     QList<ParameterType> parTypes;
44     ParameterType returnType;
45     QList<bool> parOpts;
46     QStringList parComments;
47 };
48
49 #endif