]> git.lyx.org Git - lyx.git/blob - src/insets/ExternalSupport.h
Get rid of Qt resources
[lyx.git] / src / insets / ExternalSupport.h
1 // -*- C++ -*-
2 /**
3  * \file ExternalSupport.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 Nielsen
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef EXTERNALSUPPORT_H
14 #define EXTERNALSUPPORT_H
15
16 #include <string>
17
18
19 namespace lyx {
20
21 class Buffer;
22 class ExportData;
23 class InsetExternalParams;
24 class otexstream;
25
26 namespace external {
27
28 enum RetVal {
29         SUCCESS,
30         NOT_NEEDED,
31         FAILURE,
32         KILLED
33 };
34
35 class Template;
36
37 /// A shorthand, helper function
38 Template const * getTemplatePtr(InsetExternalParams const & params);
39
40
41 /// Invoke the external editor.
42 void editExternal(InsetExternalParams const & params,
43                   Buffer const & buffer);
44
45
46 enum Substitute {
47         ALL,
48         PATHS,
49         ALL_BUT_PATHS,
50         FORMATS
51 };
52
53 /** Substitute meta-variables in string \p s, making use of \p params and
54     \p buffer.
55     If \p external_in_tmpdir is true, all files are assumed to be in the
56     master buffers temp path, and the mangled filename is used.
57     Otherwise, the output filename (absolute or relative to the parent
58     document, as written in the .lyx file) is used.
59 */
60 std::string const doSubstitution(InsetExternalParams const & params,
61                                  Buffer const & buffer,
62                                  std::string const & s,
63                                  bool use_latex_path,
64                                  bool external_in_tmpdir = false,
65                                  Substitute what = ALL);
66
67
68 /** Write the output for a specific file format
69     and generate any external data files.
70     If \p external_in_tmpdir == true, then the generated file is
71     place in the buffer's temporary directory.
72 */
73 RetVal writeExternal(InsetExternalParams const &,
74                    std::string const & format,
75                    Buffer const &,
76                    otexstream &,
77                    ExportData &,
78                    bool external_in_tmpdir,
79                    bool dryrun);
80
81 } // namespace external
82 } // namespace lyx
83
84 #endif // NOT EXTERNALSUPPORT_H