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 &);
31 /// verify label and update references.
33 * Overloaded from Inset::initView.
37 void read(Lexer & lex);
39 docstring screenLabel() const;
41 EDITABLE editable() const { return IS_EDITABLE; }
43 InsetCode lyxCode() const { return BIBITEM_CODE; }
45 docstring bibLabel() const;
47 int plaintext(odocstream &, OutputParams const &) const;
49 virtual void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
50 /// Update the counter of this inset
51 virtual void updateLabels(ParIterator const &);
53 static ParamInfo const & findInfo(std::string const &);
55 static std::string defaultCommand() { return "bibitem"; };
57 static bool isCompatibleCommand(std::string const & s)
58 { return s == "bibitem"; }
60 void updateCommand(docstring const & new_key, bool dummy = false);
63 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
66 virtual Inset * clone() const { return new InsetBibitem(*this); }
67 /// The label that is set by updateLabels
70 static int key_counter;
74 /// Return the widest label in the Bibliography.
75 docstring const bibitemWidest(Buffer const &);
80 #endif // INSET_BIBITEM_H