]> git.lyx.org Git - lyx.git/blob - src/support/ProgressInterface.h
add generic helper class for calling functions in gui thread
[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 QString;
16
17 namespace lyx {
18 namespace support {
19
20
21 class ProgressInterface
22 {
23 public:
24         virtual ~ProgressInterface() {}
25
26         /// will be Signals in Qt classes
27         virtual void processStarted(QString const &) = 0;
28         virtual void processFinished(QString const &) = 0;
29         virtual void appendMessage(QString const &) = 0;
30         virtual void appendError(QString const &) = 0;
31         virtual void clearMessages() = 0;
32         virtual void lyxerrFlush() = 0;
33
34         /// Alert interface
35         virtual void warning(QString const & title, QString const & message) = 0;
36         virtual void toggleWarning(QString const & title, QString const & msg, QString const & formatted) = 0;
37         virtual void error(QString const & title, QString const & message) = 0;
38         virtual void information(QString const & title, QString const & message) = 0;
39
40         virtual void lyxerrConnect() = 0;
41         virtual void lyxerrDisconnect() = 0;
42
43         static void setInstance(ProgressInterface*);
44         static ProgressInterface* instance();
45
46 protected:
47         ProgressInterface() {}
48 };
49
50
51
52 } // namespace support
53 } // namespace lyx
54
55 #endif // LYX_SUPPORT_PROGRESSINTERFACE_H
56