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 	/// find content
37 	void find();
38 	/// jump to next error message
39 	void on_nextErrorPB_clicked();
40 	/// jump to next warning
41 	void on_nextWarningPB_clicked();
42 	/// open containing directory
43 	void on_openDirPB_clicked();
44 	/// Log type changed
45 	void typeChanged(int);
46 
47 private:
48 	/// Apply changes
applyView()49 	void applyView() {}
50 
51 	/// log syntax highlighter
52 	LogHighlighter * highlighter;
53 
54 	/** \param data should contain "<logtype> <logfile>"
55 	 *  where <logtype> is one of "latex", "literate", "lyx2lyx", "vc".
56 	 */
57 	bool initialiseParams(std::string const & data);
58 	///
59 	void clearParams();
60 	///
dispatchParams()61 	void dispatchParams() {}
62 	///
isBufferDependent()63 	bool isBufferDependent() const { return true; }
64 
65 	/// The title displayed by the dialog reflects the \c LogType
66 	docstring title() const;
67 	/// put the log file into the ostream
68 	void getContents(std::ostream & ss) const;
69 	/// go to the next occurence of the RegExp
70 	void goTo(QRegExp const & exp) const;
71 	/// does the document after cursor position contain the RegExp?
72 	bool contains(QRegExp const & exp) const;
73 
74 private:
75 	/// Recognized log file-types
76 	enum LogType {
77 		LatexLog,
78 		LiterateLog,
79 		Lyx2lyxLog,
80 		VCLog
81 	};
82 
83 	LogType type_;
84 	support::FileName logfile_;
85 };
86 
87 
88 } // namespace frontend
89 } // namespace lyx
90 
91 #endif // GUILOG_H
92