]> git.lyx.org Git - lyx.git/blob - src/insets/InsetCaptionable.h
Less expensive OP first as this might be called often.
[lyx.git] / src / insets / InsetCaptionable.h
1 // -*- C++ -*-
2 /**
3  * \file InsetCaptionable.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author Jürgen Vigna
9  * \author Lars Gullik Bjønnes
10  * \author Guillaume Munch
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef INSET_CAPTIONABLE_H
16 #define INSET_CAPTIONABLE_H
17
18 #include "InsetCollapsible.h"
19
20
21 namespace lyx {
22
23 class InsetCaption;
24 class InsetLabel;
25
26 class InsetCaptionable : public InsetCollapsible
27 {
28 public:
29         InsetCaptionable(Buffer * buffer, std::string const & type = "senseless")
30                 : InsetCollapsible(buffer), caption_type_(type) {}
31         ///
32         std::string const & captionType() const { return caption_type_; }
33         ///
34         docstring floatName(std::string const & type) const;
35         ///
36 protected:
37         ///
38         InsetCaption const * getCaptionInset() const;
39         ///
40         InsetLabel const * getLabelInset() const;
41         ///
42         docstring getCaptionText(OutputParams const &) const;
43         ///
44         docstring getCaptionHTML(OutputParams const &) const;
45         ///
46         docstring getCaptionDocBook(OutputParams const &) const;
47         ///
48         virtual void setCaptionType(std::string const & type);
49         /// are our captions subcaptions?
50         virtual bool hasSubCaptions(ParIterator const &) const { return false; }
51         ///
52         void addToToc(DocIterator const & di, bool output_active,
53                                   UpdateType utype, TocBackend & backend) const override;
54         /// Update the counters of this inset and of its contents
55         void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
56         ///
57         bool insetAllowed(InsetCode) const override;
58 private:
59         ///
60         std::string caption_type_;
61 };
62
63
64 } // namespace lyx
65
66 #endif // INSET_CAPTIONABLE_H