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