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