2000-06-28 13:35:52 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetfloat.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2000-06-28 13:35:52 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2000-06-28 13:35:52 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2003-05-13 16:24:49 +00:00
|
|
|
|
#ifndef INSETFLOAT_H
|
|
|
|
|
#define INSETFLOAT_H
|
2000-06-28 13:35:52 +00:00
|
|
|
|
|
|
|
|
|
#include "insetcollapsable.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
#include "mailinset.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2002-05-29 16:21:03 +00:00
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
|
class InsetFloatParams {
|
|
|
|
|
public:
|
2003-03-05 17:56:47 +00:00
|
|
|
|
///
|
2004-03-29 11:38:39 +00:00
|
|
|
|
InsetFloatParams() : wide(false), sideways(false) {}
|
2003-03-05 17:56:47 +00:00
|
|
|
|
///
|
2003-03-05 19:46:08 +00:00
|
|
|
|
void write(std::ostream & os) const;
|
|
|
|
|
///
|
|
|
|
|
void read(LyXLex & lex);
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string type;
|
2003-03-05 17:56:47 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string placement;
|
2003-03-05 17:56:47 +00:00
|
|
|
|
///
|
|
|
|
|
bool wide;
|
2004-03-29 11:38:39 +00:00
|
|
|
|
///
|
|
|
|
|
bool sideways;
|
2003-03-05 17:56:47 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
/** The float inset
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
*/
|
|
|
|
|
class InsetFloat : public InsetCollapsable {
|
|
|
|
|
public:
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
InsetFloat(BufferParams const &, std::string const &);
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2001-07-30 11:56:00 +00:00
|
|
|
|
~InsetFloat();
|
2003-03-05 19:46:08 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void write(Buffer const & buf, std::ostream & os) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
|
void read(Buffer const & buf, LyXLex & lex);
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
|
InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2007-02-05 17:39:42 +00:00
|
|
|
|
virtual bool wide() const { return false; }
|
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int latex(Buffer const &, odocstream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int docbook(Buffer const &, odocstream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2001-03-23 08:37:44 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
virtual docstring const editMessage() const;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
|
bool insetAllowed(InsetBase::Code) const;
|
2002-07-23 21:03:38 +00:00
|
|
|
|
/** returns true if, when outputing LaTeX, font changes should
|
2002-12-01 22:59:25 +00:00
|
|
|
|
be closed before generating this inset. This is needed for
|
|
|
|
|
insets that may contain several paragraphs */
|
2002-07-23 21:03:38 +00:00
|
|
|
|
bool noFontChange() const { return true; }
|
2000-06-28 13:35:52 +00:00
|
|
|
|
///
|
2002-08-27 15:51:19 +00:00
|
|
|
|
void wide(bool w, BufferParams const &);
|
2000-07-15 23:51:46 +00:00
|
|
|
|
///
|
2004-03-29 11:38:39 +00:00
|
|
|
|
void sideways(bool s, BufferParams const &);
|
|
|
|
|
///
|
2006-11-13 16:53:49 +00:00
|
|
|
|
void addToToc(TocList &, Buffer const &) const;
|
2002-07-21 21:21:06 +00:00
|
|
|
|
///
|
2001-07-30 11:56:00 +00:00
|
|
|
|
bool showInsetDialog(BufferView *) const;
|
|
|
|
|
///
|
2003-03-05 17:56:47 +00:00
|
|
|
|
InsetFloatParams const & params() const { return params_; }
|
2005-04-22 08:57:22 +00:00
|
|
|
|
///
|
|
|
|
|
bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
|
2003-10-17 18:01:15 +00:00
|
|
|
|
protected:
|
2004-11-24 21:58:42 +00:00
|
|
|
|
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
|
2003-03-05 17:56:47 +00:00
|
|
|
|
private:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
|
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
|
///
|
2003-03-05 17:56:47 +00:00
|
|
|
|
InsetFloatParams params_;
|
2000-06-28 13:35:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2003-03-05 19:46:08 +00:00
|
|
|
|
|
|
|
|
|
class InsetFloatMailer : public MailInset {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
InsetFloatMailer(InsetFloat & inset);
|
|
|
|
|
///
|
2003-03-10 13:33:39 +00:00
|
|
|
|
virtual InsetBase & inset() const { return inset_; }
|
2003-03-05 19:46:08 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual std::string const & name() const { return name_; }
|
2003-03-05 19:46:08 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
virtual std::string const inset2string(Buffer const &) const;
|
2003-03-05 19:46:08 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static void string2params(std::string const &, InsetFloatParams &);
|
2003-03-05 19:46:08 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static std::string const params2string(InsetFloatParams const &);
|
2003-03-05 19:46:08 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static std::string const name_;
|
2003-03-05 19:46:08 +00:00
|
|
|
|
///
|
|
|
|
|
InsetFloat & inset_;
|
|
|
|
|
};
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
|
#endif
|