]> git.lyx.org Git - lyx.git/blob - src/insets/InsetBibitem.h
98db70e68d569f40858c8a47308ed1c4bdc03792
[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
18
19 namespace lyx {
20
21 /** Used to insert bibitem's information (key and label)
22
23   Must be automatically inserted as the first object in a
24   bibliography paragraph.
25   */
26 class InsetBibitem : public InsetCommand {
27 public:
28         ///
29         InsetBibitem(InsetCommandParams const &);
30         ///
31         void read(Buffer const &, Lexer & lex);
32         ///
33         docstring const getScreenLabel(Buffer const &) const;
34         ///
35         EDITABLE editable() const { return IS_EDITABLE; }
36         ///
37         Inset::Code lyxCode() const { return Inset::BIBITEM_CODE; }
38         ///
39         void setCounter(int);
40         ///
41         int getCounter() const { return counter; }
42         ///
43         docstring const getBibLabel() const;
44         ///
45         int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
46         ///
47         virtual void fillWithBibKeys(Buffer const &,
48                 std::vector<std::pair<std::string, docstring> > &,
49                 InsetIterator const &) const;
50
51 protected:
52         ///
53         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
54 private:
55         virtual std::auto_ptr<Inset> doClone() const;
56
57         ///
58         int counter;
59         ///
60         static int key_counter;
61 };
62
63
64 /// Return the widest label in the Bibliography.
65 docstring const bibitemWidest(Buffer const &);
66
67
68 } // namespace lyx
69
70 #endif // INSET_BIBITEM_H