2003-11-28 15:53:34 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetVSpace.h
|
2003-11-28 15:53:34 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-11-28 15:53:34 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSET_VSPACE_H
|
|
|
|
#define INSET_VSPACE_H
|
|
|
|
|
2007-04-29 13:39:47 +00:00
|
|
|
#include "Inset.h"
|
2007-04-26 04:41:58 +00:00
|
|
|
#include "VSpace.h"
|
2003-11-28 15:53:34 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2008-03-27 00:21:35 +00:00
|
|
|
class InsetVSpace : public Inset
|
|
|
|
{
|
2003-11-28 15:53:34 +00:00
|
|
|
public:
|
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
InsetVSpace() : Inset(0) {}
|
2003-11-28 15:53:34 +00:00
|
|
|
///
|
|
|
|
InsetVSpace(VSpace const &);
|
2008-03-05 00:21:05 +00:00
|
|
|
/// How much?
|
|
|
|
VSpace const & space() const { return space_; }
|
2008-03-24 13:33:48 +00:00
|
|
|
///
|
|
|
|
InsetCode lyxCode() const { return VSPACE_CODE; }
|
|
|
|
///
|
2009-04-22 20:55:13 +00:00
|
|
|
bool hasSettings() const { return true; }
|
2008-03-24 13:33:48 +00:00
|
|
|
///
|
2011-10-29 14:48:55 +00:00
|
|
|
std::string contextMenuName() const;
|
2008-03-27 00:21:35 +00:00
|
|
|
///
|
|
|
|
static void string2params(std::string const &, VSpace &);
|
|
|
|
///
|
|
|
|
static std::string params2string(VSpace const &);
|
2008-03-05 00:21:05 +00:00
|
|
|
private:
|
2003-11-28 17:38:39 +00:00
|
|
|
///
|
2007-09-21 20:39:47 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
///
|
2003-11-28 15:53:34 +00:00
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
///
|
2011-02-10 20:02:48 +00:00
|
|
|
void latex(otexstream &, OutputParams const &) const;
|
2003-11-28 15:53:34 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int plaintext(odocstream &, OutputParams const &) const;
|
2003-11-28 15:53:34 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
2009-11-21 23:16:04 +00:00
|
|
|
/// Note that this returns the inset rather than writing it,
|
|
|
|
/// so it will actually be written after the present paragraph.
|
|
|
|
/// The normal case is that this inset will be on a line by
|
|
|
|
/// itself, and in that case the present paragraph will not,
|
|
|
|
/// in fact, appear at all.
|
2009-11-21 23:02:59 +00:00
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
2009-06-12 15:07:04 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void read(Lexer & lex);
|
2003-11-28 15:53:34 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void write(std::ostream & os) const;
|
2003-11-28 15:53:34 +00:00
|
|
|
///
|
2007-05-18 14:32:29 +00:00
|
|
|
DisplayType display() const { return AlignCenter; }
|
2003-11-28 17:38:39 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
2008-03-24 13:33:48 +00:00
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
|
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
Inset * clone() const { return new InsetVSpace(*this); }
|
2005-09-12 14:57:50 +00:00
|
|
|
///
|
2006-11-11 20:55:40 +00:00
|
|
|
docstring const label() const;
|
2004-11-24 21:58:42 +00:00
|
|
|
|
2003-12-02 12:27:07 +00:00
|
|
|
///
|
2003-11-28 15:53:34 +00:00
|
|
|
VSpace space_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2003-11-28 15:53:34 +00:00
|
|
|
#endif
|