]> git.lyx.org Git - lyx.git/blob - src/ParagraphParameters.h
03cd251c8999bcec7c18b99b892cb72dc4fda338
[lyx.git] / src / ParagraphParameters.h
1 // -*- C++ -*-
2 /**
3  * \file ParagraphParameters.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  * \author Angus Leeming
9  * \author John Levon
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef PARAGRAPHPARAMETERS_H
15 #define PARAGRAPHPARAMETERS_H
16
17 #include "layout.h"
18 #include "ShareContainer.h"
19
20 #include "support/types.h"
21
22 #include "support/std_string.h"
23 #include <iosfwd>
24
25 class BufferView;
26 class LyXLength;
27 class LyXLex;
28 class Paragraph;
29 class ParameterStruct;
30 class Spacing;
31 class VSpace;
32
33 ///
34 class ParagraphParameters {
35 public:
36         ///
37         ParagraphParameters();
38         ///
39         void clear();
40         ///
41         bool sameLayout(ParagraphParameters const &) const;
42         ///
43         VSpace const & spaceTop() const;
44         ///
45         void spaceTop(VSpace const &);
46         ///
47         VSpace const & spaceBottom() const;
48         ///
49         void spaceBottom(VSpace const &);
50         ///
51         Spacing const & spacing() const;
52         ///
53         void spacing(Spacing const &);
54         ///
55         bool noindent() const;
56         ///
57         void noindent(bool);
58         ///
59         bool lineTop() const;
60         ///
61         void lineTop(bool);
62         ///
63         bool lineBottom() const;
64         ///
65         void lineBottom(bool);
66         ///
67         bool pagebreakTop() const;
68         ///
69         void pagebreakTop(bool);
70         ///
71         bool pagebreakBottom() const;
72         ///
73         void pagebreakBottom(bool);
74         ///
75         LyXAlignment align() const;
76         ///
77         void align(LyXAlignment);
78         ///
79         typedef lyx::depth_type depth_type;
80         ///
81         depth_type depth() const;
82         ///
83         void depth(depth_type);
84         ///
85         bool startOfAppendix() const;
86         ///
87         void startOfAppendix(bool);
88         ///
89         bool appendix() const;
90         ///
91         void appendix(bool);
92         ///
93         string const & labelString() const;
94         ///
95         void labelString(string const &);
96         ///
97         string const & labelWidthString() const;
98         ///
99         void labelWidthString(string const &);
100         ///
101         LyXLength const & leftIndent() const;
102         ///
103         void leftIndent(LyXLength const &);
104
105         /// read the parameters from a lex
106         void read(LyXLex & lex);
107
108         /// write out the parameters to a stream
109         void write(std::ostream & os) const;
110
111 private:
112         ///
113         void set_from_struct(ParameterStruct const &);
114         ///
115         boost::shared_ptr<ParameterStruct> param;
116         ///
117         static ShareContainer<ParameterStruct> container;
118 };
119
120
121 /** Generate a string \param data from \param par's ParagraphParameters.
122     The function also generates some additional info needed by the
123     Paragraph dialog.
124  */
125 void params2string(Paragraph const & par, string & data);
126
127 /** Given \param data, an encoding of the ParagraphParameters generated
128     in the Paragraph dialog, this function sets the current paragraph
129     appropriately.
130  */
131 void setParagraphParams(BufferView & bv, string const & data);
132
133 #endif