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

cantor/src/lib

  • sources
  • kde-4.14
  • kdeedu
  • cantor
  • src
  • lib
expression.h
Go to the documentation of this file.
1 /*
2  This program is free software; you can redistribute it and/or
3  modify it under the terms of the GNU General Public License
4  as published by the Free Software Foundation; either version 2
5  of the License, or (at your option) any later version.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin Street, Fifth Floor,
15  Boston, MA 02110-1301, USA.
16 
17  ---
18  Copyright (C) 2009 Alexander Rieder <alexanderrieder@gmail.com>
19  */
20 
21 #ifndef _EXPRESSION_H
22 #define _EXPRESSION_H
23 
24 #include <QObject>
25 #include <QDomElement>
26 
27 #include "cantor_export.h"
28 
29 class KZip;
30 
34 namespace Cantor
35 {
36 class Session;
37 class Result;
38 class ExpressionPrivate;
39 
49 class CANTOR_EXPORT Expression : public QObject
50 {
51  Q_OBJECT
52  public:
53  enum Status{ Computing,
54  Done,
55  Error,
56  Interrupted
57  };
58 
62  enum FinishingBehavior {
63  DoNotDelete,
64  DeleteOnFinish
67  };
72  Expression( Session* session );
76  virtual ~Expression();
77 
84  virtual void evaluate() = 0;
89  virtual void interrupt() = 0;
90 
95  int id();
96 
101  void setId(int id);
102 
107  void setFinishingBehavior(FinishingBehavior behavior);
108 
113  FinishingBehavior finishingBehavior();
114 
119  void setCommand( const QString& cmd );
120 
125  QString command();
126 
134  virtual void addInformation(const QString& information);
135 
141  void setErrorMessage( const QString& cmd);
142 
148  QString errorMessage();
149 
159  Result* result();
160 
165  void clearResult();
166 
171  Status status();
172 
176  Session* session();
177 
184  QDomElement toXml(QDomDocument& doc);
191  void saveAdditionalData(KZip* archive);
192 
197  bool isInternal();
202  void setInternal(bool internal);
203 
204  Q_SIGNALS:
208  void idChanged();
212  void gotResult();
217  void statusChanged(Cantor::Expression::Status status);
223  void needsAdditionalInformation(const QString& question);
224 
225  //These are protected, because only subclasses will handle results/status changes
226  protected:
235  void setResult(Result* result);
241  void setStatus(Status status);
242 
243  protected:
244  //returns a string of latex commands, that is inserted into the header.
245  //used for example if special packages are needed
246  virtual QString additionalLatexHeaders();
247  private:
248  void renderResultAsLatex();
249  private Q_SLOTS:
250  void latexRendered();
251 
252  private:
253  ExpressionPrivate* d;
254 };
255 
256 }
257 #endif /* _EXPRESSION_H */
CANTOR_EXPORT
#define CANTOR_EXPORT
Definition: cantor_export.h:33
Cantor::Expression::Status
Status
Definition: expression.h:53
Cantor::Result
Base class for different results, like text, image, animation.
Definition: result.h:39
Cantor::Expression::FinishingBehavior
FinishingBehavior
Enum indicating how this Expression behaves on finishing.
Definition: expression.h:62
Cantor::Expression
An Expression object is used, to store the information needed when running a command of a Session Eva...
Definition: expression.h:49
Cantor::Expression::Error
An Error occurred when running the Expression.
Definition: expression.h:55
QObject
QString
Cantor::Expression::DoNotDelete
This Expression will not be deleted. This is the normal behaviour.
Definition: expression.h:63
QDomDocument
Cantor::Expression::Done
The Running of the Expression is finished sucessfully.
Definition: expression.h:54
QDomElement
cantor_export.h
Cantor::Session
The Session object is the main class used to interact with a Backend.
Definition: session.h:50
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