Logo Search packages:      
Sourcecode: cantor version File versions  Download package

session.cpp

/*
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA  02110-1301, USA.

    ---
    Copyright (C) 2009 Alexander Rieder <alexanderrieder@gmail.com>
 */

#include "session.h"
using namespace Cantor;

#include "backend.h"

00026 class Cantor::SessionPrivate
{
  public:
    SessionPrivate()
    {
        backend=0;
        expressionCount=0;
        typesettingEnabled=false;
    }

    Backend* backend;
    Session::Status status;
    bool typesettingEnabled;
    int expressionCount;
};

00042 Session::Session( Backend* backend ) : QObject(backend),
                                       d(new SessionPrivate)
{
    d->backend=backend;
}

00048 Session::~Session()
{
    delete d;
}

00053 Expression* Session::evaluateExpression(const QString& command)
{
    return evaluateExpression(command, Expression::DoNotDelete);
}

00058 Backend* Session::backend()
{
    return d->backend;
}

00063 Cantor::Session::Status Session::status()
{
    return d->status;
}

00068 void Session::changeStatus(Session::Status newStatus)
{
    d->status=newStatus;
    emit statusChanged(newStatus);
}

00074 void Session::setTypesettingEnabled(bool enable)
{
    d->typesettingEnabled=enable;
}

00079 bool Session::isTypesettingEnabled()
{
    return d->typesettingEnabled;
}

00084 CompletionObject* Session::completionFor(const QString& cmd)
{
    Q_UNUSED(cmd);
    //Return 0 per default, so Backends not offering tab completions don't have
    //to reimplement this. This method should only be called on backends with
    //the Completion Capability flag

    return 0;
}

00094 SyntaxHelpObject* Session::syntaxHelpFor(const QString& cmd)
{
    Q_UNUSED(cmd);

    //Return 0 per default, so Backends not offering tab completions don't have
    //to reimplement this. This method should only be called on backends with
    //the SyntaxHelp Capability flag
    return 0;
}

00104 QSyntaxHighlighter* Session::syntaxHighlighter(QTextEdit* parent)
{
    Q_UNUSED(parent);
    return 0;
}

00110 QAbstractItemModel* Session::variableModel()
{
    //Return 0 per default, so Backends not offering variable management don't
    //have to reimplement this. This method should only be called on backends with
    //VariableManagement Capability flag
    return 0;
}

00118 int Session::nextExpressionId()
{
    return d->expressionCount++;
}

#include "session.moc"


Generated by  Doxygen 1.6.0   Back to index