]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiProgress.h
Added "cancel" to the GUI handled list of LaTeX packages.
[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 "DockView.h"
19
20
21 #include <QSplashScreen>
22 #include <QTimer>
23
24 #include <sstream>
25
26
27 namespace lyx {
28 namespace frontend {
29
30
31 class GuiProgress :
32                 public QObject,
33                 public lyx::support::ProgressInterface
34 {
35         Q_OBJECT
36
37 public:
38         GuiProgress();
39         ~GuiProgress();
40
41         void lyxerrConnect();
42         void lyxerrDisconnect();
43         void lyxerrFlush();
44
45         int prompt(docstring const & title, docstring const & question,
46                    int default_button, int cancel_button,
47                    docstring const & b1, docstring const & b2);
48
49         static QString currentTime();
50
51 Q_SIGNALS:
52
53         // ProgressInterface
54         void processStarted(QString const &);
55         void processFinished(QString const &);
56         void appendMessage(QString const &);
57         void appendError(QString const &);
58         void clearMessages();
59         void appendLyXErrMessage(QString const & text);
60
61
62         void clearMessageText();
63         void updateStatusBarMessage(QString const &);
64         void triggerFlush();
65
66         // Alert interface
67         void warning(QString const & title, QString const & message);
68         void toggleWarning(QString const & title, QString const & msg, QString const & formatted);
69         void error(QString const & title, QString const & message);
70         void information(QString const & title, QString const & message);
71
72 private Q_SLOTS:
73         void doProcessStarted(QString const &);
74         void doProcessFinished(QString const &);
75         void doAppendMessage(QString const &);
76         void doAppendError(QString const &);
77         void doClearMessages();
78
79         void doWarning(QString const &, QString const &);
80         void doToggleWarning(QString const & title, QString const & msg, QString const & formatted);
81         void doError(QString const &, QString const &);
82         void doInformation(QString const &, QString const &);
83
84         void updateWithLyXErr();
85         void startFlushing();
86
87
88 private:
89         void appendText(QString const &);
90         std::ostringstream lyxerr_stream_;
91         QTimer flushDelay_;
92 };
93
94
95
96 } // namespace frontend
97 } // namespace lyx
98
99 #endif
100