]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiLog.h
renaming of some methods that hurt the eyes + removal of:
[lyx.git] / src / frontends / qt4 / GuiLog.h
1 // -*- C++ -*-
2 /**
3  * \file GuiLog.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 GUILOG_H
13 #define GUILOG_H
14
15 #include "GuiDialogView.h"
16 #include "ControlLog.h"
17 #include "ui_LogUi.h"
18
19 #include <QDialog>
20 #include <QSyntaxHighlighter>
21
22 namespace lyx {
23 namespace frontend {
24
25 class GuiLog;
26
27 class GuiLogDialog : public QDialog, public Ui::LogUi {
28         Q_OBJECT
29 public:
30         GuiLogDialog(GuiLog * form);
31 protected Q_SLOTS:
32         virtual void updateClicked();
33 protected:
34         virtual void closeEvent(QCloseEvent * e);
35 private:
36         GuiLog * form_;
37 };
38
39
40 class ControlLog;
41 class LogHighlighter;
42
43 ///
44 class GuiLog : public GuiView<GuiLogDialog>
45 {
46 public:
47         ///
48         friend class GuiLogDialog;
49         ///
50         GuiLog(GuiDialog &);
51         /// parent controller
52         ControlLog & controller()
53         { return static_cast<ControlLog &>(this->getController()); }
54         /// parent controller
55         ControlLog const & controller() const
56         { return static_cast<ControlLog const &>(this->getController()); }
57 private:
58         /// Apply changes
59         virtual void applyView() {}
60         /// update
61         virtual void update_contents();
62         /// build the dialog
63         virtual void build_dialog();
64         /// log syntax highlighter
65         LogHighlighter * highlighter;
66 };
67
68
69 ///
70 class LogHighlighter : public QSyntaxHighlighter
71 {
72 public:
73         LogHighlighter(QTextDocument * parent);
74
75 protected:
76         void highlightBlock(QString const & text);
77
78 private:
79         QTextCharFormat infoFormat;
80         QTextCharFormat warningFormat;
81         QTextCharFormat errorFormat;
82 };
83
84
85 } // namespace frontend
86 } // namespace lyx
87
88 #endif // QLOG_H