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"
17 #include "BiblioInfo.h"
22 /** Used to insert bibitem's information (key and label)
24 Must be automatically inserted as the first object in a
25 bibliography paragraph.
27 class InsetBibitem : public InsetCommand {
30 InsetBibitem(InsetCommandParams const &);
32 void read(Buffer const &, Lexer & lex);
34 docstring const getScreenLabel(Buffer const &) const;
36 EDITABLE editable() const { return IS_EDITABLE; }
38 InsetCode lyxCode() const { return BIBITEM_CODE; }
40 docstring const getBibLabel() const;
42 int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
44 virtual void fillWithBibKeys(Buffer const &,
45 BiblioInfo &, InsetIterator const &) const;
46 /// Update the counter of this inset
47 virtual void updateLabels(Buffer const &, ParIterator const &);
49 static CommandInfo const * findInfo(std::string const &);
51 static std::string defaultCommand() { return "bibitem"; };
53 static bool isCompatibleCommand(std::string const & s)
54 { return s == "bibitem"; }
57 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
59 virtual Inset * clone() const;
61 /// The label that is set by updateLabels
64 static int key_counter;
68 /// Return the widest label in the Bibliography.
69 docstring const bibitemWidest(Buffer const &);
74 #endif // INSET_BIBITEM_H