]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiLog.h
If we are in a closeEvent, we don't want to close all buffers, because these may...
[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  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUILOG_H
14 #define GUILOG_H
15
16 #include "GuiDialog.h"
17 #include "ui_LogUi.h"
18
19 #include "support/FileName.h"
20
21
22 namespace lyx {
23 namespace frontend {
24
25 class LogHighlighter;
26
27 class GuiLog : public GuiDialog, public Ui::LogUi
28 {
29         Q_OBJECT
30
31 public:
32         GuiLog(GuiView & lv);
33
34 private Q_SLOTS:
35         void updateContents();
36         /// copy log to clipboard
37         void on_copyPB_clicked();
38         /// find content
39         void find();
40         /// jump to next error message
41         void on_nextErrorPB_clicked();
42         /// jump to next warning
43         void on_nextWarningPB_clicked();
44
45 private:
46         /// Apply changes
47         void applyView() {}
48
49         /// log syntax highlighter
50         LogHighlighter * highlighter;
51
52         /** \param data should contain "<logtype> <logfile>"
53          *  where <logtype> is one of "latex", "literate", "lyx2lyx", "vc".
54          */
55         bool initialiseParams(std::string const & data);
56         ///
57         void clearParams();
58         ///
59         void dispatchParams() {}
60         ///
61         bool isBufferDependent() const { return true; }
62
63         /// The title displayed by the dialog reflects the \c LogType
64         docstring title() const;
65         /// put the log file into the ostream
66         void getContents(std::ostream & ss) const;
67         /// go to the next occurence of the RegExp
68         void goTo(QRegExp const & exp) const;
69         /// does the document after cursor position contain the RegExp?
70         bool contains(QRegExp const & exp) const;
71
72 private:
73         /// Recognized log file-types
74         enum LogType {
75                 LatexLog,
76                 LiterateLog,
77                 Lyx2lyxLog,
78                 VCLog
79         };
80
81         LogType type_;
82         support::FileName logfile_;
83 };
84
85
86 } // namespace frontend
87 } // namespace lyx
88
89 #endif // GUILOG_H