2002-09-10 10:18:58 +00:00
|
|
|
/**
|
|
|
|
* \file insetwrap.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Dekel Tsur
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef InsetWrap_H
|
|
|
|
#define InsetWrap_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "insetcollapsable.h"
|
2002-09-24 18:36:20 +00:00
|
|
|
#include "toc.h"
|
2002-09-10 10:18:58 +00:00
|
|
|
#include "lyxlength.h"
|
|
|
|
|
|
|
|
|
2003-03-05 23:19:45 +00:00
|
|
|
struct InsetWrapParams {
|
|
|
|
///
|
|
|
|
void write(std::ostream &) const;
|
|
|
|
///
|
|
|
|
void read(LyXLex &);
|
|
|
|
|
|
|
|
///
|
|
|
|
string type;
|
|
|
|
///
|
|
|
|
string placement;
|
|
|
|
///
|
|
|
|
LyXLength width;
|
|
|
|
};
|
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:
|
|
|
|
///
|
|
|
|
InsetWrap(BufferParams const &, string const &);
|
|
|
|
///
|
|
|
|
InsetWrap(InsetWrap const &, bool same_id = false);
|
|
|
|
///
|
|
|
|
~InsetWrap();
|
|
|
|
///
|
2003-03-05 23:19:45 +00:00
|
|
|
virtual dispatch_result localDispatch(FuncRequest const & cmd);
|
|
|
|
///
|
2002-09-10 10:18:58 +00:00
|
|
|
void write(Buffer const * buf, std::ostream & os) const;
|
|
|
|
///
|
|
|
|
void read(Buffer const * buf, LyXLex & lex);
|
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
|
|
|
///
|
|
|
|
Inset * clone(Buffer const &, bool same_id = false) const;
|
|
|
|
///
|
|
|
|
Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
|
|
|
|
///
|
|
|
|
int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const;
|
|
|
|
///
|
|
|
|
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
|
|
|
|
///
|
|
|
|
string const editMessage() const;
|
|
|
|
///
|
|
|
|
bool insetAllowed(Inset::Code) const;
|
|
|
|
///
|
|
|
|
int getMaxWidth(BufferView *, UpdatableInset const *) const;
|
|
|
|
///
|
|
|
|
string const & type() const;
|
|
|
|
///
|
|
|
|
LyXLength const & pageWidth() const;
|
2002-12-01 22:59:25 +00:00
|
|
|
///
|
|
|
|
void pageWidth(LyXLength const &);
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
|
|
|
void placement(string const & p);
|
|
|
|
///
|
|
|
|
string const & placement() const;
|
|
|
|
///
|
2002-09-24 18:36:20 +00:00
|
|
|
void addToToc(toc::TocList &, Buffer const *) const;
|
|
|
|
///
|
2002-09-10 10:18:58 +00:00
|
|
|
bool showInsetDialog(BufferView *) const;
|
|
|
|
///
|
|
|
|
int latexTextWidth(BufferView *) const;
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
|
|
|
InsetWrapParams const & params() const { return params_; }
|
2002-09-10 10:18:58 +00:00
|
|
|
private:
|
|
|
|
///
|
2003-03-05 23:19:45 +00:00
|
|
|
InsetWrapParams params_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "mailinset.h"
|
|
|
|
|
|
|
|
|
|
|
|
class InsetWrapMailer : public MailInset {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetWrapMailer(InsetWrap & inset);
|
|
|
|
///
|
|
|
|
virtual Inset & inset() const { return inset_; }
|
|
|
|
///
|
|
|
|
virtual string const & name() const { return name_; }
|
|
|
|
///
|
|
|
|
virtual string const inset2string() const;
|
|
|
|
///
|
|
|
|
static void string2params(string const &, InsetWrapParams &);
|
|
|
|
///
|
2003-03-07 14:08:10 +00:00
|
|
|
static string const params2string(InsetWrapParams const &);
|
2003-03-05 23:19:45 +00:00
|
|
|
private:
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-03-07 14:08:10 +00:00
|
|
|
static string const name_;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-03-05 23:19:45 +00:00
|
|
|
InsetWrap & inset_;
|
2002-09-10 10:18:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|