4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSETCAPTION_H
13 #define INSETCAPTION_H
15 #include "InsetText.h"
21 class InsetCaption : public InsetText {
24 InsetCaption(InsetCaption const &);
25 InsetCaption(Buffer const &);
27 virtual ~InsetCaption() {}
29 void write(std::ostream & os) const;
31 void read(Lexer & lex);
33 virtual DisplayType display() const;
35 virtual bool neverIndent() const { return true; }
37 virtual InsetCode lyxCode() const;
39 docstring editMessage() const;
41 virtual void cursorPos(BufferView const & bv,
42 CursorSlice const & sl, bool boundary, int & x, int & y) const;
44 bool descendable() const { return true; }
46 virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
48 virtual void draw(PainterInfo & pi, int x, int y) const;
50 virtual void edit(Cursor & cur, bool front, EntryDirection entry_from);
52 virtual Inset * editXY(Cursor & cur, int x, int y);
54 bool insetAllowed(InsetCode code) const;
56 virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
57 // Update the counters of this inset and of its contents
58 virtual void updateLabels(ParIterator const &);
60 int latex(odocstream & os, OutputParams const &) const;
62 int plaintext(odocstream & os, OutputParams const & runparams) const;
64 int docbook(odocstream & os, OutputParams const & runparams) const;
65 /// return the mandatory argument (LaTeX format) only
66 int getArgument(odocstream & os, OutputParams const &) const;
67 /// return the optional argument(s) only
68 int getOptArg(odocstream & os, OutputParams const &) const;
70 std::string const & type() const { return type_; }
72 void setCustomLabel(docstring const & label);
74 void addToToc(ParConstIterator const &) const;
76 virtual bool forceEmptyLayout() const { return true; }
77 /// Captions don't accept alignment, spacing, etc.
78 virtual bool allowParagraphCustomization(idx_type) const { return false; }
82 virtual Inset * clone() const;
84 mutable docstring full_label_;
86 mutable int labelwidth_;
92 docstring custom_label_;
97 Inset::DisplayType InsetCaption::display() const
104 InsetCode InsetCaption::lyxCode() const