]> git.lyx.org Git - features.git/blob - src/frontends/qt4/GuiProgress.h
79891548c1277e9c8aadcf5bf11bb237b1b2f605
[features.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  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUIPROGRESS_H
13 #define GUIPROGRESS_H
14
15 #include "support/ProgressInterface.h"
16
17 #include "DockView.h"
18
19 #include <QTextEdit>
20 #include <QSplashScreen>
21 #include <QTimer>
22
23 #include <string>
24
25
26 namespace lyx {
27 namespace frontend {
28
29
30 class GuiProgress : 
31         public DockView, 
32         public lyx::support::ProgressInterface
33 {
34
35         Q_OBJECT
36 public:
37         GuiProgress(
38                 GuiView & parent, ///< the main window where to dock.
39                 Qt::DockWidgetArea area, ///< Position of the dock (and also drawer)
40                 Qt::WindowFlags flags = 0);
41
42 Q_SIGNALS:
43         void processStarted(QString const &);
44         void processFinished(QString const &);
45         void appendMessage(QString const &);
46         void appendError(QString const &);
47         void clearMessages();
48
49 private Q_SLOTS:
50         void doProcessStarted(QString const &);
51         void doProcessFinished(QString const &);
52         void doAppendMessage(QString const &);
53         void doAppendError(QString const &);
54         void doClearMessages();
55
56 public:
57         /// Controller inherited method.
58         ///@{
59         bool initialiseParams(std::string const &) { return true; }
60         void clearParams() {}
61         void dispatchParams() {}
62         bool isBufferDependent() const { return false; }
63         bool canApply() const { return true; }
64         bool canApplyToReadOnly() const { return true; }
65         void updateView() {}
66         ///@}
67
68                 
69         void showEvent(QShowEvent*);
70         void hideEvent(QHideEvent*);
71
72 private:
73         QTextEdit text_edit;
74
75         void appendText(QString const &);
76
77 };
78
79
80
81 } // namespace frontend
82 } // namespace lyx
83
84 #endif
85