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

lokalize

  • sources
  • kde-4.12
  • kdesdk
  • lokalize
  • src
syntaxhighlighter.h
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of Lokalize
3 
4  Copyright (C) 2007-2009 by Nick Shaforostoff <shafff@ukr.net>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation; either version 2 of
9  the License or (at your option) version 3 or any later version
10  accepted by the membership of KDE e.V. (or its successor approved
11  by the membership of KDE e.V.), which shall act as a proxy
12  defined in Section 14 of version 3 of the license.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 **************************************************************************** */
23 
24 #ifndef HIGHLIGHTER_H
25 #define HIGHLIGHTER_H
26 
27 #include <QSyntaxHighlighter>
28 #include <sonnet/highlighter.h>
29 #include <kcolorscheme.h>
30 
31 #include <QHash>
32 #include <QTextCharFormat>
33 
34 
35 class QTextDocument;
36 
37 class SyntaxHighlighter : public Sonnet::Highlighter
38 {
39  Q_OBJECT
40 
41 public:
42  explicit SyntaxHighlighter(QTextEdit *parent);
43  ~SyntaxHighlighter(){};
44 
45  void setApprovementState(bool a){m_approved=a;};
46  void setSourceString(const QString& s){m_sourceString=s;}
47 
48 protected:
49  void highlightBlock(const QString &text);
50 
51  void setMisspelled(int start, int count);
52  void unsetMisspelled(int start, int count);
53 
54 private slots:
55  void settingsChanged();
56 
57 // void setFormatRetainingUnderlines(int start, int count, QTextCharFormat format);
58 private:
59  struct HighlightingRule
60  {
61  QRegExp pattern;
62  QTextCharFormat format;
63  };
64  QVector<HighlightingRule> highlightingRules;
65 
66 // bool fromDocbook;
67  QTextCharFormat tagFormat;
68  KStatefulBrush tagBrush;
69  bool m_approved;
70  QString m_sourceString;
71 };
72 
73 #endif
SyntaxHighlighter::setApprovementState
void setApprovementState(bool a)
Definition: syntaxhighlighter.h:45
SyntaxHighlighter::SyntaxHighlighter
SyntaxHighlighter(QTextEdit *parent)
Definition: syntaxhighlighter.cpp:43
SyntaxHighlighter::highlightBlock
void highlightBlock(const QString &text)
Definition: syntaxhighlighter.cpp:133
SyntaxHighlighter::setMisspelled
void setMisspelled(int start, int count)
Definition: syntaxhighlighter.cpp:210
SyntaxHighlighter
Definition: syntaxhighlighter.h:37
SyntaxHighlighter::unsetMisspelled
void unsetMisspelled(int start, int count)
Definition: syntaxhighlighter.cpp:272
SyntaxHighlighter::~SyntaxHighlighter
~SyntaxHighlighter()
Definition: syntaxhighlighter.h:43
SyntaxHighlighter::setSourceString
void setSourceString(const QString &s)
Definition: syntaxhighlighter.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:03:45 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

lokalize

Skip menu "lokalize"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

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