2015-09-02 18:53:13 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file InsetCaptionable.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
* \author Jürgen Vigna
|
|
|
|
* \author Lars Gullik Bjønnes
|
|
|
|
* \author Guillaume Munch
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSET_CAPTIONABLE_H
|
|
|
|
#define INSET_CAPTIONABLE_H
|
|
|
|
|
2017-10-16 08:12:21 +00:00
|
|
|
#include "InsetCollapsible.h"
|
2015-09-02 18:53:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2017-10-16 08:12:21 +00:00
|
|
|
class InsetCaptionable : public InsetCollapsible
|
2015-09-02 18:53:13 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-09-23 22:49:00 +00:00
|
|
|
InsetCaptionable(Buffer * buffer, std::string const & type = "senseless")
|
2017-10-16 08:12:21 +00:00
|
|
|
: InsetCollapsible(buffer), caption_type_(type) {}
|
2015-09-02 18:53:13 +00:00
|
|
|
///
|
|
|
|
std::string const & captionType() const { return caption_type_; }
|
|
|
|
///
|
|
|
|
docstring floatName(std::string const & type) const;
|
|
|
|
///
|
|
|
|
protected:
|
2016-09-23 22:49:00 +00:00
|
|
|
///
|
|
|
|
InsetCaption const * getCaptionInset() const;
|
|
|
|
///
|
|
|
|
docstring getCaptionText(OutputParams const &) const;
|
|
|
|
///
|
|
|
|
docstring getCaptionHTML(OutputParams const &) const;
|
2015-09-02 18:53:13 +00:00
|
|
|
///
|
2020-06-08 21:27:49 +00:00
|
|
|
docstring getCaptionDocBook(OutputParams const &) const;
|
|
|
|
///
|
2015-09-02 18:53:13 +00:00
|
|
|
virtual void setCaptionType(std::string const & type);
|
|
|
|
/// are our captions subcaptions?
|
|
|
|
virtual bool hasSubCaptions(ParIterator const &) const { return false; }
|
|
|
|
///
|
2015-09-27 06:05:00 +00:00
|
|
|
void addToToc(DocIterator const & di, bool output_active,
|
2020-10-01 07:42:11 +00:00
|
|
|
UpdateType utype, TocBackend & backend) const override;
|
2015-09-02 18:53:13 +00:00
|
|
|
/// Update the counters of this inset and of its contents
|
2020-10-01 07:42:11 +00:00
|
|
|
void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
|
2015-09-02 18:53:13 +00:00
|
|
|
///
|
2020-10-01 07:42:11 +00:00
|
|
|
bool insetAllowed(InsetCode) const override;
|
2015-09-02 18:53:13 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
std::string caption_type_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // INSET_CAPTIONABLE_H
|