]> git.lyx.org Git - lyx.git/blob - src/insets/insetbibitem.h
insetcharstyle drawing cosmetics
[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         std::auto_ptr<InsetBase> clone() const;
29         /** Currently \bibitem is used as a LyX2.x command,
30             so we need this method.
31         */
32         void write(Buffer const &, std::ostream &) const;
33         ///
34         void read(Buffer const &, LyXLex & lex);
35         ///
36         virtual std::string const getScreenLabel(Buffer const &) const;
37         ///
38         EDITABLE editable() const { return IS_EDITABLE; }
39         ///
40         InsetOld::Code lyxCode() const { return InsetOld::BIBITEM_CODE; }
41         /// keep .lyx format compatible
42         bool directWrite() const { return true; }
43         ///
44         void setCounter(int);
45         ///
46         int getCounter() const { return counter; }
47         ///
48         std::string const getBibLabel() const;
49         ///
50         int plaintext(Buffer const &, std::ostream &,
51                       OutputParams const &) const;
52 protected:
53         ///
54         virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd);
55 private:
56         ///
57         int counter;
58         ///
59         static int key_counter;
60 };
61
62 #endif // INSET_BIBITEM_H