]> git.lyx.org Git - lyx.git/blob - src/paragraph_funcs.h
f28ce2a1d2157229de25e4da0e35c2d7b66423f6
[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_fwd.h"
16 #include "support/types.h"
17
18 #include "support/std_string.h"
19
20 class Buffer;
21 class BufferParams;
22 class TexRow;
23 class LatexRunParams;
24 class LyXFont;
25 class LyXLex;
26 class InsetOld;
27
28 ///
29 void breakParagraph(BufferParams const & bparams,
30                     ParagraphList & paragraphs,
31                     ParagraphList::iterator par,
32                     lyx::pos_type pos,
33                     int flag);
34
35 ///
36 void breakParagraphConservative(BufferParams const & bparams,
37                                 ParagraphList & paragraphs,
38                                 ParagraphList::iterator par,
39                                 lyx::pos_type pos);
40
41 /**
42  * Append the next paragraph onto the tail of this one.
43  * Be careful, this doesent make any check at all.
44  */
45 void mergeParagraph(BufferParams const & bparams,
46                     ParagraphList & paragraphs,
47                     ParagraphList::iterator par);
48
49
50 /// for the environments
51 ParagraphList::iterator depthHook(ParagraphList::iterator pit,
52                                   ParagraphList const & plist,
53                                   lyx::depth_type depth);
54
55 ParagraphList::iterator outerHook(ParagraphList::iterator pit,
56                                   ParagraphList const & plist);
57
58 /// Is it the first par with same depth and layout?
59 bool isFirstInSequence(ParagraphList::iterator par,
60                        ParagraphList const & plist);
61
62 /** Check if the current paragraph is the last paragraph in a
63     proof environment */
64 int getEndLabel(ParagraphList::iterator pit,
65                 ParagraphList const & plist);
66
67
68 void latexParagraphs(Buffer const & buf,
69                      ParagraphList const & paragraphs,
70                      std::ostream & ofs,
71                      TexRow & texrow,
72                      LatexRunParams const &,
73                      string const & everypar = string());
74
75 /// read a paragraph from a .lyx file. Returns number of unrecognised tokens
76 int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex);
77
78 LyXFont const outerFont(ParagraphList::iterator pit,
79                         ParagraphList const & plist);
80
81 /// find outermost paragraph containing an inset
82 ParagraphList::iterator outerPar(Buffer const & buf, InsetOld const * inset);
83
84 /// find owning paragraph containing an inset
85 Paragraph const & ownerPar(Buffer const & buf, InsetOld const * inset);
86
87
88 #endif // PARAGRAPH_FUNCS_H