]> git.lyx.org Git - features.git/blob - src/support/Systemcall.h
8ed0277c0d922e407f249c9c52c6ffe73c1d88bf
[features.git] / src / support / Systemcall.h
1 // -*- C++ -*-
2 /**
3  * \file Systemcall.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Asger Alstrup
8  * \author Peter Kümmel
9  *
10  * Interface cleaned up by
11  * \author Angus Leeming
12  *
13  * Full author contact details are available in file CREDITS.
14  */
15
16 #ifndef SYSTEMCALL_H
17 #define SYSTEMCALL_H
18
19 #include <string>
20
21 namespace lyx {
22 namespace support {
23
24 class ProgressInterface;
25
26 /**
27  * An instance of Class Systemcall represents a single child process.
28  *
29  * Class Systemcall uses SystemcallPrivate to launch the child process.
30  * The user can choose to wait or not wait for the process to complete, but no
31  * callback is invoked upon completion of the child.
32  *
33  * The child process is not killed when the Systemcall instance goes out of
34  * scope.
35  */
36 class Systemcall {
37 public:
38         /// whether to wait for completion
39         enum Starttype {
40                 Wait, //< wait for completion before returning from startscript()
41                 DontWait //< don't wait for completion
42         };
43
44         /** Start child process.
45          *  The string "what" contains a commandline with arguments separated
46          *  by spaces.
47          */
48         int startscript(Starttype how, std::string const & what);
49
50         static void registerProgressInterface(ProgressInterface*);
51         static ProgressInterface* progress();
52 };
53
54 } // namespace support
55 } // namespace lyx
56
57 #endif // SYSTEMCALL_H