]> git.lyx.org Git - lyx.git/blob - src/paragraph_funcs.h
lexer cosmetics
[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 "support/types.h"
16
17
18 namespace lyx {
19
20 class Buffer;
21 class BufferParams;
22 class Inset;
23 class Font;
24 class Paragraph;
25 class ParagraphList;
26
27 /**
28  * This breaks a paragraph at the specified position.
29  * The new paragraph will:
30  * - Decrease depth by one (or chenge layout to default layout when 
31  *    keep_layout == false  
32  * - keep current depth and layout when keep_layout == true
33  * Be aware that the old or new paragraph does not contain any rows
34  * after this.
35  */
36 void breakParagraph(BufferParams const & bparams,
37                     ParagraphList & paragraphs,
38                     pit_type par,
39                     pos_type pos,
40                     bool keep_layout);
41
42 ///
43 void breakParagraphConservative(BufferParams const & bparams,
44                                 ParagraphList & paragraphs,
45                                 pit_type par,
46                                 pos_type pos);
47
48 /**
49  * Append the next paragraph onto the tail of this one.
50  * Be careful, this doesent make any check at all.
51  */
52 void mergeParagraph(BufferParams const & bparams,
53         ParagraphList & paragraphs, pit_type par);
54
55
56 /// for the environments
57 pit_type depthHook(pit_type par,
58         ParagraphList const & plist, depth_type depth);
59
60 pit_type outerHook(pit_type par, ParagraphList const & plist);
61
62 /// Is it the first par with same depth and layout?
63 bool isFirstInSequence(pit_type par, ParagraphList const & plist);
64
65 /** Check if the current paragraph is the last paragraph in a
66     proof environment */
67 int getEndLabel(pit_type par, ParagraphList const & plist);
68
69 /**
70  * Get the font of the "environment" of paragraph \p par_offset in \p pars.
71  * All font changes of the paragraph are relative to this font.
72  */
73 Font const outerFont(pit_type par_offset, ParagraphList const & pars);
74
75 /// accept the changes within the complete ParagraphList
76 void acceptChanges(ParagraphList & pars, BufferParams const & bparams);
77
78
79 } // namespace lyx
80
81 #endif // PARAGRAPH_FUNCS_H