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"
16 #include "lyxtextclass.h"
23 class InsetCaption : public InsetText {
26 InsetCaption(BufferParams const &);
28 virtual ~InsetCaption() {}
30 void write(Buffer const & buf, std::ostream & os) const;
32 void read(Buffer const & buf, LyXLex & lex);
34 virtual bool display() const;
36 virtual bool neverIndent(Buffer const &) const { return true; }
38 virtual InsetBase::Code lyxCode() const;
40 virtual docstring const editMessage() const;
42 virtual void cursorPos(BufferView const & bv,
43 CursorSlice const & sl, bool boundary, int & x, int & y) const;
45 bool descendable() const { return true; }
47 virtual bool metrics(MetricsInfo & mi, Dimension & dim) const;
49 virtual void draw(PainterInfo & pi, int x, int y) const;
51 virtual void edit(LCursor & cur, bool left);
53 virtual InsetBase * editXY(LCursor & cur, int x, int y);
55 virtual bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
57 virtual bool wide() const { return false; }
59 virtual int latex(Buffer const & buf, odocstream & os,
60 OutputParams const &) const;
62 int plaintext(Buffer const & buf, odocstream & os,
63 OutputParams const & runparams) const;
65 int docbook(Buffer const & buf, odocstream & os,
66 OutputParams const & runparams) const;
68 void setCount(int c) { counter_ = c; }
70 void setType(std::string const & type) { type_ = type; }
72 void setCustomLabel(docstring const & label);
74 void addToToc(TocList &, Buffer const &) const;
78 virtual std::auto_ptr<InsetBase> doClone() const;
80 mutable docstring full_label_;
82 mutable int labelwidth_;
86 docstring custom_label_;
90 LyXTextClass const & textclass_;
95 bool InsetCaption::display() const
102 InsetBase::Code InsetCaption::lyxCode() const