// -*- C++ -*-
+/**
+ * \file ParagraphParameters.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author Angus Leeming
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
#ifndef PARAGRAPHPARAMETERS_H
#define PARAGRAPHPARAMETERS_H
-#include "ShareContainer.h"
-#include "LString.h"
#include "layout.h"
+#include "ShareContainer.h"
-class VSpace;
-class Spacing;
-struct ParameterStruct;
+#include "support/types.h"
-// Not yet... lyx 1.3.x or so
-//#define NO_PEXTRA_REALLY 1
+#include <iosfwd>
+#include <string>
+
+class BufferView;
+class LyXLength;
+class LyXLex;
+class Paragraph;
+class ParameterStruct;
+class Spacing;
+class VSpace;
///
class ParagraphParameters {
///
bool sameLayout(ParagraphParameters const &) const;
///
- void makeSame(ParagraphParameters const & pp);
- ///
VSpace const & spaceTop() const;
///
void spaceTop(VSpace const &);
///
void align(LyXAlignment);
///
- char depth() const;
+ typedef lyx::depth_type depth_type;
+ ///
+ depth_type depth() const;
///
- void depth(char);
+ void depth(depth_type);
///
bool startOfAppendix() const;
///
///
void appendix(bool);
///
- string const & labelString() const;
- ///
- void labelString(string const &);
- ///
- string const & labelWidthString() const;
- ///
- void labelWidthString(string const &);
-#ifndef NO_PEXTRA_REALLY
- ///
- int pextraType() const;
- ///
- void pextraType(int);
+ std::string const & labelString() const;
///
- string const & pextraWidth() const;
+ void labelString(std::string const &);
///
- void pextraWidth(string const &);
+ std::string const & labelWidthString() const;
///
- string const & pextraWidthp() const;
+ void labelWidthString(std::string const &);
///
- void pextraWidthp(string const &);
+ LyXLength const & leftIndent() const;
///
- int pextraAlignment() const;
- ///
- void pextraAlignment(int);
- ///
- bool pextraHfill() const;
- ///
- void pextraHfill(bool);
- ///
- bool pextraStartMinipage() const;
- ///
- void pextraStartMinipage(bool);
-#endif
+ void leftIndent(LyXLength const &);
+
+ /// read the parameters from a lex
+ void read(LyXLex & lex);
+
+ /// write out the parameters to a stream
+ void write(std::ostream & os) const;
+
private:
///
void set_from_struct(ParameterStruct const &);
///
static ShareContainer<ParameterStruct> container;
};
+
+
+/** Generate a string \param data from \param par's ParagraphParameters.
+ The function also generates some additional info needed by the
+ Paragraph dialog.
+ */
+void params2string(Paragraph const & par, std::string & data);
+
+/** Given \param data, an encoding of the ParagraphParameters generated
+ in the Paragraph dialog, this function sets the current paragraph
+ appropriately.
+ */
+void setParagraphParams(BufferView & bv, std::string const & data);
+
#endif