X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FExporter.h;h=2b34ac14f8b539fc2c0053e72a79c71c6e756684;hb=4b0069860c4ac54aff09627582c6f5da7aa9020c;hp=29c06ea831eb061b3bdbb5e5e4dfe57acd76380e;hpb=f630be890494c849981e4fb52ea4740506e92bed;p=lyx.git diff --git a/src/Exporter.h b/src/Exporter.h index 29c06ea831..2b34ac14f8 100644 --- a/src/Exporter.h +++ b/src/Exporter.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Jean-Marc Lasgouttes * * Full author contact details are available in file CREDITS. @@ -13,7 +13,7 @@ #ifndef EXPORTER_H #define EXPORTER_H -#include "support/filename.h" +#include "support/FileName.h" #include #include @@ -22,32 +22,26 @@ namespace lyx { +enum CopyStatus { + SUCCESS, + FORCE, + CANCEL +}; -class Buffer; -class Format; -class Exporter { -public: - /// - static - bool Export(Buffer * buffer, std::string const & format, - bool put_in_tempdir, std::string & result_file); - /// - static - bool Export(Buffer * buffer, std::string const & format, - bool put_in_tempdir); - /// - static - bool preview(Buffer * buffer, std::string const & format); - /// - static - bool isExportable(Buffer const & buffer, std::string const & format); - /// - static - std::vector const - getExportableFormats(Buffer const & buffer, bool only_viewable); - /// -}; +/** copy file \p sourceFile to \p destFile. If \p force is false, the user + * will be asked before existing files are overwritten. If \p only_tmp + * is true, then only copy files that are in our tmp dir (to avoid other files + * overwriting themselves). + * \return + * - SUCCESS if this file got copied + * - FORCE if subsequent calls should not ask for confirmation before + * overwriting files anymore. + * - CANCEL if the export should be cancelled + */ +CopyStatus copyFile(std::string const & format, + support::FileName const & sourceFile, support::FileName const & destFile, + std::string const & latexFile, bool force, bool only_tmp = true); class ExportedFile { @@ -89,13 +83,13 @@ public: support::FileName const & sourceName); /// get referenced files for \p format std::vector const - externalFiles(std::string const & format) const; + externalFiles(std::string const & format) const; private: typedef std::map > FileMap; /** Files that are referenced by the export result in the * different formats. */ - FileMap externalfiles; + FileMap externalfiles_; };