]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/context.h
finish tex2lyx depth support (hopefully); more things in .cvsignore
[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         // Output a \begin_deeper if needed
21         void check_deeper(std::ostream & os);
22
23         // Output a \end_deeper if needed
24         void check_end_deeper(std::ostream & os);
25         
26         // dump content on stream (for debugging purpose), with
27         // description \c desc.
28         void dump(std::ostream &, std::string const & desc = "context") const;
29
30         // Do we need to output some \begin_layout command before the
31         // next characters?
32         bool need_layout;
33         // Do we need to output some \end_layout command
34         bool need_end_layout;
35         // We may need to add something after this \begin_layout command
36         std::string extra_stuff;
37         // If there has been an \begin_deeper, we'll need a matching
38         // \end_deeper
39         bool need_end_deeper;
40         // If we are in an itemize-like environment, we need an \item
41         // for each paragraph, otherwise this has to be a deeper
42         // paragraph.
43         bool has_item;
44         // we are handling a standard paragraph in an itemize-like
45         // environment
46         bool deeper_paragraph;
47         
48         // The textclass of the document. Could actually be a global variable
49         LyXTextClass const & textclass;
50         // The layout of the current paragraph
51         LyXLayout_ptr layout;
52         // The layout of the outer paragraph (for environment layouts)
53         LyXLayout_ptr parent_layout;
54 };
55         
56
57 #endif