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"
21 class InsetCaption : public InsetText {
24 InsetCaption(BufferParams const &);
26 void write(Buffer const & buf, std::ostream & os) const;
28 void read(Buffer const & buf, LyXLex & lex);
30 virtual bool display() const;
32 virtual bool neverIndent() const { return true; }
34 virtual InsetBase::Code lyxCode() const;
36 virtual lyx::docstring const editMessage() const;
38 virtual void cursorPos(BufferView const & bv,
39 CursorSlice const & sl, bool boundary, int & x, int & y) const;
41 bool descendable() const { return true; }
43 virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
45 virtual void draw(PainterInfo & pi, int x, int y) const;
47 virtual void edit(LCursor & cur, bool left);
49 virtual InsetBase * editXY(LCursor & cur, int x, int y);
51 virtual int latex(Buffer const & buf, lyx::odocstream & os,
52 OutputParams const &) const;
54 int plaintext(Buffer const & buf, lyx::odocstream & os,
55 OutputParams const & runparams) const;
57 int docbook(Buffer const & buf, std::ostream & os,
58 OutputParams const & runparams) const;
60 void setCount(int c) { counter_ = c; }
63 void setLabel(LCursor & cur) const;
65 virtual std::auto_ptr<InsetBase> doClone() const;
67 mutable std::string label;
69 mutable int labelwidth_;
73 LyXTextClass const & textclass_;
78 bool InsetCaption::display() const
85 InsetBase::Code InsetCaption::lyxCode() const