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 * Small helper struct that holds font properties.
20 * The names are in LyX language, not LaTeX.
21 * We don't use LyXFont, because it pulls in a lot of dependencies and has
22 * more strings than needed (e.g. font family error1 etc.).
23 * If more font related stuff is needed, it might be good to change to
49 Context(bool need_layout_,
50 LyXTextClass const & textclass_,
51 LyXLayout_ptr layout_ = LyXLayout_ptr(),
52 LyXLayout_ptr parent_layout_= LyXLayout_ptr(),
55 // Output a \begin_layout is requested
56 void check_layout(std::ostream & os);
58 // Output a \end_layout if needed
59 void check_end_layout(std::ostream & os);
61 // Output a \begin_deeper if needed
62 void check_deeper(std::ostream & os);
64 // Output a \end_deeper if needed
65 void check_end_deeper(std::ostream & os);
67 // dump content on stream (for debugging purpose), with
68 // description \c desc.
69 void dump(std::ostream &, std::string const & desc = "context") const;
71 /// Are we just beginning a new paragraph?
72 bool atParagraphStart() const { return need_layout; }
74 /// Begin an item in a list environment
77 /// Start a new paragraph
78 void new_paragraph(std::ostream & os);
80 /// Add extra stuff if not already there
81 void add_extra_stuff(std::string const &);
83 // Do we need to output some \begin_layout command before the
86 // Do we need to output some \end_layout command
88 // We may need to add something after this \begin_layout command
89 std::string extra_stuff;
90 // If there has been an \begin_deeper, we'll need a matching
93 // If we are in an itemize-like environment, we need an \item
94 // for each paragraph, otherwise this has to be a deeper
97 // we are handling a standard paragraph in an itemize-like
99 bool deeper_paragraph;
101 // The textclass of the document. Could actually be a global variable
102 LyXTextClass const & textclass;
103 // The layout of the current paragraph
104 LyXLayout_ptr layout;
105 // The layout of the outer paragraph (for environment layouts)
106 LyXLayout_ptr parent_layout;
107 /// font attributes of this context