]> git.lyx.org Git - lyx.git/blob - src/insets/ExternalSupport.h
1e5bbc5583852f9b23ec176bc32f8f098b2bdf92
[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 <iosfwd>
17 #include <string>
18
19 class Buffer;
20 class ExportData;
21 class InsetExternalParams;
22
23 namespace lyx {
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 /** Substitute meta-variables in string \p s, making use of \p params and
38     \p buffer.
39     If \p external_in_tmpdir is true, all files are assumed to be in the
40     master buffers temp path, and the mangled filename is used.
41     Otherwise, the output filename (absolute or relative to the parent
42     document, as written in the .lyx file) is used.
43 */
44 std::string const doSubstitution(InsetExternalParams const & params,
45                                  Buffer const & buffer,
46                                  std::string const & s,
47                                  bool external_in_tmpdir = false);
48
49
50 /** Write the output for a specific file format
51     and generate any external data files.
52     If \param external_in_tmpdir == true, then the generated file is
53     place in the buffer's temporary directory.
54 */
55 int writeExternal(InsetExternalParams const &,
56                   std::string const & format,
57                   Buffer const &,
58                   std::ostream &,
59                   ExportData &,
60                   bool external_in_tmpdir = false);
61
62 } // namespace external
63 } // namespace lyx
64
65 #endif // NOT EXTERNALSUPPORT_H