2000-06-28 13:35:52 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
/**
|
|
|
|
* \file Floating.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FLOATING_H
|
|
|
|
#define FLOATING_H
|
|
|
|
|
2016-09-25 10:37:40 +00:00
|
|
|
#include "support/strfwd.h"
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
#include <string>
|
2000-12-31 05:32:33 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
2016-09-25 10:37:40 +00:00
|
|
|
|
2000-07-15 23:51:46 +00:00
|
|
|
/** This is a "float layout" object. It contains the parameters for how to
|
2004-10-05 10:11:42 +00:00
|
|
|
* handle the different kinds of floats, default ones and user created ones.
|
|
|
|
* Objects of this class is stored in a container in FloatList. The different
|
|
|
|
* InsetFloat(s) have a pointer/reference through the name of the Floating
|
|
|
|
* so that it knows how the different floats should be handled.
|
|
|
|
*/
|
2000-06-28 13:35:52 +00:00
|
|
|
class Floating {
|
|
|
|
public:
|
|
|
|
///
|
2015-05-22 16:59:17 +00:00
|
|
|
Floating() : usesfloatpkg_(false), ispredefined_(false),
|
|
|
|
allowswide_(true), allowssideways_(true) {}
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
Floating(std::string const & type, std::string const & placement,
|
|
|
|
std::string const & ext, std::string const & within,
|
|
|
|
std::string const & style, std::string const & name,
|
2010-03-05 22:58:29 +00:00
|
|
|
std::string const & listName, std::string const & listCmd,
|
2015-05-22 08:37:14 +00:00
|
|
|
std::string const & refPrefix, std::string const & allowedplacement,
|
|
|
|
std::string const & htmlType, std::string const & htmlClass,
|
2016-09-25 10:37:40 +00:00
|
|
|
docstring const & htmlStyle, bool usesfloat, bool isprefined,
|
2015-05-22 16:59:17 +00:00
|
|
|
bool allowswide, bool allowssideways);
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string const & floattype() const { return floattype_; }
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string const & placement() const { return placement_; }
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string const & ext() const {return ext_; }
|
2001-03-11 03:20:44 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string const & within() const { return within_; }
|
2001-03-11 03:20:44 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string const & style() const { return style_; }
|
2001-03-11 03:20:44 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string const & name() const { return name_; }
|
2010-03-05 21:06:22 +00:00
|
|
|
/// the title of a list of this kind of float
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string const & listName() const { return listname_; }
|
2010-03-05 22:58:29 +00:00
|
|
|
/// the command used to generate that list. this has to be given
|
2011-02-02 22:15:52 +00:00
|
|
|
/// if usesFloatPkg() is false, unless this float uses the same
|
|
|
|
/// auxfile as another defined previously. this should not contain
|
2010-03-05 22:58:29 +00:00
|
|
|
/// the leading "\".
|
|
|
|
std::string const & listCommand() const { return listcommand_; }
|
2010-03-17 12:23:24 +00:00
|
|
|
/// prefix to use for formatted references to such floats
|
|
|
|
std::string const & refPrefix() const { return refprefix_; }
|
2015-05-22 08:37:14 +00:00
|
|
|
/// allowed placement options
|
|
|
|
std::string const & allowedPlacement() const { return allowedplacement_; }
|
2010-03-04 13:42:05 +00:00
|
|
|
///
|
2011-02-02 22:15:52 +00:00
|
|
|
bool usesFloatPkg() const { return usesfloatpkg_; }
|
2011-02-02 22:28:47 +00:00
|
|
|
///
|
|
|
|
bool isPredefined() const { return ispredefined_; }
|
2015-05-22 16:59:17 +00:00
|
|
|
///
|
|
|
|
bool allowsWide() const { return allowswide_; }
|
|
|
|
///
|
|
|
|
bool allowsSideways() const { return allowssideways_; }
|
2009-11-30 16:55:12 +00:00
|
|
|
/// style information, for preamble
|
2016-09-25 10:37:40 +00:00
|
|
|
docstring const & htmlStyle() const { return html_style_; }
|
2009-11-30 17:08:56 +00:00
|
|
|
/// class, for css, defaults to "float-" + type()
|
2010-01-07 17:32:04 +00:00
|
|
|
std::string const & htmlAttrib() const;
|
2009-11-30 17:08:56 +00:00
|
|
|
/// tag type, defaults to "div"
|
|
|
|
std::string const & htmlTag() const;
|
2000-12-29 12:48:02 +00:00
|
|
|
private:
|
2010-01-07 17:32:04 +00:00
|
|
|
///
|
|
|
|
std::string defaultCSSClass() const;
|
2000-06-28 13:35:52 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string floattype_;
|
2000-12-29 12:48:02 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string placement_;
|
2000-12-29 12:48:02 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string ext_;
|
2000-12-29 12:48:02 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string within_;
|
2000-12-29 12:48:02 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string style_;
|
2000-12-29 12:48:02 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string name_;
|
2000-12-29 12:48:02 +00:00
|
|
|
///
|
2010-03-04 13:42:05 +00:00
|
|
|
std::string listname_;
|
|
|
|
///
|
2010-03-05 22:58:29 +00:00
|
|
|
std::string listcommand_;
|
2010-03-05 21:06:22 +00:00
|
|
|
///
|
2010-03-17 12:23:24 +00:00
|
|
|
std::string refprefix_;
|
|
|
|
///
|
2015-05-22 08:37:14 +00:00
|
|
|
std::string allowedplacement_;
|
|
|
|
///
|
2011-02-02 22:15:52 +00:00
|
|
|
bool usesfloatpkg_;
|
2011-02-02 22:28:47 +00:00
|
|
|
///
|
|
|
|
bool ispredefined_;
|
2015-05-22 16:59:17 +00:00
|
|
|
///
|
|
|
|
bool allowswide_;
|
|
|
|
///
|
|
|
|
bool allowssideways_;
|
2009-11-30 17:08:56 +00:00
|
|
|
///
|
2009-11-30 20:17:55 +00:00
|
|
|
mutable std::string html_tag_;
|
2009-11-30 17:08:56 +00:00
|
|
|
///
|
2010-01-07 17:32:04 +00:00
|
|
|
mutable std::string html_attrib_;
|
|
|
|
///
|
|
|
|
mutable std::string defaultcssclass_;
|
2009-11-30 17:08:56 +00:00
|
|
|
///
|
2016-09-25 10:37:40 +00:00
|
|
|
docstring html_style_;
|
2000-06-28 13:35:52 +00:00
|
|
|
};
|
2000-12-29 12:48:02 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2000-06-28 13:35:52 +00:00
|
|
|
#endif
|