2003-07-25 17:11:25 +00:00
|
|
|
// -*- C++ -*-
|
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
|
|
|
|
*
|
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
|
|
|
*/
|
|
|
|
|
|
|
|
#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 &);
|
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
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string placement;
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
|
|
|
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:
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
InsetWrap(BufferParams const &, std::string const &);
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
|
|
|
~InsetWrap();
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
void write(Buffer const & buf, std::ostream & os) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
void read(Buffer const & buf, LyXLex & lex);
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
|
|
|
///
|
2003-07-25 17:11:25 +00:00
|
|
|
virtual std::auto_ptr<InsetBase> clone() const;
|
2003-05-26 09:13:55 +00:00
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
InsetOld::Code lyxCode() const { return InsetOld::WRAP_CODE; }
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
int latex(Buffer const &, std::ostream &,
|
2003-05-23 08:59:47 +00:00
|
|
|
LatexRunParams const &) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
int docbook(Buffer const &, std::ostream &, bool mixcont) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const editMessage() const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
bool insetAllowed(InsetOld::Code) const;
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
void addToToc(lyx::toc::TocList &, Buffer const &) const;
|
2002-09-24 18:36:20 +00:00
|
|
|
///
|
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_; }
|
2003-10-17 18:01:15 +00:00
|
|
|
protected:
|
|
|
|
///
|
|
|
|
virtual
|
|
|
|
dispatch_result
|
|
|
|
priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
|
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);
|
|
|
|
///
|
2003-03-10 13:33:39 +00:00
|
|
|
virtual InsetBase & inset() const { return inset_; }
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual std::string const & name() const { return name_; }
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual std::string const inset2string(Buffer const &) const;
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
static void string2params(std::string const &, InsetWrapParams &);
|
2003-03-05 23:19:45 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
static std::string const params2string(InsetWrapParams const &);
|
2003-03-05 23:19:45 +00:00
|
|
|
private:
|
2002-09-10 10:18:58 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
static std::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
|