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