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