]> git.lyx.org Git - features.git/blob - src/insets/InsetBibitem.h
Re-write of the BibTeX representation. The main change is that we now have
[features.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 "Biblio_typedefs.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         void setCounter(int);
41         ///
42         int getCounter() const { return counter; }
43         ///
44         docstring const getBibLabel() const;
45         ///
46         int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
47         ///
48         virtual void fillWithBibKeys(Buffer const &,
49                 biblio::BibKeyList &, 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