]> git.lyx.org Git - lyx.git/blobdiff - src/exporter.h
Change to use preffered calling of Boost.Function
[lyx.git] / src / exporter.h
index 985b213dd00219f1e37c3ed5c442ed98681d4122..0cdbd4e96e4801f21d78d4b5d804851a2717ac0d 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef EXPORTER_H
 #define EXPORTER_H
 
+#include <map>
+#include <string>
 #include <vector>
 
 
@@ -41,4 +43,44 @@ public:
        GetExportableFormats(Buffer const & buffer, bool only_viewable);
        ///
 };
+
+
+struct ExportedFile {
+       ExportedFile(std::string const &, std::string const &);
+       /// absolute name of the source file
+       std::string sourceName;
+       /// final name that the exported file should get (absolute name or
+       /// relative to the directory of the master document)
+       std::string exportName;
+};
+
+
+bool operator==(ExportedFile const &, ExportedFile const &);
+
+
+class ExportData {
+public:
+       /** add a referenced file for one format.
+        *  No inset should ever write any file outside the tempdir.
+        *  Instead, files that need to be exported have to be registered
+        *  with this method.
+        *  Then the exporter mechanism copies them to the right place, asks
+        *  for confirmation before overwriting existing files etc.
+        */
+       void addExternalFile(std::string const &, std::string const &,
+                            std::string const &);
+       /// add a referenced file for one format.
+       /// The final name is the source file name without path
+       void addExternalFile(std::string const &, std::string const &);
+       /// get referenced files for one format
+       std::vector<ExportedFile> const
+       externalFiles(std::string const &) const;
+private:
+       typedef std::map<std::string, std::vector<ExportedFile> > FileMap;
+       /** Files that are referenced by the export result in the
+        *  different formats.
+        */
+       FileMap externalfiles;
+};
+
 #endif