39 #ifndef AUTOCOMPLETIONDATABASE_H_
40 #define AUTOCOMPLETIONDATABASE_H_
46 #include <tulip/Graph.h>
47 #include <tulip/APIDataBase.h>
51 class TLP_PYTHON_SCOPE AutoCompletionDataBase {
53 QSet<QString> getSubGraphsListIfContext(
const QString &context,
const QString &editedFunction)
const ;
54 QSet<QString> getGraphPropertiesListIfContext(
const QString &context,
const QString &editedFunction)
const ;
55 QSet<QString> getPluginParametersListIfContext(
const QString &context,
const QString &editedFunction)
const;
56 QString getClassAttributeType(
const QString &className,
const QString &classAttribute)
const;
60 QSet<QString> _globalAutoCompletionList;
61 QHash<QString, QSet<QString> > _functionAutoCompletionList;
62 QHash<QString, QHash<QString, QString> > _varToType;
63 QHash<QString, QHash<QString, QString> > _classAttributeToType;
64 QHash<QString, QHash<QString, QString> > _varToPluginName;
65 QHash<QString, QHash<QString, QSet<QString> > > _pluginParametersDataSet;
66 QHash<QString, QString> _iteratorType;
67 QHash<QString, QSet<QString> > _classContents;
68 QHash<QString, QSet<QString> > _classBases;
69 QString _lastFoundType;
73 AutoCompletionDataBase(APIDataBase *_apiDb = NULL);
79 void analyseCurrentScriptCode(
const QString &code,
const int currentLine,
const bool interactiveSession=
false,
const QString &moduleName=
"");
81 QSet<QString> getAutoCompletionListForContext(
const QString &context,
const QString &editedFunction,
bool dotContext=
false);
83 QString getLastFoundType()
const {
84 return _lastFoundType;
87 QString findTypeForExpr(
const QString &expr,
const QString &funcName)
const ;
89 QVector<QVector<QString> > getParamTypesForMethodOrFunction(
const QString &type,
const QString &funcName)
const;
91 QString getReturnTypeForMethodOrFunction(
const QString &type,
const QString &funcName)
const;
93 QSet<QString> getAllDictForType(
const QString &type,
const QString &prefix,
const bool root=
true)
const;
95 QString getTypeNameForVar(
const QString &varName)
const;
97 QString getTypeNameForExpr(
const QString &varName)
const;