Changeset View
Changeset View
Standalone View
Standalone View
src/backends/R/rsession.h
Show All 24 Lines | |||||
25 | #include <QStringList> | 25 | #include <QStringList> | ||
26 | 26 | | |||
27 | #include "session.h" | 27 | #include "session.h" | ||
28 | #include "rserver_interface.h" | 28 | #include "rserver_interface.h" | ||
29 | 29 | | |||
30 | class RExpression; | 30 | class RExpression; | ||
31 | class QProcess; | 31 | class QProcess; | ||
32 | 32 | | |||
33 | namespace Cantor { | ||||
34 | class DefaultVariableModel; | ||||
35 | } | ||||
36 | | ||||
33 | class RSession : public Cantor::Session | 37 | class RSession : public Cantor::Session | ||
34 | { | 38 | { | ||
35 | Q_OBJECT | 39 | Q_OBJECT | ||
36 | public: | 40 | public: | ||
37 | RSession( Cantor::Backend* backend); | 41 | RSession( Cantor::Backend* backend); | ||
38 | ~RSession(); | 42 | ~RSession(); | ||
39 | 43 | | |||
40 | void login() override; | 44 | void login() override; | ||
41 | void logout() override; | 45 | void logout() override; | ||
42 | 46 | | |||
43 | void interrupt() override; | 47 | void interrupt() override; | ||
44 | 48 | | |||
45 | Cantor::Expression* evaluateExpression(const QString& command, Cantor::Expression::FinishingBehavior behave) override; | 49 | Cantor::Expression* evaluateExpression(const QString& command, Cantor::Expression::FinishingBehavior behave) override; | ||
46 | Cantor::CompletionObject* completionFor(const QString& command, int index=-1) override; | 50 | Cantor::CompletionObject* completionFor(const QString& command, int index=-1) override; | ||
47 | QSyntaxHighlighter* syntaxHighlighter(QObject* parent) override; | 51 | QSyntaxHighlighter* syntaxHighlighter(QObject* parent) override; | ||
52 | QAbstractItemModel* variableModel() Q_DECL_OVERRIDE; | ||||
48 | 53 | | |||
49 | void queueExpression(RExpression* expr); | 54 | void queueExpression(RExpression* expr); | ||
50 | void sendInputToServer(const QString& input); | 55 | void sendInputToServer(const QString& input); | ||
51 | 56 | | |||
52 | protected Q_SLOTS: | 57 | protected Q_SLOTS: | ||
53 | void serverChangedStatus(int status); | 58 | void serverChangedStatus(int status); | ||
54 | void runNextExpression(); | 59 | void runNextExpression(); | ||
55 | void receiveSymbols(const QStringList& v, const QStringList & f); | 60 | void receiveSymbols(const QStringList& vars, const QStringList& values, const QStringList & funcs); | ||
56 | void fillSyntaxRegExps(QVector<QRegExp>& v, QVector<QRegExp>& f); | 61 | void fillSyntaxRegExps(QVector<QRegExp>& v, QVector<QRegExp>& f); | ||
57 | 62 | | |||
58 | Q_SIGNALS: | 63 | Q_SIGNALS: | ||
59 | void symbolsChanged(); | 64 | void symbolsChanged(); | ||
60 | 65 | | |||
61 | private: | 66 | private: | ||
62 | QProcess* m_process; | 67 | QProcess* m_process; | ||
63 | org::kde::Cantor::R* m_rServer; | 68 | org::kde::Cantor::R* m_rServer; | ||
64 | QList<RExpression*> m_expressionQueue; | 69 | QList<RExpression*> m_expressionQueue; | ||
65 | 70 | | |||
66 | /* Available variables and functions, TODO make full classes and type info */ | 71 | /* Available variables and functions, TODO make full classes and type info */ | ||
72 | Cantor::DefaultVariableModel* m_variableModel; | ||||
67 | QStringList m_variables; | 73 | QStringList m_variables; | ||
68 | QStringList m_functions; | 74 | QStringList m_functions; | ||
69 | }; | 75 | }; | ||
70 | 76 | | |||
71 | #endif /* _RSESSION_H */ | 77 | #endif /* _RSESSION_H */ |