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
|
|
|
|
|
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_string.h"
|
2002-05-24 10:39:34 +00:00
|
|
|
|
#include "ShareContainer.h"
|
2001-03-06 14:07:14 +00:00
|
|
|
|
#include "layout.h"
|
2001-08-03 18:28:11 +00:00
|
|
|
|
|
2001-04-17 15:15:59 +00:00
|
|
|
|
#include "ParameterStruct.h"
|
2001-03-06 14:07:14 +00:00
|
|
|
|
|
2003-03-12 06:53:49 +00:00
|
|
|
|
#include <iosfwd>
|
|
|
|
|
|
2001-03-06 14:07:14 +00:00
|
|
|
|
class VSpace;
|
|
|
|
|
class Spacing;
|
2003-03-12 06:53:49 +00:00
|
|
|
|
class LyXLex;
|
2003-03-13 13:56:25 +00:00
|
|
|
|
class Paragraph;
|
2001-04-17 15:15:59 +00:00
|
|
|
|
|
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);
|
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
|
typedef ParameterStruct::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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline
|
2001-06-25 00:06:33 +00:00
|
|
|
|
ParagraphParameters::depth_type ParagraphParameters::depth() const
|
2001-04-17 15:15:59 +00:00
|
|
|
|
{
|
|
|
|
|
return param->depth;
|
|
|
|
|
}
|
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
|