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
16 #include "insettext.h"
17 #include "lyxtextclass.h"
24 class InsetCaption : public InsetText {
27 InsetCaption(BufferParams const &);
29 void write(Buffer const & buf, std::ostream & os) const;
31 void read(Buffer const & buf, LyXLex & lex);
33 virtual bool display() const;
35 virtual bool neverIndent(Buffer const &) const { return true; }
37 virtual InsetBase::Code lyxCode() const;
39 virtual docstring const 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(LCursor & cur, bool left);
52 virtual InsetBase * editXY(LCursor & cur, int x, int y);
54 virtual int latex(Buffer const & buf, odocstream & os,
55 OutputParams const &) const;
57 int plaintext(Buffer const & buf, odocstream & os,
58 OutputParams const & runparams) const;
60 int docbook(Buffer const & buf, odocstream & os,
61 OutputParams const & runparams) const;
63 void setCount(int c) { counter_ = c; }
66 void setLabel(LCursor & cur) const;
68 virtual std::auto_ptr<InsetBase> doClone() const;
70 mutable std::string label;
72 mutable int labelwidth_;
76 LyXTextClass const & textclass_;
81 bool InsetCaption::display() const
88 InsetBase::Code InsetCaption::lyxCode() const