]> git.lyx.org Git - lyx.git/blob - src/ParagraphParameters.h
Fix quotation marks in PDF TOC
[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 "LayoutEnums.h"
18 #include "Length.h"
19 #include "Spacing.h"
20
21 #include "support/types.h"
22 #include "support/docstring.h"
23
24
25 namespace lyx {
26
27 class BufferView;
28 class Layout;
29 class Length;
30 class Lexer;
31 class Paragraph;
32 class Spacing;
33
34
35 ///
36 class ParagraphParameters {
37 public:
38         ///
39         ParagraphParameters();
40         ///
41         void clear();
42         ///
43         bool sameLayout(ParagraphParameters const &) const;
44         ///
45         Spacing const & spacing() const;
46         ///
47         void spacing(Spacing const &);
48         ///
49         bool noindent() const;
50         ///
51         void noindent(bool);
52         ///
53         LyXAlignment align() const;
54         ///
55         void align(LyXAlignment);
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         docstring const & labelString() const;
70         ///
71         void labelString(docstring const &);
72         ///
73         docstring const & labelWidthString() const;
74         ///
75         void labelWidthString(docstring const &);
76         ///
77         Length const & leftIndent() const;
78         ///
79         void leftIndent(Length const &);
80
81         /// read the parameters from a string
82         void read (std::string str, bool merge = true);
83
84         /// read the parameters from a lex
85         void read(Lexer & lex, bool merge = true);
86
87         ///
88         void apply(ParagraphParameters const & params, Layout const & layout);
89
90         // It would be nice to have a working version of this method, so that
91         // getStatus() could return information about what was possible.
92         // bool canApply(ParagraphParameters const & params, Layout const & layout)
93         //      { return true; }
94
95         /// write out the parameters to a stream
96         void write(std::ostream & os) const;
97
98 private:
99         ///
100         Spacing spacing_;
101         ///
102         bool noindent_;
103         ///
104         bool start_of_appendix_;
105         ///
106         bool appendix_;
107         ///
108         LyXAlignment align_;
109         ///
110         depth_type depth_;
111         ///
112         docstring labelstring_;
113         ///
114         docstring labelwidthstring_;
115         ///
116         Length leftindent_;
117 };
118
119
120
121 /** Generate a string \param data from \param par's ParagraphParameters.
122     The function also generates some additional info needed by the
123     Paragraph dialog.
124  */
125 void params2string(Paragraph const & par, std::string & data);
126
127
128 } // namespace lyx
129
130 #endif