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