4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jean-Marc Lasgouttes
9 * Full author contact details are available in file CREDITS.
15 #include "lyxtextclass.h"
19 Context(bool need_layout_,
20 LyXTextClass const & textclass_,
21 LyXLayout_ptr layout_ = LyXLayout_ptr(),
22 LyXLayout_ptr parent_layout_= LyXLayout_ptr());
24 // Output a \begin_layout is requested
25 void check_layout(std::ostream & os);
27 // Output a \end_layout if needed
28 void check_end_layout(std::ostream & os);
30 // Output a \begin_deeper if needed
31 void check_deeper(std::ostream & os);
33 // Output a \end_deeper if needed
34 void check_end_deeper(std::ostream & os);
36 // dump content on stream (for debugging purpose), with
37 // description \c desc.
38 void dump(std::ostream &, std::string const & desc = "context") const;
40 /// Are we just beginning a new paragraph?
41 bool atParagraphStart() const { return need_layout; }
43 /// Begin an item in a list environment
46 /// Start a new paragraph
47 void new_paragraph(std::ostream & os);
49 // Do we need to output some \begin_layout command before the
52 // Do we need to output some \end_layout command
54 // We may need to add something after this \begin_layout command
55 std::string extra_stuff;
56 // If there has been an \begin_deeper, we'll need a matching
59 // If we are in an itemize-like environment, we need an \item
60 // for each paragraph, otherwise this has to be a deeper
63 // we are handling a standard paragraph in an itemize-like
65 bool deeper_paragraph;
67 // The textclass of the document. Could actually be a global variable
68 LyXTextClass const & textclass;
69 // The layout of the current paragraph
71 // The layout of the outer paragraph (for environment layouts)
72 LyXLayout_ptr parent_layout;