4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_BIBITEM_H
13 #define INSET_BIBITEM_H
16 #include "insetcommand.h"
18 /** Used to insert bibitem's information (key and label)
20 Must be automatically inserted as the first object in a
21 bibliography paragraph.
23 class InsetBibitem : public InsetCommand {
26 InsetBibitem(InsetCommandParams const &);
27 /** Currently \bibitem is used as a LyX2.x command,
28 so we need this method.
30 void write(Buffer const &, std::ostream &) const;
32 void read(Buffer const &, LyXLex & lex);
34 virtual std::string const getScreenLabel(Buffer const &) const;
36 EDITABLE editable() const { return IS_EDITABLE; }
38 InsetBase::Code lyxCode() const { return InsetBase::BIBITEM_CODE; }
39 /// keep .lyx format compatible
40 bool directWrite() const { return true; }
44 int getCounter() const { return counter; }
46 std::string const getBibLabel() const;
48 int plaintext(Buffer const &, std::ostream &,
49 OutputParams const &) const;
52 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
54 virtual std::auto_ptr<InsetBase> doClone() const;
59 static int key_counter;
63 /// Return the widest label in the Bibliography.
64 std::string const bibitemWidest(Buffer const &);
66 #endif // INSET_BIBITEM_H