]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/context.h
Removed all redundant using directives from the source.
[lyx.git] / src / tex2lyx / context.h
1 // -*- C++ -*-
2 /**
3  * \file context.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jean-Marc Lasgouttes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CONTEXT_H
13 #define CONTEXT_H
14
15 #include "lyxtextclass.h"
16
17 // A helper struct
18 struct Context {
19         Context(bool need_layout_,
20                 LyXTextClass const & textclass_,
21                 LyXLayout_ptr layout_ = LyXLayout_ptr(),
22                 LyXLayout_ptr parent_layout_= LyXLayout_ptr());
23
24         // Output a \begin_layout is requested
25         void check_layout(std::ostream & os);
26
27         // Output a \end_layout if needed
28         void check_end_layout(std::ostream & os);
29
30         // Output a \begin_deeper if needed
31         void check_deeper(std::ostream & os);
32
33         // Output a \end_deeper if needed
34         void check_end_deeper(std::ostream & os);
35         
36         // dump content on stream (for debugging purpose), with
37         // description \c desc.
38         void dump(std::ostream &, std::string const & desc = "context") const;
39
40         // Do we need to output some \begin_layout command before the
41         // next characters?
42         bool need_layout;
43         // Do we need to output some \end_layout command
44         bool need_end_layout;
45         // We may need to add something after this \begin_layout command
46         std::string extra_stuff;
47         // If there has been an \begin_deeper, we'll need a matching
48         // \end_deeper
49         bool need_end_deeper;
50         // If we are in an itemize-like environment, we need an \item
51         // for each paragraph, otherwise this has to be a deeper
52         // paragraph.
53         bool has_item;
54         // we are handling a standard paragraph in an itemize-like
55         // environment
56         bool deeper_paragraph;
57         
58         // The textclass of the document. Could actually be a global variable
59         LyXTextClass const & textclass;
60         // The layout of the current paragraph
61         LyXLayout_ptr layout;
62         // The layout of the outer paragraph (for environment layouts)
63         LyXLayout_ptr parent_layout;
64 };
65         
66
67 #endif