]> git.lyx.org Git - lyx.git/blob - src/insets/insetcaption.h
Output docbook as utf8. Probably quite a bit more work needed, but then help form...
[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 /** A caption inset
20 */
21 class InsetCaption : public InsetText {
22 public:
23         ///
24         InsetCaption(BufferParams const &);
25         ///
26         void write(Buffer const & buf, std::ostream & os) const;
27         ///
28         void read(Buffer const & buf, LyXLex & lex);
29         ///
30         virtual bool display() const;
31         ///
32         virtual bool neverIndent() const { return true; }
33         ///
34         virtual InsetBase::Code lyxCode() const;
35         ///
36         virtual lyx::docstring const editMessage() const;
37         ///
38         virtual void cursorPos(BufferView const & bv,
39                 CursorSlice const & sl, bool boundary, int & x, int & y) const;
40         ///
41         bool descendable() const { return true; }
42         ///
43         virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
44         ///
45         virtual void draw(PainterInfo & pi, int x, int y) const;
46         ///
47         virtual void edit(LCursor & cur, bool left);
48         ///
49         virtual InsetBase * editXY(LCursor & cur, int x, int y);
50         ///
51         virtual int latex(Buffer const & buf, lyx::odocstream & os,
52                           OutputParams const &) const;
53         ///
54         int plaintext(Buffer const & buf, lyx::odocstream & os,
55                   OutputParams const & runparams) const;
56         ///
57         int docbook(Buffer const & buf, lyx::odocstream & os,
58                     OutputParams const & runparams) const;
59         ///
60         void setCount(int c) { counter_ = c; }
61 private:
62         ///
63         void setLabel(LCursor & cur) const;
64         ///
65         virtual std::auto_ptr<InsetBase> doClone() const;
66         ///
67         mutable std::string label;
68         ///
69         mutable int labelwidth_;
70         ///
71         mutable int counter_;
72         ///
73         LyXTextClass const & textclass_;
74 };
75
76
77 inline
78 bool InsetCaption::display() const
79 {
80         return true;
81 }
82
83
84 inline
85 InsetBase::Code InsetCaption::lyxCode() const
86 {
87         return CAPTION_CODE;
88 }
89
90 #endif