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