]> git.lyx.org Git - lyx.git/blob - src/insets/ExternalSupport.h
Cleanup bv-dependent variables in InsetCollapsable
[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 "texstream.h"
17
18 namespace lyx {
19
20 class Buffer;
21 class ExportData;
22 class InsetExternalParams;
23
24 namespace external {
25
26 class Template;
27
28 /// A shorthand, helper function
29 Template const * getTemplatePtr(InsetExternalParams const & params);
30
31
32 /// Invoke the external editor.
33 void editExternal(InsetExternalParams const & params,
34                   Buffer const & buffer);
35
36
37 enum Substitute {
38         ALL,
39         PATHS,
40         ALL_BUT_PATHS,
41         FORMATS
42 };
43
44 /** Substitute meta-variables in string \p s, making use of \p params and
45     \p buffer.
46     If \p external_in_tmpdir is true, all files are assumed to be in the
47     master buffers temp path, and the mangled filename is used.
48     Otherwise, the output filename (absolute or relative to the parent
49     document, as written in the .lyx file) is used.
50 */
51 std::string const doSubstitution(InsetExternalParams const & params,
52                                  Buffer const & buffer,
53                                  std::string const & s,
54                                  bool use_latex_path,
55                                  bool external_in_tmpdir = false,
56                                  Substitute what = ALL);
57
58
59 /** Write the output for a specific file format
60     and generate any external data files.
61     If \p external_in_tmpdir == true, then the generated file is
62     place in the buffer's temporary directory.
63 */
64 void writeExternal(InsetExternalParams const &,
65                    std::string const & format,
66                    Buffer const &,
67                    otexstream &,
68                    ExportData &,
69                    bool external_in_tmpdir,
70                    bool dryrun);
71
72 } // namespace external
73 } // namespace lyx
74
75 #endif // NOT EXTERNALSUPPORT_H