2003-10-07 20:25:10 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file ExternalSupport.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Asger Alstrup Nielsen
|
|
|
|
* \author Angus Leeming
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EXTERNALSUPPORT_H
|
|
|
|
#define EXTERNALSUPPORT_H
|
|
|
|
|
2016-06-19 02:39:38 +00:00
|
|
|
#include <string>
|
|
|
|
|
2003-10-07 20:25:10 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2003-10-07 20:25:10 +00:00
|
|
|
class Buffer;
|
2004-06-01 13:39:33 +00:00
|
|
|
class ExportData;
|
2003-10-07 20:25:10 +00:00
|
|
|
class InsetExternalParams;
|
2016-06-19 02:39:38 +00:00
|
|
|
class otexstream;
|
2003-10-07 20:25:10 +00:00
|
|
|
|
|
|
|
namespace external {
|
|
|
|
|
|
|
|
class Template;
|
|
|
|
|
|
|
|
/// A shorthand, helper function
|
|
|
|
Template const * getTemplatePtr(InsetExternalParams const & params);
|
|
|
|
|
|
|
|
|
|
|
|
/// Invoke the external editor.
|
|
|
|
void editExternal(InsetExternalParams const & params,
|
|
|
|
Buffer const & buffer);
|
|
|
|
|
|
|
|
|
2005-01-14 08:52:35 +00:00
|
|
|
enum Substitute {
|
|
|
|
ALL,
|
|
|
|
PATHS,
|
2015-07-20 19:14:45 +00:00
|
|
|
ALL_BUT_PATHS,
|
|
|
|
FORMATS
|
2005-01-14 08:52:35 +00:00
|
|
|
};
|
|
|
|
|
2004-06-01 13:39:33 +00:00
|
|
|
/** Substitute meta-variables in string \p s, making use of \p params and
|
|
|
|
\p buffer.
|
|
|
|
If \p external_in_tmpdir is true, all files are assumed to be in the
|
|
|
|
master buffers temp path, and the mangled filename is used.
|
|
|
|
Otherwise, the output filename (absolute or relative to the parent
|
|
|
|
document, as written in the .lyx file) is used.
|
|
|
|
*/
|
2003-10-07 20:25:10 +00:00
|
|
|
std::string const doSubstitution(InsetExternalParams const & params,
|
|
|
|
Buffer const & buffer,
|
2006-04-05 23:56:29 +00:00
|
|
|
std::string const & s,
|
|
|
|
bool use_latex_path,
|
2005-04-18 17:43:11 +00:00
|
|
|
bool external_in_tmpdir = false,
|
2006-04-05 23:56:29 +00:00
|
|
|
Substitute what = ALL);
|
2003-10-07 20:25:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
/** Write the output for a specific file format
|
|
|
|
and generate any external data files.
|
2005-01-14 08:52:35 +00:00
|
|
|
If \p external_in_tmpdir == true, then the generated file is
|
2003-10-07 20:25:10 +00:00
|
|
|
place in the buffer's temporary directory.
|
|
|
|
*/
|
2014-05-16 12:21:48 +00:00
|
|
|
void writeExternal(InsetExternalParams const &,
|
|
|
|
std::string const & format,
|
|
|
|
Buffer const &,
|
|
|
|
otexstream &,
|
|
|
|
ExportData &,
|
|
|
|
bool external_in_tmpdir,
|
|
|
|
bool dryrun);
|
2003-10-07 20:25:10 +00:00
|
|
|
|
|
|
|
} // namespace external
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // NOT EXTERNALSUPPORT_H
|