2001-03-06 14:07:14 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* \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<EFBFBD>nnes
|
|
|
|
|
* \author Angus Leeming
|
|
|
|
|
* \author John Levon
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
2001-03-06 14:07:14 +00:00
|
|
|
|
|
|
|
|
|
#ifndef PARAGRAPHPARAMETERS_H
|
|
|
|
|
#define PARAGRAPHPARAMETERS_H
|
|
|
|
|
|
|
|
|
|
#include "layout.h"
|
2003-09-06 20:32:37 +00:00
|
|
|
|
#include "ShareContainer.h"
|
2001-08-03 18:28:11 +00:00
|
|
|
|
|
2003-09-06 20:32:37 +00:00
|
|
|
|
#include "support/types.h"
|
2001-03-06 14:07:14 +00:00
|
|
|
|
|
2003-09-06 20:32:37 +00:00
|
|
|
|
#include "support/std_string.h"
|
2003-03-12 06:53:49 +00:00
|
|
|
|
#include <iosfwd>
|
|
|
|
|
|
2003-09-06 20:32:37 +00:00
|
|
|
|
class BufferView;
|
|
|
|
|
class LyXLength;
|
2003-03-12 06:53:49 +00:00
|
|
|
|
class LyXLex;
|
2003-03-13 13:56:25 +00:00
|
|
|
|
class Paragraph;
|
2003-09-06 20:32:37 +00:00
|
|
|
|
class ParameterStruct;
|
|
|
|
|
class Spacing;
|
|
|
|
|
class VSpace;
|
2001-03-06 14:07:14 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
class ParagraphParameters {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
ParagraphParameters();
|
|
|
|
|
///
|
|
|
|
|
void clear();
|
|
|
|
|
///
|
|
|
|
|
bool sameLayout(ParagraphParameters const &) const;
|
|
|
|
|
///
|
|
|
|
|
VSpace const & spaceTop() const;
|
|
|
|
|
///
|
|
|
|
|
void spaceTop(VSpace const &);
|
|
|
|
|
///
|
|
|
|
|
VSpace const & spaceBottom() const;
|
|
|
|
|
///
|
|
|
|
|
void spaceBottom(VSpace const &);
|
|
|
|
|
///
|
|
|
|
|
Spacing const & spacing() const;
|
|
|
|
|
///
|
|
|
|
|
void spacing(Spacing const &);
|
|
|
|
|
///
|
|
|
|
|
bool noindent() const;
|
|
|
|
|
///
|
|
|
|
|
void noindent(bool);
|
|
|
|
|
///
|
|
|
|
|
bool lineTop() const;
|
|
|
|
|
///
|
|
|
|
|
void lineTop(bool);
|
|
|
|
|
///
|
|
|
|
|
bool lineBottom() const;
|
|
|
|
|
///
|
|
|
|
|
void lineBottom(bool);
|
|
|
|
|
///
|
|
|
|
|
bool pagebreakTop() const;
|
|
|
|
|
///
|
|
|
|
|
void pagebreakTop(bool);
|
|
|
|
|
///
|
|
|
|
|
bool pagebreakBottom() const;
|
|
|
|
|
///
|
|
|
|
|
void pagebreakBottom(bool);
|
|
|
|
|
///
|
|
|
|
|
LyXAlignment align() const;
|
|
|
|
|
///
|
|
|
|
|
void align(LyXAlignment);
|
|
|
|
|
///
|
2003-09-06 17:23:08 +00:00
|
|
|
|
typedef lyx::depth_type depth_type;
|
2001-03-06 14:07:14 +00:00
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
|
depth_type depth() const;
|
|
|
|
|
///
|
|
|
|
|
void depth(depth_type);
|
2001-03-06 14:07:14 +00:00
|
|
|
|
///
|
|
|
|
|
bool startOfAppendix() const;
|
|
|
|
|
///
|
|
|
|
|
void startOfAppendix(bool);
|
|
|
|
|
///
|
|
|
|
|
bool appendix() const;
|
|
|
|
|
///
|
|
|
|
|
void appendix(bool);
|
|
|
|
|
///
|
|
|
|
|
string const & labelString() const;
|
|
|
|
|
///
|
|
|
|
|
void labelString(string const &);
|
|
|
|
|
///
|
|
|
|
|
string const & labelWidthString() const;
|
|
|
|
|
///
|
|
|
|
|
void labelWidthString(string const &);
|
2002-05-08 12:58:16 +00:00
|
|
|
|
///
|
|
|
|
|
LyXLength const & leftIndent() const;
|
|
|
|
|
///
|
|
|
|
|
void leftIndent(LyXLength const &);
|
2003-03-12 06:53:49 +00:00
|
|
|
|
|
|
|
|
|
/// read the parameters from a lex
|
|
|
|
|
void read(LyXLex & lex);
|
|
|
|
|
|
|
|
|
|
/// write out the parameters to a stream
|
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
|
|
2001-03-06 14:07:14 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
|
|
|
|
void set_from_struct(ParameterStruct const &);
|
|
|
|
|
///
|
|
|
|
|
boost::shared_ptr<ParameterStruct> param;
|
|
|
|
|
///
|
|
|
|
|
static ShareContainer<ParameterStruct> container;
|
|
|
|
|
};
|
2001-04-17 15:15:59 +00:00
|
|
|
|
|
|
|
|
|
|
2003-03-13 13:56:25 +00:00
|
|
|
|
/** 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, 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, string const & data);
|
|
|
|
|
|
2001-03-06 14:07:14 +00:00
|
|
|
|
#endif
|