]> git.lyx.org Git - lyx.git/blob - src/ParagraphParameters.h
the spellcheck cleanup
[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 #include <string>
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         LyXAlignment align() const;
60         ///
61         void align(LyXAlignment);
62         ///
63         typedef lyx::depth_type depth_type;
64         ///
65         depth_type depth() const;
66         ///
67         void depth(depth_type);
68         ///
69         bool startOfAppendix() const;
70         ///
71         void startOfAppendix(bool);
72         ///
73         bool appendix() const;
74         ///
75         void appendix(bool);
76         ///
77         std::string const & labelString() const;
78         ///
79         void labelString(std::string const &);
80         ///
81         std::string const & labelWidthString() const;
82         ///
83         void labelWidthString(std::string const &);
84         ///
85         LyXLength const & leftIndent() const;
86         ///
87         void leftIndent(LyXLength const &);
88
89         /// read the parameters from a lex
90         void read(LyXLex & lex);
91
92         /// write out the parameters to a stream
93         void write(std::ostream & os) const;
94
95 private:
96         ///
97         void set_from_struct(ParameterStruct const &);
98         ///
99         boost::shared_ptr<ParameterStruct> param;
100         ///
101         static ShareContainer<ParameterStruct> container;
102 };
103
104
105 /** Generate a string \param data from \param par's ParagraphParameters.
106     The function also generates some additional info needed by the
107     Paragraph dialog.
108  */
109 void params2string(Paragraph const & par, std::string & data);
110
111 /** Given \param data, an encoding of the ParagraphParameters generated
112     in the Paragraph dialog, this function sets the current paragraph
113     appropriately.
114  */
115 void setParagraphParams(BufferView & bv, std::string const & data);
116
117 #endif