]> git.lyx.org Git - lyx.git/blob - src/paragraph_funcs.h
The final parsing patch. Tested on a variety of weird and wonderful things
[lyx.git] / src / paragraph_funcs.h
1 // -*- C++ -*-
2 /**
3  * \file paragraph_funcs.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef PARAGRAPH_FUNCS_H
13 #define PARAGRAPH_FUNCS_H
14
15 #include "ParagraphList.h"
16 #include "support/types.h"
17
18 class Buffer;
19 class BufferParams;
20 class Paragraph;
21 class TexRow;
22 class LyXLex;
23
24 ///
25 void breakParagraph(BufferParams const & bparams,
26                     ParagraphList & paragraphs,
27                     ParagraphList::iterator par,
28                     lyx::pos_type pos,
29                     int flag);
30
31 ///
32 void breakParagraphConservative(BufferParams const & bparams,
33                                 ParagraphList & paragraphs,
34                                 ParagraphList::iterator par,
35                                 lyx::pos_type pos);
36
37 /**
38  * Append the next paragraph onto the tail of this one.
39  * Be careful, this doesent make any check at all.
40  */
41 void mergeParagraph(BufferParams const & bparams,
42                     ParagraphList & paragraphs,
43                     ParagraphList::iterator par);
44
45
46 #if 0
47 /// for the environments
48 Paragraph * depthHook(Paragraph * par, Paragraph::depth_type depth);
49
50 Paragraph * outerHook(Paragraph * par);
51
52 /// Is it the first par with same depth and layout?
53 bool isFirstInSequence(Paragraph * par);
54
55 /** Check if the current paragraph is the last paragraph in a
56     proof environment */
57 int getEndLabel(Paragraph * para, BufferParams const & bparams);
58 #endif
59
60 ParagraphList::iterator
61 TeXDeeper(Buffer const * buf,
62           BufferParams const & bparams,
63           ParagraphList const & paragraphs,
64           ParagraphList::iterator pit,
65           std::ostream & os, TexRow & texrow);
66
67 ParagraphList::iterator
68 TeXEnvironment(Buffer const * buf,
69                BufferParams const & bparams,
70                ParagraphList const & paragraphs,
71                ParagraphList::iterator pit,
72                std::ostream & os, TexRow & texrow);
73
74 ParagraphList::iterator
75 TeXOnePar(Buffer const * buf,
76           BufferParams const & bparams,
77           ParagraphList const & paragraphs,
78           ParagraphList::iterator pit,
79           std::ostream & os, TexRow & texrow,
80           bool moving_arg);
81
82 void latexParagraphs(Buffer const * buf,
83                      ParagraphList const & paragraphs,
84                      ParagraphList::iterator par,
85                      ParagraphList::iterator endpar,
86                      std::ostream & ofs,
87                      TexRow & texrow,
88                      bool moving_arg = false);
89
90 /// read a paragraph from a .lyx file. Returns number of unrecognised tokens
91 int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex);
92
93 #endif // PARAGRAPH_FUNCS_H