]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QLog.h
* src/frontends/qt4/ui/TextLayoutUi.ui:
[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
17
18 #include "ui/LogUi.h"
19
20 #include <QDialog>
21 #include <QCloseEvent>
22 #include <QSyntaxHighlighter>
23
24 namespace lyx {
25 namespace frontend {
26
27 class QLog;
28
29 class QLogDialog : public QDialog, public Ui::QLogUi {
30         Q_OBJECT
31 public:
32         QLogDialog(QLog * form);
33 protected Q_SLOTS:
34         virtual void updateClicked();
35 protected:
36         virtual void closeEvent(QCloseEvent * e);
37 private:
38         QLog * form_;
39 };
40
41
42 class ControlLog;
43 class LogHighlighter;
44
45 ///
46 class QLog
47         : public QController<ControlLog, QView<QLogDialog> >
48 {
49 public:
50         ///
51         friend class QLogDialog;
52         ///
53         QLog(Dialog &);
54 private:
55         /// Apply changes
56         virtual void apply() {}
57         /// update
58         virtual void update_contents();
59         /// build the dialog
60         virtual void build_dialog();
61         /// log syntax highlighter
62         LogHighlighter * highlighter;
63 };
64
65
66 ///
67 class LogHighlighter : public QSyntaxHighlighter
68 {
69 public:
70         LogHighlighter(QTextDocument * parent);
71
72 protected:
73         void highlightBlock(QString const & text);
74
75 private:
76         QTextCharFormat infoFormat;
77         QTextCharFormat warningFormat;
78         QTextCharFormat errorFormat;
79 };
80
81
82 } // namespace frontend
83 } // namespace lyx
84
85 #endif // QLOG_H