]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLog.h
Fix unreported bug related to 3246 by Richard Heck:
[lyx.git] / src / frontends / qt4 / QLog.h
1 // -*- C++ -*-
2 /**
3  * \file QLog.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QLOG_H
13 #define QLOG_H
14
15 #include "QDialogView.h"
16 #include "QLogDialog.h"
17
18 #include <QSyntaxHighlighter>
19
20 namespace lyx {
21 namespace frontend {
22
23 class ControlLog;
24 class logHighlighter;
25
26 ///
27 class QLog
28         : public QController<ControlLog, QView<QLogDialog> >
29 {
30 public:
31         ///
32         friend class QLogDialog;
33         ///
34         QLog(Dialog &);
35 private:
36         /// Apply changes
37         virtual void apply() {}
38         /// update
39         virtual void update_contents();
40         /// build the dialog
41         virtual void build_dialog();
42         /// log syntax highlighter
43         logHighlighter * highlighter;
44
45 };
46
47
48 ///
49 class logHighlighter : public QSyntaxHighlighter
50 {
51         Q_OBJECT
52         
53 public:
54         logHighlighter(QTextDocument * parent);
55
56 protected:
57         void highlightBlock(QString const & text);
58
59 private:
60         QTextCharFormat infoFormat;
61         QTextCharFormat warningFormat;
62         QTextCharFormat errorFormat;
63 };
64
65
66 } // namespace frontend
67 } // namespace lyx
68
69 #endif // QLOG_H