• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

cantor/src/lib

  • Cantor
  • Session
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
Cantor::Session Class Referenceabstract

#include <session.h>

Inheritance diagram for Cantor::Session:
Inheritance graph
[legend]

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 ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Protected Member Functions

void changeStatus (Cantor::Session::Status newStatus)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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.

Author
Alexander Rieder

Definition at line 50 of file session.h.

Member Enumeration Documentation

enum Cantor::Session::Status
Enumerator
Running 

the session is busy, running some expression

Done 

the session has done all the jobs, and is now waiting for more

Definition at line 54 of file session.h.

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 ( )

Returns the Backend, this Session is for.

Returns
the Backend, this Session is for

Definition at line 58 of file session.cpp.

void Session::changeStatus ( Cantor::Session::Status  newStatus)
protected

Change the status of the Session.

This will cause the stausChanged signal to be emited

Parameters
newStatusthe new status of the session

Definition at line 68 of file session.cpp.

CompletionObject * Session::completionFor ( const QString &  cmd,
int  index = -1 
)
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
cmdThe partial command that should be completed
indexThe 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.

void Cantor::Session::error ( const QString &  msg)
signal
virtual Expression* Cantor::Session::evaluateExpression ( const QString &  command,
Expression::FinishingBehavior  finishingBehavior 
)
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
commandthe command that should be run by the backend.
finishingBehaviorthe 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.

virtual void Cantor::Session::interrupt ( )
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.

virtual void Cantor::Session::login ( )
pure virtual

Login to the Session.

In this function you should do anything needed to set up the session, and make it ready for usage. The method should be implemented non blocking. If the loging in is completed, the ready() signal must be emitted

virtual void Cantor::Session::logout ( )
pure virtual

Log out of the Session.

Destroy everything specific to a single session, e.g. stop all the running processes etc. NOTE: restaring the session consists of first logout() and then login()

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.

void Cantor::Session::ready ( )
signal
void Session::setTypesettingEnabled ( bool  enable)
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
enabletrue 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.

void Cantor::Session::statusChanged ( Cantor::Session::Status  newStatus)
signal
SyntaxHelpObject * Session::syntaxHelpFor ( const QString &  cmd)
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
cmdthe command, syntax help is requested for
Returns
SyntaxHelpObject, representing the help request
See also
SyntaxHelpObject

Definition at line 95 of file session.cpp.

QSyntaxHighlighter * Session::syntaxHighlighter ( QObject *  parent)
virtual

returns a syntax highlighter for this session

Parameters
parentQObject the Highlighter's parent
Returns
QSyntaxHighlighter doing the highlighting for this Session

Definition at line 105 of file session.cpp.

QAbstractItemModel * Session::variableModel ( )
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:
  • session.h
  • session.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

cantor/src/lib

Skip menu "cantor/src/lib"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal