mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-16 16:18:22 +00:00
83fded8fea
The problem was that, if we killed export when some graphic was being converted, or some external template was being handled, it would only cancel that process, and then it would just continue. To deal with that, we need to do a few things: 1. Modify the return values for some of the Converters routines, and similarly the routines for external templates, so we can tell when something has been canceled. 2. Throw an exception from InsetGraphics or InsetExternal when this has happened during export, but ONLY when the Buffer is a clone. We shouldn't be able to 'cancel' export when we're, say, generating code for the preview pane, but this keeps us on the safe side.. The exception then has to be caught, obviously, back in the export routines in Buffer. Probably Coverity will be unhappy about something here, but I'll deal with that problem as it arises.
85 lines
1.8 KiB
C++
85 lines
1.8 KiB
C++
// -*- 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 <string>
|
|
|
|
|
|
namespace lyx {
|
|
|
|
class Buffer;
|
|
class ExportData;
|
|
class InsetExternalParams;
|
|
class otexstream;
|
|
|
|
namespace external {
|
|
|
|
enum RetVal {
|
|
SUCCESS,
|
|
NOT_NEEDED,
|
|
FAILURE,
|
|
KILLED
|
|
};
|
|
|
|
class Template;
|
|
|
|
/// A shorthand, helper function
|
|
Template const * getTemplatePtr(InsetExternalParams const & params);
|
|
|
|
|
|
/// Invoke the external editor.
|
|
void editExternal(InsetExternalParams const & params,
|
|
Buffer const & buffer);
|
|
|
|
|
|
enum Substitute {
|
|
ALL,
|
|
PATHS,
|
|
ALL_BUT_PATHS,
|
|
FORMATS
|
|
};
|
|
|
|
/** 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.
|
|
*/
|
|
std::string const doSubstitution(InsetExternalParams const & params,
|
|
Buffer const & buffer,
|
|
std::string const & s,
|
|
bool use_latex_path,
|
|
bool external_in_tmpdir = false,
|
|
Substitute what = ALL);
|
|
|
|
|
|
/** Write the output for a specific file format
|
|
and generate any external data files.
|
|
If \p external_in_tmpdir == true, then the generated file is
|
|
place in the buffer's temporary directory.
|
|
*/
|
|
RetVal writeExternal(InsetExternalParams const &,
|
|
std::string const & format,
|
|
Buffer const &,
|
|
otexstream &,
|
|
ExportData &,
|
|
bool external_in_tmpdir,
|
|
bool dryrun);
|
|
|
|
} // namespace external
|
|
} // namespace lyx
|
|
|
|
#endif // NOT EXTERNALSUPPORT_H
|