#ifndef SCRIPT_COMMON_H
#define SCRIPT_COMMON_H

#include <qcodeedit.h>
#include <QRegularExpression>


class ScriptCommon: public QObject {
	typedef QPair<int, QList<QCodeEdit::ACEntry> > ACSection; // section, ACClass.id -> list of entries
public:
	enum AutoCompletition {
		Keyword,
		Widget,
		Class,
		VariableGlobal,
		VariableLocal,
		VariableProject,
		Constant,
		Block,
		Namespace,
		Property,
		Function,
		Signal,
		Connection,
		Project,
		QtNamespace,
		ScriptPlugin
	};
	static QString includeACName();
	static QList<QCodeEdit::ACEntry> acKeywords  ();
	static QList<QCodeEdit::ACEntry> acFunctions ();
	static QList<QCodeEdit::ACEntry> acObjects   ();
	static QList<QCodeEdit::ACEntry> acNamespaces();
	static QList<QCodeEdit::ACEntry> acMathConst ();
	static QList<QCodeEdit::ACEntry> acMathFunc  ();
	static QList<QCodeEdit::ACEntry> acNumberConst();
	static QList<QCodeEdit::ACEntry> acNumberFunc ();
	static QList<ACSection> aclString ();
	static QList<ACSection> aclArray();
	static QList<ACSection> aclBoolean();
	static QList<ACSection> aclNumber();
	static QRegularExpression includeExpression() {
		return QRegularExpression("(?:^[ \\t]*\\binclude\\b\\(\")([^()]*)(?:\"\\))", QRegularExpression::MultilineOption);
	}
};

#endif // SCRIPT_COMMON_H
