]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/context.h
architectural changes to tex2lyx
[lyx.git] / src / tex2lyx / context.h
1 // -*- C++ -*-
2 #ifndef CONTEXT_H
3 #define CONTEXT_H
4
5 #include "lyxtextclass.h"
6
7 // A helper struct
8 struct Context {
9         Context(bool need_layout_,
10                 LyXTextClass const & textclass_,
11                 LyXLayout_ptr layout_ = LyXLayout_ptr(),
12                 LyXLayout_ptr parent_layout_= LyXLayout_ptr());
13
14         // Output a \begin_layout is requested
15         void check_layout(std::ostream & os);
16
17         // Output a \end_layout if needed
18         void check_end_layout(std::ostream & os);
19
20         // dump content on standard error (for debugging purpose)
21         void dump(std::ostream &, std::string const & desc = "context") const;
22
23         // Do we need to output some \begin_layout command before the
24         // next characters?
25         bool need_layout;
26         // Do we need to output some \end_layout command
27         bool need_end_layout;
28         // We may need to add something after this \begin_layout command
29         std::string extra_stuff;
30         // If there has been an \begin_deeper, we'll need a matching
31         // \end_deeper
32         bool need_end_deeper;
33
34         // The textclass of the document. Could actually be a global variable
35         LyXTextClass const & textclass;
36         // The layout of the current paragraph
37         LyXLayout_ptr layout;
38         // The layout of the outer paragraph (for environment layouts)
39         LyXLayout_ptr parent_layout;
40 };
41         
42
43 #endif