]> git.lyx.org Git - lyx.git/blob - src/insets/InsetCaptionable.h
Enhancements and bugfixes to the TOCs
[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 "InsetCollapsable.h"
19
20
21 namespace lyx {
22
23 class InsetCaptionable : public InsetCollapsable
24 {
25 public:
26         InsetCaptionable(Buffer * buffer)
27                 : InsetCollapsable(buffer), caption_type_("senseless") {}
28         InsetCaptionable(Buffer * buffer, std::string const & type)
29                 : InsetCollapsable(buffer), caption_type_(type) {}
30         ///
31         std::string const & captionType() const { return caption_type_; }
32         ///
33         docstring floatName(std::string const & type) const;
34         ///
35 protected:
36         ///
37         virtual void setCaptionType(std::string const & type);
38         /// are our captions subcaptions?
39         virtual bool hasSubCaptions(ParIterator const &) const { return false; }
40         ///
41         void addToToc(DocIterator const & di, bool output_active,
42                                   UpdateType utype) const;
43         /// Update the counters of this inset and of its contents
44         void updateBuffer(ParIterator const &, UpdateType);
45         ///
46         bool insetAllowed(InsetCode) const;
47 private:
48         ///
49         std::string caption_type_;
50 };
51
52
53 } // namespace lyx
54
55 #endif // INSET_CAPTIONABLE_H