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