]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibitem.h
use bald pointers in clone()
[lyx.git] / src / insets / InsetBibitem.h
1 // -*- C++ -*-
2 /**
3  * \file InsetBibitem.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_BIBITEM_H
13 #define INSET_BIBITEM_H
14
15
16 #include "InsetCommand.h"
17 #include "BiblioInfo.h"
18
19
20 namespace lyx {
21
22 /** Used to insert bibitem's information (key and label)
23
24   Must be automatically inserted as the first object in a
25   bibliography paragraph.
26   */
27 class InsetBibitem : public InsetCommand {
28 public:
29         ///
30         InsetBibitem(InsetCommandParams const &);
31         ///
32         void read(Buffer const &, Lexer & lex);
33         ///
34         docstring const getScreenLabel(Buffer const &) const;
35         ///
36         EDITABLE editable() const { return IS_EDITABLE; }
37         ///
38         Inset::Code lyxCode() const { return Inset::BIBITEM_CODE; }
39         ///
40         docstring const getBibLabel() const;
41         ///
42         int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
43         ///
44         virtual void fillWithBibKeys(Buffer const &,
45                 BiblioInfo &, InsetIterator const &) const;
46         /// Update the counter of this inset
47         virtual void updateLabels(Buffer const &, ParIterator const &);
48
49 protected:
50         ///
51         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
52 private:
53         virtual Inset * clone() const;
54
55         /// The label that is set by updateLabels
56         docstring autolabel_;
57         ///
58         static int key_counter;
59 };
60
61
62 /// Return the widest label in the Bibliography.
63 docstring const bibitemWidest(Buffer const &);
64
65
66 } // namespace lyx
67
68 #endif // INSET_BIBITEM_H