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 bool insetAllowed(InsetBase::Code code) const;
57 virtual bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
59 virtual bool wide() const { return false; }
61 virtual int latex(Buffer const & buf, odocstream & os,
62 OutputParams const &) const;
64 int plaintext(Buffer const & buf, odocstream & os,
65 OutputParams const & runparams) const;
67 int docbook(Buffer const & buf, odocstream & os,
68 OutputParams const & runparams) const;
70 void setCount(int c) { counter_ = c; }
72 void setType(std::string const & type) { type_ = type; }
74 void setCustomLabel(docstring const & label);
76 void addToToc(TocList &, Buffer const &) const;
80 virtual std::auto_ptr<InsetBase> doClone() const;
82 mutable docstring full_label_;
84 mutable int labelwidth_;
88 docstring custom_label_;
92 LyXTextClass const & textclass_;
97 bool InsetCaption::display() const
104 InsetBase::Code InsetCaption::lyxCode() const