]> git.lyx.org Git - lyx.git/blobdiff - src/converter.h
minimal effort implementation of:
[lyx.git] / src / converter.h
index 6c0930a39863e415b44e4cdbe3859c580059b51c..84841e82a82a8358b3461c65a814d707ac64f4c8 100644 (file)
 #define CONVERTER_H
 
 #include "graph.h"
+#include "outputparams.h"
 
 #include <vector>
 #include <string>
 
 
 class Buffer;
+class ErrorList;
 class Format;
 class Formats;
-class LatexRunParams;
+class OutputParams;
 
 
 ///
@@ -47,6 +49,8 @@ public:
 
        /// The converter is latex or its derivatives
        bool latex;
+       /// The converter is xml
+       bool xml;
        /// Do we need to run the converter in the original directory?
        bool original_dir;
        /// This converter needs the .aux files
@@ -76,9 +80,10 @@ public:
                return converterlist_[i];
        }
        ///
-       Converter const * getConverter(std::string const & from, std::string const & to);
+       Converter const * getConverter(std::string const & from,
+                                      std::string const & to) const;
        ///
-       int getNumber(std::string const & from, std::string const & to);
+       int getNumber(std::string const & from, std::string const & to) const;
        ///
        void add(std::string const & from, std::string const & to,
                 std::string const & command, std::string const & flags);
@@ -93,21 +98,23 @@ public:
        std::vector<Format const *> const
        getReachable(std::string const & from, bool only_viewable,
                     bool clear_visited);
-       ///
+       /// Does a conversion path from format \p from to format \p to exist?
        bool isReachable(std::string const & from, std::string const & to);
        ///
        Graph::EdgePath const getPath(std::string const & from, std::string const & to);
        ///
-       bool usePdflatex(Graph::EdgePath const & path);
+       OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path);
        ///
        bool convert(Buffer const * buffer,
                     std::string const & from_file, std::string const & to_file_base,
                     std::string const & from_format, std::string const & to_format,
-                    std::string & to_file);
+                    std::string & to_file, ErrorList & errorList,
+                        bool try_default = false);
        ///
        bool convert(Buffer const * buffer,
                     std::string const & from_file, std::string const & to_file_base,
-                    std::string const & from_format, std::string const & to_format);
+                    std::string const & from_format, std::string const & to_format,
+                        ErrorList & errorList, bool try_default = false);
        ///
        void update(Formats const & formats);
        ///
@@ -126,19 +133,22 @@ public:
 private:
        ///
        std::vector<Format const *> const
-       Converters::intToFormat(std::vector<int> const & input);
+       intToFormat(std::vector<int> const & input);
        ///
        bool scanLog(Buffer const & buffer, std::string const & command,
-                    std::string const & filename);
+                    std::string const & filename, ErrorList & errorList);
        ///
        bool runLaTeX(Buffer const & buffer, std::string const & command,
-                     LatexRunParams const &);
+                     OutputParams const &, ErrorList & errorList);
        ///
        ConverterList converterlist_;
        ///
        std::string latex_command_;
-       ///
-       bool move(std::string const & from, std::string const & to, bool copy);
+       /// If \p from = /path/file.ext and \p to = /path2/file2.ext2 then
+       /// this method moves each /path/file*.ext file to /path2/file2*.ext2
+       bool move(std::string const & fmt,
+                 std::string const & from, std::string const & to,
+                 bool copy);
        ///
        Graph G_;
 };