/ src / function.h
function.h
 1  #ifndef NEOVIM_QT_FUNCTIONS
 2  #define NEOVIM_QT_FUNCTIONS
 3  
 4  #include <QtGlobal>
 5  #include <QByteArray>
 6  #include <QList>
 7  #include <QPair>
 8  #include <QDebug>
 9  #include <QStringList>
10  #include <QPoint>
11  
12  namespace NeovimQt {
13  
14  class Function {
15  public:
16  
17  	Function();
18  	Function(const QString& ret, const QString& name, QList<QPair<QString,QString> > params, bool can_fail);
19  	Function(const QString& ret, const QString& name, QList<QString> paramTypes, bool can_fail);
20  	bool isValid() const;
21  	bool operator==(const Function& other) const;
22  	static Function fromVariant(const QVariant&);
23  	static QList<QPair<QString,QString> > parseParameters(const QVariantList& obj);
24  
25  	/** Whether this function call fail without returning*/
26  	bool can_fail;
27  	/** Function return type */
28  	QString return_type;
29  	/** Function name */
30  	QString name;
31  	/** Function parameter types and name */
32  	QList<QPair<QString,QString> > parameters;
33  
34  	QString signature() const;
35  	/**
36  	 * The static list **knowFunctions** holds a list of all the supported
37  	 * signature. The list is populated at compile time from a code generator.
38  	 */
39  	const static QList<Function> knownFunctions;
40  private:
41  	bool m_valid;
42  };
43  
44  }
45  
46  #endif // NEOVIM_QT_FUNCTIONS