]> git.lyx.org Git - lyx.git/blob - src/support/ProgressInterface.h
79e2e8b0542972b4ca01bd9126141ceee6e733d9
[lyx.git] / src / support / ProgressInterface.h
1 // -*- C++ -*-
2 /**
3  * \file ProgressInterface.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 LYX_SUPPORT_PROGRESSINTERFACE_H
13 #define LYX_SUPPORT_PROGRESSINTERFACE_H
14
15 class docstring;
16 class QString;
17
18 namespace lyx {
19 namespace support {
20
21
22 class ProgressInterface
23 {
24 public:
25         virtual ~ProgressInterface() {}
26
27         /// will be Signals in Qt classes
28         virtual void processStarted(QString const &) = 0;
29         virtual void processFinished(QString const &) = 0;
30         virtual void appendMessage(QString const &) = 0;
31         virtual void appendError(QString const &) = 0;
32         virtual void clearMessages() = 0;
33         virtual void lyxerrFlush() = 0;
34
35         /// Alert interface
36         virtual void warning(QString const & title, QString const & message) = 0;
37         virtual void toggleWarning(QString const & title, QString const & msg, QString const & formatted) = 0;
38         virtual void error(QString const & title, QString const & message) = 0;
39         virtual void information(QString const & title, QString const & message) = 0;
40         virtual int prompt(docstring const & title, docstring const & question,
41                            int default_button, int cancel_button,
42                            docstring const & b1, docstring const & b2) = 0;
43
44         virtual void lyxerrConnect() = 0;
45         virtual void lyxerrDisconnect() = 0;
46
47         static void setInstance(ProgressInterface*);
48         static ProgressInterface* instance();
49
50 protected:
51         ProgressInterface() {}
52 };
53
54
55
56 } // namespace support
57 } // namespace lyx
58
59 #endif // LYX_SUPPORT_PROGRESSINTERFACE_H
60