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
|
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
class Buffer;
|
2004-06-01 13:39:33 +00:00
|
|
|
class ExportData;
|
2003-10-07 20:25:10 +00:00
|
|
|
class InsetExternalParams;
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
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,
|
|
|
|
ALL_BUT_PATHS
|
|
|
|
};
|
|
|
|
|
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,
|
2004-06-01 13:39:33 +00:00
|
|
|
std::string const & s,
|
2005-01-14 08:52:35 +00:00
|
|
|
bool external_in_tmpdir = false,
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
int writeExternal(InsetExternalParams const &,
|
|
|
|
std::string const & format,
|
|
|
|
Buffer const &,
|
|
|
|
std::ostream &,
|
2004-06-01 13:39:33 +00:00
|
|
|
ExportData &,
|
2003-10-07 20:25:10 +00:00
|
|
|
bool external_in_tmpdir = false);
|
|
|
|
|
|
|
|
} // namespace external
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // NOT EXTERNALSUPPORT_H
|