]> git.lyx.org Git - lyx.git/blob - src/ParagraphParameters.h
more cursor dispatch
[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
32 ///
33 class ParagraphParameters {
34 public:
35         ///
36         ParagraphParameters();
37         ///
38         void clear();
39         ///
40         bool sameLayout(ParagraphParameters const &) const;
41         ///
42         Spacing const & spacing() const;
43         ///
44         void spacing(Spacing const &);
45         ///
46         bool noindent() const;
47         ///
48         void noindent(bool);
49         ///
50         LyXAlignment align() const;
51         ///
52         void align(LyXAlignment);
53         ///
54         typedef lyx::depth_type depth_type;
55         ///
56         depth_type depth() const;
57         ///
58         void depth(depth_type);
59         ///
60         bool startOfAppendix() const;
61         ///
62         void startOfAppendix(bool);
63         ///
64         bool appendix() const;
65         ///
66         void appendix(bool);
67         ///
68         std::string const & labelString() const;
69         ///
70         void labelString(std::string const &);
71         ///
72         std::string const & labelWidthString() const;
73         ///
74         void labelWidthString(std::string const &);
75         ///
76         LyXLength const & leftIndent() const;
77         ///
78         void leftIndent(LyXLength const &);
79
80         /// read the parameters from a lex
81         void read(LyXLex & lex);
82
83         /// write out the parameters to a stream
84         void write(std::ostream & os) const;
85
86 private:
87         ///
88         void set_from_struct(ParameterStruct const &);
89         ///
90         boost::shared_ptr<ParameterStruct> param;
91         ///
92         static ShareContainer<ParameterStruct> container;
93 };
94
95
96 /** Generate a string \param data from \param par's ParagraphParameters.
97     The function also generates some additional info needed by the
98     Paragraph dialog.
99  */
100 void params2string(Paragraph const & par, std::string & data);
101
102 /** Given \param data, an encoding of the ParagraphParameters generated
103     in the Paragraph dialog, this function sets the current paragraph
104     appropriately.
105  */
106 void setParagraphParams(BufferView & bv, std::string const & data);
107
108 #endif