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

Analitza

  • sources
  • kde-4.12
  • kdeedu
  • analitza
  • analitzagui
algebrahighlighter.h
Go to the documentation of this file.
1 /*************************************************************************************
2  * Copyright (C) 2007 by Aleix Pol <aleixpol@kde.org> *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License *
6  * as published by the Free Software Foundation; either version 2 *
7  * of the License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the Free Software *
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
17  *************************************************************************************/
18 
19 #ifndef ALGEBRAHIGHLIGHTER_H
20 #define ALGEBRAHIGHLIGHTER_H
21 
22 #include <QSyntaxHighlighter>
23 #include "analitzaguiexport.h"
24 
30 namespace Analitza { class Analyzer; }
31 
32 class ANALITZAGUI_EXPORT AlgebraHighlighter : public QSyntaxHighlighter
33 {
34  public:
36  typedef enum {
37  Expression,
38  MathML,
39  Autodetect
40  } Mode;
41 
43  explicit AlgebraHighlighter(QTextDocument *doc, const Analitza::Analyzer* na=0);
44  //int highlightParagraph(const QString &text, int endStateOfLastPara);
45 
47  Mode mode() { return m_mode; }
48 
50  void setMode(const Mode& newMode){ m_mode=newMode; rehighlight(); }
51 
57  bool isCorrect() const { return m_correct; }
58 
60  void setPos(uint p) { m_pos=p; }
61 
63  void setAnalitza(const Analitza::Analyzer* na) { a = na; }
64 
66  QString editingName() const;
67 
69  int editingParameter() const;
70  bool editingBounds() const;
71  private:
72  void highlightBlock(const QString &text);
73 
74  enum MMLtokEnum { //For mathml highlighting
75  gt,
76  lt,
77  tag,
78  value
79  };
80 
81  bool m_correct;
82  int antnum;
83  Mode m_mode;
84  uint m_pos;
85  int m_editingParameter;
86  QString m_editingName;
87  bool m_editingBounds;
88  QString m_aName;
89 
90  QTextCharFormat bold;
91  const Analitza::Analyzer* a;
92 };
93 
94 #endif
AlgebraHighlighter::Mode
Mode
Defines the format status that could be used.
Definition: algebrahighlighter.h:36
AlgebraHighlighter::mode
Mode mode()
Returns the currently highlight mode.
Definition: algebrahighlighter.h:47
AlgebraHighlighter::Expression
String expression format.
Definition: algebrahighlighter.h:37
analitzaguiexport.h
AlgebraHighlighter::MathML
MathML format.
Definition: algebrahighlighter.h:38
ANALITZAGUI_EXPORT
#define ANALITZAGUI_EXPORT
Definition: analitzaguiexport.h:28
AlgebraHighlighter::isCorrect
bool isCorrect() const
Returns whether something wrong has been found.
Definition: algebrahighlighter.h:57
AlgebraHighlighter
Definition: algebrahighlighter.h:32
QSyntaxHighlighter
AlgebraHighlighter::setMode
void setMode(const Mode &newMode)
Sets the highlight mode.
Definition: algebrahighlighter.h:50
AlgebraHighlighter::setPos
void setPos(uint p)
Sets the cursor position.
Definition: algebrahighlighter.h:60
AlgebraHighlighter::setAnalitza
void setAnalitza(const Analitza::Analyzer *na)
Sets the corresponding Analitza class.
Definition: algebrahighlighter.h:63
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Analitza

Skip menu "Analitza"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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