+enum ArgumentType {
+ required,
+ req_group,
+ verbatim,
+ item,
+ optional,
+ opt_group,
+ displaymath,
+};
+
+class FullCommand {
+public:
+ FullCommand() {}
+ FullCommand(std::vector<ArgumentType> const & a, docstring const & d)
+ : args(a), def(d) {}
+ std::vector<ArgumentType> args;
+ docstring def;
+};
+
+class FullEnvironment {
+public:
+ FullEnvironment() {}
+ FullEnvironment(std::vector<ArgumentType> const & a,
+ docstring const & b, docstring const & e)
+ : args(a), beg(b), end(e) {}
+ std::vector<ArgumentType> args;
+ docstring beg;
+ docstring end;
+};
+
+typedef std::map<std::string, std::vector<ArgumentType> > CommandMap;
+typedef std::map<std::string, FullCommand> FullCommandMap;
+typedef std::map<std::string, FullEnvironment> FullEnvironmentMap;
+
+/// Known TeX commands with arguments that get parsed into ERT.
+extern CommandMap known_commands;
+/// Known TeX environments with arguments that get parsed into ERT.
+extern CommandMap known_environments;
+/// Known TeX math environments with arguments that get parsed into LyX mathed.
+extern CommandMap known_math_environments;
+/// Commands that might be defined by the document class or modules
+extern FullCommandMap possible_textclass_commands;
+/// Environments that might be defined by the document class or modules
+extern FullEnvironmentMap possible_textclass_environments;
+///
+extern bool noweb_mode;
+/// Did we recognize any pdflatex-only construct?
+extern bool pdflatex;
+/// Did we recognize any xetex-only construct?
+extern bool xetex;
+/// Do we have CJK?
+extern bool have_CJK;
+/// Do we have non-CJK Japanese?
+extern bool is_nonCJKJapanese;
+/// LyX format that is created by tex2lyx
+extern int const LYX_FORMAT;
+
+/// path of the master .tex file
+extern std::string getMasterFilePath();
+/// path of the currently processed .tex file
+extern std::string getParentFilePath();
+
+
+/*!
+ * Reads tex input from \a infilename and writes lyx output to \a outfilename.
+ * The (latex) encoding can be provided as \a encoding.
+ * Uses some common settings for the preamble, so this should only
+ * be used more than once for included documents.
+ * Caution: Overwrites the existing preamble settings if the new document
+ * contains a preamble.
+ * \return true if the conversion was successful, else false.
+ */
+bool tex2lyx(std::string const & infilename,
+ support::FileName const & outfilename,
+ std::string const & encoding);
+
+
+} // namespace lyx
+