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