]> git.lyx.org Git - lyx.git/blob - src/ParagraphParameters.h
73fce34030e0e8e4234f5cd98d4bac3e0a0dee32
[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 "lyxlength.h"
19 #include "Spacing.h"
20
21 #include "support/types.h"
22 #include "support/docstring.h"
23
24 #include <iosfwd>
25 #include <string>
26
27 class BufferView;
28 class LyXLength;
29 class LyXLex;
30 class Paragraph;
31 class Spacing;
32
33
34 ///
35 class ParagraphParameters {
36 public:
37         ///
38         ParagraphParameters();
39         ///
40         void clear();
41         ///
42         bool sameLayout(ParagraphParameters const &) const;
43         ///
44         Spacing const & spacing() const;
45         ///
46         void spacing(Spacing const &);
47         ///
48         bool noindent() const;
49         ///
50         void noindent(bool);
51         ///
52         LyXAlignment align() const;
53         ///
54         void align(LyXAlignment);
55         ///
56         typedef lyx::depth_type depth_type;
57         ///
58         depth_type depth() const;
59         ///
60         void depth(depth_type);
61         ///
62         bool startOfAppendix() const;
63         ///
64         void startOfAppendix(bool);
65         ///
66         bool appendix() const;
67         ///
68         void appendix(bool);
69         ///
70         lyx::docstring const & labelString() const;
71         ///
72         void labelString(lyx::docstring const &);
73         ///
74         lyx::docstring const & labelWidthString() const;
75         ///
76         void labelWidthString(lyx::docstring const &);
77         ///
78         LyXLength const & leftIndent() const;
79         ///
80         void leftIndent(LyXLength const &);
81
82         /// read the parameters from a lex
83         void read(LyXLex & lex);
84
85         /// write out the parameters to a stream
86         void write(std::ostream & os) const;
87
88         //friend bool operator==(ParameterStruct const & ps1,
89         //ParameterStruct const & ps2);
90
91 private:
92         ///
93         Spacing spacing_;
94         ///
95         bool noindent_;
96         ///
97         bool start_of_appendix_;
98         ///
99         bool appendix_;
100         ///
101         LyXAlignment align_;
102         ///
103         depth_type depth_;
104         ///
105         lyx::docstring labelstring_;
106         ///
107         lyx::docstring labelwidthstring_;
108         ///
109         LyXLength leftindent_;
110 };
111
112
113
114 /** Generate a string \param data from \param par's ParagraphParameters.
115     The function also generates some additional info needed by the
116     Paragraph dialog.
117  */
118 void params2string(Paragraph const & par, std::string & data);
119
120 #endif