]> git.lyx.org Git - lyx.git/blob - src/paragraph_funcs.h
minimal effort implementation of:
[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
17 #include "support/types.h"
18
19 class Buffer;
20 class BufferParams;
21 class InsetBase;
22 class LyXFont;
23 class Paragraph;
24
25 /**
26  * This breaks a paragraph at the specified position.
27  * The new paragraph will:
28  * get the default layout, when flag == 0
29  * will inherit the existing one, except for depth, when flag == 1
30  * will inherit the existing one, including depth, when flag == 2
31  * Be aware that the old or new paragraph does not contain any rows
32  * after this.
33  */
34 void breakParagraph(BufferParams const & bparams,
35                     ParagraphList & paragraphs,
36                     lyx::pit_type par,
37                     lyx::pos_type pos,
38                     int flag);
39
40 ///
41 void breakParagraphConservative(BufferParams const & bparams,
42                                 ParagraphList & paragraphs,
43                                 lyx::pit_type par,
44                                 lyx::pos_type pos);
45
46 /**
47  * Append the next paragraph onto the tail of this one.
48  * Be careful, this doesent make any check at all.
49  */
50 void mergeParagraph(BufferParams const & bparams,
51         ParagraphList & paragraphs, lyx::pit_type par);
52
53
54 /// for the environments
55 lyx::pit_type depthHook(lyx::pit_type par,
56         ParagraphList const & plist, lyx::depth_type depth);
57
58 lyx::pit_type outerHook(lyx::pit_type par, ParagraphList const & plist);
59
60 /// Is it the first par with same depth and layout?
61 bool isFirstInSequence(lyx::pit_type par, ParagraphList const & plist);
62
63 /** Check if the current paragraph is the last paragraph in a
64     proof environment */
65 int getEndLabel(lyx::pit_type par, ParagraphList const & plist);
66
67 LyXFont const outerFont(lyx::pit_type par_offset, ParagraphList const & pars);
68
69 /// return the number of InsetOptArg in a paragraph
70 int numberOfOptArgs(Paragraph const & par);
71
72 #endif // PARAGRAPH_FUNCS_H