]> git.lyx.org Git - lyx.git/blob - src/insets/insetbibitem.h
the dispatch patch
[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 class Buffer;
19
20 /** Used to insert bibitem's information (key and label)
21
22   Must be automatically inserted as the first object in a
23   bibliography paragraph.
24   */
25 class InsetBibitem : public InsetCommand {
26 public:
27         ///
28         InsetBibitem(InsetCommandParams const &);
29         ///
30         ~InsetBibitem();
31         ///
32         std::auto_ptr<InsetBase> clone() const;
33         /** Currently \bibitem is used as a LyX2.x command,
34             so we need this method.
35         */
36         void write(Buffer const &, std::ostream &) const;
37         ///
38         void read(Buffer const &, LyXLex & lex);
39         ///
40         virtual std::string const getScreenLabel(Buffer const &) const;
41         ///
42         EDITABLE editable() const { return IS_EDITABLE; }
43         ///
44         InsetOld::Code lyxCode() const { return InsetOld::BIBITEM_CODE; }
45         /// keep .lyx format compatible
46         bool directWrite() const { return true; }
47         ///
48         void setCounter(int);
49         ///
50         int getCounter() const { return counter; }
51         ///
52         std::string const getBibLabel() const;
53 protected:
54         ///
55         virtual
56         dispatch_result
57         priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
58 private:
59         ///
60         int counter;
61         ///
62         static int key_counter;
63 };
64
65 #endif // INSET_BIBITEM_H