4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * Full author contact details are available in file CREDITS.
16 #include "support/filename.h"
33 bool Export(Buffer * buffer, std::string const & format,
34 bool put_in_tempdir, std::string & result_file);
37 bool Export(Buffer * buffer, std::string const & format,
41 bool preview(Buffer * buffer, std::string const & format);
44 bool isExportable(Buffer const & buffer, std::string const & format);
47 std::vector<Format const *> const
48 getExportableFormats(Buffer const & buffer, bool only_viewable);
55 ExportedFile(support::FileName const &, std::string const &);
56 /// absolute name of the source file
57 support::FileName sourceName;
58 /// final name that the exported file should get (absolute name or
59 /// relative to the directory of the master document)
60 std::string exportName;
64 bool operator==(ExportedFile const &, ExportedFile const &);
69 /** add a referenced file for one format.
70 * No inset should ever write any file outside the tempdir.
71 * Instead, files that need to be exported have to be registered
73 * Then the exporter mechanism copies them to the right place, asks
74 * for confirmation before overwriting existing files etc.
75 * \param format format that references the given file
76 * \param sourceName source file name. Needs to be absolute
77 * \param exportName resulting file name. Can be either absolute
78 * or relative to the exported document.
80 void addExternalFile(std::string const & format,
81 support::FileName const & sourceName,
82 std::string const & exportName);
83 /** add a referenced file for one format.
84 * The final name is the source file name without path.
85 * \param format format that references the given file
86 * \param sourceName source file name. Needs to be absolute
88 void addExternalFile(std::string const & format,
89 support::FileName const & sourceName);
90 /// get referenced files for \p format
91 std::vector<ExportedFile> const
92 externalFiles(std::string const & format) const;
94 typedef std::map<std::string, std::vector<ExportedFile> > FileMap;
95 /** Files that are referenced by the export result in the
98 FileMap externalfiles;