2003-07-25 17:11:25 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-10 10:18:58 +00:00
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetWrap.h
|
2002-09-10 10:18:58 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Dekel Tsur
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-10 10:18:58 +00:00
|
|
|
*/
|
|
|
|
|
2003-12-01 13:35:49 +00:00
|
|
|
#ifndef INSETWRAP_H
|
|
|
|
#define INSETWRAP_H
|
2002-09-10 10:18:58 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "InsetCollapsable.h"
|
2007-04-28 12:58:49 +00:00
|
|
|
#include "Length.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2002-09-10 10:18:58 +00:00
|
|
|
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
class InsetWrapParams {
|
|
|
|
public:
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
|
|
|
void write(std::ostream &) const;
|
|
|
|
///
|
2007-04-26 11:30:54 +00:00
|
|
|
void read(Lexer &);
|
2003-05-26 09:13:55 +00:00
|
|
|
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string type;
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2007-09-24 13:43:58 +00:00
|
|
|
int lines;
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string placement;
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2007-09-24 13:43:58 +00:00
|
|
|
Length overhang;
|
|
|
|
///
|
2007-04-28 12:58:49 +00:00
|
|
|
Length width;
|
2003-03-05 23:19:45 +00:00
|
|
|
};
|
2002-09-10 10:18:58 +00:00
|
|
|
|
|
|
|
|
2003-03-05 23:19:45 +00:00
|
|
|
/** The wrap inset
|
|
|
|
*/
|
2002-09-10 10:18:58 +00:00
|
|
|
class InsetWrap : public InsetCollapsable {
|
|
|
|
public:
|
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
InsetWrap(Buffer *, std::string const &);
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
|
|
|
~InsetWrap();
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
|
|
|
InsetWrapParams const & params() const { return params_; }
|
2008-03-27 00:07:54 +00:00
|
|
|
///
|
|
|
|
static void string2params(std::string const &, InsetWrapParams &);
|
|
|
|
///
|
|
|
|
static std::string params2string(InsetWrapParams const &);
|
2008-03-05 00:21:05 +00:00
|
|
|
private:
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void write(std::ostream & os) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void read(Lexer & lex);
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
InsetCode lyxCode() const { return WRAP_CODE; }
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2008-04-10 09:22:49 +00:00
|
|
|
docstring toolTip(BufferView const & bv, int x, int y) const;
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int latex(odocstream &, OutputParams const &) const;
|
2007-02-16 08:15:16 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int plaintext(odocstream &, OutputParams const &) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2009-06-12 17:26:48 +00:00
|
|
|
docstring xhtml(odocstream &, OutputParams const &) const;
|
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
bool insetAllowed(InsetCode) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-12-01 13:35:49 +00:00
|
|
|
bool showInsetDialog(BufferView *) const;
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
2009-06-12 16:11:33 +00:00
|
|
|
/// Update the counters of this inset and of its contents
|
2008-02-27 20:43:16 +00:00
|
|
|
void updateLabels(ParIterator const &);
|
2003-10-17 18:01:15 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2007-04-29 12:32:14 +00:00
|
|
|
///
|
2008-04-03 22:39:06 +00:00
|
|
|
docstring name() const;
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
|
|
|
Inset * clone() const { return new InsetWrap(*this); }
|
2004-11-23 23:04:52 +00:00
|
|
|
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-03-05 23:19:45 +00:00
|
|
|
InsetWrapParams params_;
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2002-09-10 10:18:58 +00:00
|
|
|
#endif
|