cantor/src/lib
#include <session.h>

Public Types | |
enum | Status { Running, Done } |
Signals | |
void | error (const QString &msg) |
void | ready () |
void | statusChanged (Cantor::Session::Status newStatus) |
Public Member Functions | |
Session (Backend *backend) | |
~Session () | |
Backend * | backend () |
virtual CompletionObject * | completionFor (const QString &cmd, int index=-1) |
virtual Expression * | evaluateExpression (const QString &command, Expression::FinishingBehavior finishingBehavior)=0 |
Expression * | evaluateExpression (const QString &command) |
virtual void | interrupt ()=0 |
bool | isTypesettingEnabled () |
virtual void | login ()=0 |
virtual void | logout ()=0 |
int | nextExpressionId () |
virtual void | setTypesettingEnabled (bool enable) |
Cantor::Session::Status | status () |
virtual SyntaxHelpObject * | syntaxHelpFor (const QString &cmd) |
virtual QSyntaxHighlighter * | syntaxHighlighter (QObject *parent) |
virtual QAbstractItemModel * | variableModel () |
Protected Member Functions | |
void | changeStatus (Cantor::Session::Status newStatus) |
Detailed Description
The Session object is the main class used to interact with a Backend.
It is used to evaluate Expressions, get completions, syntax highlighting, etc.
Member Enumeration Documentation
Constructor & Destructor Documentation
Session::Session | ( | Backend * | backend | ) |
Create a new Session.
This should not yet set up the complete session, thats job of the login() function
- See also
- login()
Definition at line 42 of file session.cpp.
Session::~Session | ( | ) |
Destructor.
Definition at line 48 of file session.cpp.
Member Function Documentation
Backend * Session::backend | ( | ) |
|
protected |
Change the status of the Session.
This will cause the stausChanged signal to be emited
- Parameters
-
newStatus the new status of the session
Definition at line 68 of file session.cpp.
|
virtual |
Returns tab-completion, for this command/command-part.
The return type is a CompletionObject. The fetching of the completions works asynchronously, you'll have to listen to the done() Signal of the returned object
- Parameters
-
cmd The partial command that should be completed index The index (cursor position) at which completion was invoked. Defaults to -1, indicating the end of the string.
- Returns
- a Completion object, representing this completion
- See also
- CompletionObject
Definition at line 84 of file session.cpp.
|
signal |
|
pure virtual |
Passes the given command to the backend and returns a Pointer to a new Expression object, which will emit the resultArrived() signal as soon as the computation is done.
The result will then be acessible by Expression::result()
- Parameters
-
command the command that should be run by the backend. finishingBehavior the FinishingBehaviour that should be used for this command.
- See also
- Expression::FinishingBehaviour
- Returns
- an Expression object, representing this command
Expression * Session::evaluateExpression | ( | const QString & | command | ) |
Reimplements evaluateExpression, setting the finishingBehaviour to DoNotDelete.
- See also
- evaluateExpressionconst(QString& command, Expression::FinishingBehavior finishingBehavior)
Definition at line 53 of file session.cpp.
|
pure virtual |
Interrupts all the running calculations in this session.
bool Session::isTypesettingEnabled | ( | ) |
Returns wether typesetting is enabled or not.
- Returns
- wether typesetting is enabled or not
Definition at line 79 of file session.cpp.
|
pure virtual |
|
pure virtual |
int Session::nextExpressionId | ( | ) |
Returns the next available Expression id It is basically a counter, incremented for each new Expression.
- Returns
- next Expression id
Definition at line 119 of file session.cpp.
|
signal |
|
virtual |
Enables/disables Typesetting for this session.
For this setting to make effect, the Backend must support LaTeX typesetting (as indicated by the capabilities() flag.
- Parameters
-
enable true to enable, false to disable typesetting
Definition at line 74 of file session.cpp.
Cantor::Session::Status Session::status | ( | ) |
Returns the status this Session has.
- Returns
- the status this Session has
Definition at line 63 of file session.cpp.
|
signal |
|
virtual |
Returns Syntax help, for this command.
It returns a SyntaxHelpObject, that will fetch the needed information asynchroneousely. You need to listen to the done() Signal of the Object
- Parameters
-
cmd the command, syntax help is requested for
- Returns
- SyntaxHelpObject, representing the help request
- See also
- SyntaxHelpObject
Definition at line 95 of file session.cpp.
|
virtual |
returns a syntax highlighter for this session
- Parameters
-
parent QObject the Highlighter's parent
- Returns
- QSyntaxHighlighter doing the highlighting for this Session
Definition at line 105 of file session.cpp.
|
virtual |
returns a Model to interact with the variables
- Returns
- QAbstractItemModel to interact with the variables
Definition at line 111 of file session.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.