]> git.lyx.org Git - lyx.git/blobdiff - src/Converter.h
tex2lyx: support for multiple indices and subindices
[lyx.git] / src / Converter.h
index 56b83a3063a65e0eda9cdcf5aaf43f667552f948..83f2ea78aafd2a108cdd14ec56c02bdc087d9cf1 100644 (file)
@@ -16,6 +16,7 @@
 #include "OutputParams.h"
 
 #include <vector>
+#include <set>
 #include <string>
 
 
@@ -53,12 +54,14 @@ public:
 
        /// The converter is latex or its derivatives
        bool latex;
+       /// The latex derivate
+       std::string latex_flavor;
        /// 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
        bool need_aux;
+       /// we need a "nice" file from the backend, c.f. OutputParams.nice.
+       bool nice;
        /// If the converter put the result in a directory, then result_dir
        /// is the name of the directory
        std::string result_dir;
@@ -73,16 +76,15 @@ public:
 ///
 class Converters {
 public:
-       ///
-       typedef std::vector<int> EdgePath; // to be removed SOON
        ///
        typedef std::vector<Converter> ConverterList;
        ///
        typedef ConverterList::const_iterator const_iterator;
        ///
-       Converter const & get(int i) const {
-               return converterlist_[i];
-       }
+       typedef std::vector<std::string> FormatList;
+
+       ///
+       Converter const & get(int i) const { return converterlist_[i]; }
        ///
        Converter const * getConverter(std::string const & from,
                                       std::string const & to) const;
@@ -94,20 +96,27 @@ public:
        //
        void erase(std::string const & from, std::string const & to);
        ///
-       void sort();
-       ///
        std::vector<Format const *> const
        getReachableTo(std::string const & target, bool clear_visited);
        ///
        std::vector<Format const *> const
        getReachable(std::string const & from, bool only_viewable,
-                    bool clear_visited);
+              bool clear_visited,
+              std::set<std::string> const & excludes = std::set<std::string>());
+
+       std::vector<Format const *> importableFormats();
+       std::vector<Format const *> exportableFormats(bool only_viewable);
+
+       std::vector<std::string> loaders() const;
+       std::vector<std::string> savers() const;
+
        /// 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);
+       Graph::EdgePath getPath(std::string const & from, std::string const & to);
        ///
-       OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path);
+       OutputParams::FLAVOR getFlavor(Graph::EdgePath const & path,
+                                      Buffer const * buffer = 0);
        /// Flags for converting files
        enum ConversionFlags {
                /// No special flags
@@ -130,12 +139,9 @@ public:
        ///
        bool formatIsUsed(std::string const & format);
        ///
-       const_iterator begin() const {
-               return converterlist_.begin();
-       }
-       const_iterator end() const {
-               return converterlist_.end();
-       }
+       const_iterator begin() const { return converterlist_.begin(); }
+       ///
+       const_iterator end() const { return converterlist_.end(); }
        ///
        void buildGraph();
 private:
@@ -152,6 +158,14 @@ private:
        ConverterList converterlist_;
        ///
        std::string latex_command_;
+       ///
+       std::string dvilualatex_command_;
+       ///
+       std::string lualatex_command_;
+       ///
+       std::string pdflatex_command_;
+       ///
+       std::string xelatex_command_;
        /// 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,