]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/tex2lyx.h
d2b296d4719f373485d05d7e4b6101927433b372
[lyx.git] / src / tex2lyx / tex2lyx.h
1 #ifndef TEX2LYX_H
2 #define TEX2LYX_H
3
4 #include "texparser.h"
5 #include "lyxtextclass.h"
6
7 #include <iosfwd>
8 #include <string>
9 #include <vector>
10
11 class LyXTextClass;
12
13 LyXTextClass const parse_preamble(Parser & p, std::ostream & os);
14
15 void parse_text(Parser & p, std::ostream & os, unsigned flags, bool outer,
16                 LyXTextClass const & textclass,
17                 LyXLayout_ptr layout_ptr = LyXLayout_ptr());
18
19 void parse_text_in_inset(Parser & p, std::ostream & os, unsigned flags, 
20                          bool outer, LyXTextClass const & textclass, 
21                          LyXLayout_ptr layout = LyXLayout_ptr());
22
23 void parse_table(Parser & p, std::ostream & os, unsigned flags);
24
25 void parse_math(Parser & p, std::ostream & os, unsigned flags, mode_type mode);
26
27 void handle_tabular(Parser & p, std::ostream & os,
28                     LyXTextClass const & textclass);
29
30 // Helper
31 std::string parse_text(Parser & p, unsigned flags, const bool outer,
32                        LyXTextClass const & textclass, 
33                        LyXLayout_ptr layout_ptr = LyXLayout_ptr());
34
35 void check_end_layout(std::ostream & os);
36 void handle_comment(Parser & p);
37 std::string const trim(std::string const & a, char const * p = " \t\n\r");
38
39 void split(std::string const & s, std::vector<std::string> & result,
40         char delim = ',');
41 std::string join(std::vector<std::string> const & input,
42         char const * delim);
43
44 bool is_math_env(std::string const & name);
45 char const ** is_known(std::string const & str, char const ** what);
46
47 // Access to environment stack
48 extern std::vector<std::string> active_environments;
49 std::string active_environment();
50
51 #endif