]> git.lyx.org Git - lyx.git/blob - src/insets/insetcaption.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetcaption.h
1 // -*- C++ -*-
2 /**
3  * \file insetcaption.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSETCAPTION_H
13 #define INSETCAPTION_H
14
15
16 #include "insettext.h"
17 #include "lyxtextclass.h"
18
19
20 namespace lyx {
21
22 /** A caption inset
23 */
24 class InsetCaption : public InsetText {
25 public:
26         ///
27         InsetCaption(BufferParams const &);
28         ///
29         void write(Buffer const & buf, std::ostream & os) const;
30         ///
31         void read(Buffer const & buf, LyXLex & lex);
32         ///
33         virtual bool display() const;
34         ///
35         virtual bool neverIndent(Buffer const &) const { return true; }
36         ///
37         virtual InsetBase::Code lyxCode() const;
38         ///
39         virtual docstring const editMessage() const;
40         ///
41         virtual void cursorPos(BufferView const & bv,
42                 CursorSlice const & sl, bool boundary, int & x, int & y) const;
43         ///
44         bool descendable() const { return true; }
45         ///
46         virtual bool metrics(MetricsInfo & mi, Dimension & dim) const;
47         ///
48         virtual void draw(PainterInfo & pi, int x, int y) const;
49         ///
50         virtual void edit(LCursor & cur, bool left);
51         ///
52         virtual InsetBase * editXY(LCursor & cur, int x, int y);
53         ///
54         virtual int latex(Buffer const & buf, odocstream & os,
55                           OutputParams const &) const;
56         ///
57         int plaintext(Buffer const & buf, odocstream & os,
58                   OutputParams const & runparams) const;
59         ///
60         int docbook(Buffer const & buf, odocstream & os,
61                     OutputParams const & runparams) const;
62         ///
63         void setCount(int c) { counter_ = c; }
64 private:
65         ///
66         void setLabel(LCursor & cur) const;
67         ///
68         virtual std::auto_ptr<InsetBase> doClone() const;
69         ///
70         mutable docstring label;
71         ///
72         mutable int labelwidth_;
73         ///
74         mutable int counter_;
75         ///
76         LyXTextClass const & textclass_;
77 };
78
79
80 inline
81 bool InsetCaption::display() const
82 {
83         return true;
84 }
85
86
87 inline
88 InsetBase::Code InsetCaption::lyxCode() const
89 {
90         return CAPTION_CODE;
91 }
92
93
94 } // namespace lyx
95
96 #endif