2000-06-28 13:35:52 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetFloat.h
|
2002-09-25 14:26:13 +00:00
|
|
|
* 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
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Jürgen Vigna
|
|
|
|
* \author Lars Gullik Bjø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
|
|
|
*/
|
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
#ifndef INSET_FLOAT_H
|
|
|
|
#define INSET_FLOAT_H
|
2000-06-28 13:35:52 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "InsetCollapsable.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2002-05-29 16:21:03 +00:00
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
class InsetFloatParams {
|
|
|
|
public:
|
2003-03-05 17:56:47 +00:00
|
|
|
///
|
2008-03-02 11:30:50 +00:00
|
|
|
InsetFloatParams() : wide(false), sideways(false), subfloat(false) {}
|
2003-03-05 17:56:47 +00:00
|
|
|
///
|
2003-03-05 19:46:08 +00:00
|
|
|
void write(std::ostream & os) const;
|
|
|
|
///
|
2007-04-26 11:30:54 +00:00
|
|
|
void read(Lexer & lex);
|
2003-03-05 19:46:08 +00:00
|
|
|
///
|
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;
|
2008-05-31 12:28:16 +00:00
|
|
|
/// span columns
|
2003-03-05 17:56:47 +00:00
|
|
|
bool wide;
|
2004-03-29 11:38:39 +00:00
|
|
|
///
|
|
|
|
bool sideways;
|
2008-03-02 11:30:50 +00:00
|
|
|
///
|
|
|
|
bool subfloat;
|
2003-03-05 17:56:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// InsetFloat
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/// Used for "floating" objects like tables, figures etc.
|
|
|
|
class InsetFloat : public InsetCollapsable
|
|
|
|
{
|
2000-06-28 13:35:52 +00:00
|
|
|
public:
|
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
InsetFloat(Buffer *, std::string const &);
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2001-07-30 11:56:00 +00:00
|
|
|
~InsetFloat();
|
2008-03-27 22:26:24 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
static void string2params(std::string const &, InsetFloatParams &);
|
|
|
|
///
|
|
|
|
static std::string params2string(InsetFloatParams const &);
|
|
|
|
///
|
2009-07-13 12:56:20 +00:00
|
|
|
void setWide(bool w, bool update_label = true);
|
2008-03-27 22:26:24 +00:00
|
|
|
///
|
2009-07-13 12:56:20 +00:00
|
|
|
void setSideways(bool s, bool update_label = true);
|
2008-03-27 22:26:24 +00:00
|
|
|
///
|
2009-07-13 12:56:20 +00:00
|
|
|
void setSubfloat(bool s, bool update_label = true);
|
2008-08-19 14:56:12 +00:00
|
|
|
///
|
2009-07-13 12:56:20 +00:00
|
|
|
void setNewLabel();
|
2008-03-27 22:26:24 +00:00
|
|
|
///
|
|
|
|
InsetFloatParams const & params() const { return params_; }
|
|
|
|
private:
|
2003-03-05 19:46:08 +00:00
|
|
|
///
|
2008-11-05 15:35:02 +00:00
|
|
|
docstring name() const;
|
2007-04-29 12:32:14 +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
|
|
|
void write(std::ostream & os) const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void read(Lexer & 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
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
InsetCode lyxCode() const { return FLOAT_CODE; }
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
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;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
2001-03-23 08:37:44 +00:00
|
|
|
///
|
2009-11-30 17:20:37 +00:00
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
2009-06-19 12:49:08 +00:00
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
bool insetAllowed(InsetCode) 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
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
bool showInsetDialog(BufferView *) const;
|
2005-04-22 08:57:22 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
2007-08-12 21:43:58 +00:00
|
|
|
// Update the counters of this inset and of its contents
|
2009-12-04 03:03:38 +00:00
|
|
|
void updateLabels(ParIterator const &, bool);
|
2007-04-29 12:32:14 +00:00
|
|
|
///
|
2008-03-05 00:21:05 +00:00
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
|
|
|
///
|
|
|
|
Inset * clone() const { return new InsetFloat(*this); }
|
2000-07-15 23:51:46 +00:00
|
|
|
///
|
2008-03-02 11:30:50 +00:00
|
|
|
docstring getCaption(OutputParams const &) const;
|
|
|
|
///
|
2003-03-05 17:56:47 +00:00
|
|
|
InsetFloatParams params_;
|
2007-04-29 12:32:14 +00:00
|
|
|
///
|
|
|
|
docstring name_;
|
2000-06-28 13:35:52 +00:00
|
|
|
};
|
|
|
|
|
2003-03-05 19:46:08 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2008-03-27 22:26:24 +00:00
|
|
|
#endif // INSET_FLOAT_H
|