]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiProgress.h
Header cleanup cont.
[lyx.git] / src / frontends / qt4 / GuiProgress.h
1 // -*- C++ -*-
2 /**
3  * \file GuiProgress.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Peter Kümmel
8  * \author Pavel Sanda
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUIPROGRESS_H
14 #define GUIPROGRESS_H
15
16 #include "support/ProgressInterface.h"
17
18 #include <QTimer>
19
20 #include <sstream>
21
22
23 namespace lyx {
24 namespace frontend {
25
26
27 class GuiProgress :
28                 public QObject,
29                 public lyx::support::ProgressInterface
30 {
31         Q_OBJECT
32
33 public:
34         GuiProgress();
35         ~GuiProgress();
36
37         void lyxerrConnect();
38         void lyxerrDisconnect();
39         void lyxerrFlush();
40
41         int prompt(docstring const & title, docstring const & question,
42                    int default_button, int cancel_button,
43                    docstring const & b1, docstring const & b2);
44
45         static QString currentTime();
46
47 Q_SIGNALS:
48
49         // ProgressInterface
50         void processStarted(QString const &);
51         void processFinished(QString const &);
52         void appendMessage(QString const &);
53         void appendError(QString const &);
54         void clearMessages();
55         void appendLyXErrMessage(QString const & text);
56
57
58         void clearMessageText();
59         void updateStatusBarMessage(QString const &);
60         void triggerFlush();
61
62         // Alert interface
63         void warning(QString const & title, QString const & message);
64         void toggleWarning(QString const & title, QString const & msg, QString const & formatted);
65         void error(QString const & title, QString const & message);
66         void information(QString const & title, QString const & message);
67
68 private Q_SLOTS:
69         void doProcessStarted(QString const &);
70         void doProcessFinished(QString const &);
71         void doAppendMessage(QString const &);
72         void doAppendError(QString const &);
73         void doClearMessages();
74
75         void doWarning(QString const &, QString const &);
76         void doToggleWarning(QString const & title, QString const & msg, QString const & formatted);
77         void doError(QString const &, QString const &);
78         void doInformation(QString const &, QString const &);
79
80         void updateWithLyXErr();
81         void startFlushing();
82
83
84 private:
85         void appendText(QString const &);
86         std::ostringstream lyxerr_stream_;
87         QTimer flushDelay_;
88 };
89
90
91
92 } // namespace frontend
93 } // namespace lyx
94
95 #endif
96