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