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"
23 /////////////////////////////////////////////////////////////////////////
27 /////////////////////////////////////////////////////////////////////////
29 /// Used to insert bibitem's information (key and label)
31 // Must be automatically inserted as the first object in a
32 // bibliography paragraph.
33 class InsetBibitem : public InsetCommand
37 InsetBibitem(Buffer *, InsetCommandParams const &);
42 void updateCommand(docstring const & new_key, bool dummy = false);
44 /// \name Public functions inherited from Inset class
47 InsetCode lyxCode() const { return BIBITEM_CODE; }
49 bool hasSettings() const { return true; }
50 /// \copydoc Inset::initView()
51 /// verify label and update references.
54 bool isLabeled() const { return true; }
56 void read(Lexer & lex);
58 int plaintext(odocstream &, OutputParams const &) const;
60 docstring xhtml(XHTMLStream &, OutputParams const &) const;
62 void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
63 /// update the counter of this inset
64 void updateBuffer(ParIterator const &, UpdateType);
67 /// \name Static public methods obligated for InsetCommand derived classes
70 static ParamInfo const & findInfo(std::string const &);
72 static std::string defaultCommand() { return "bibitem"; }
74 static bool isCompatibleCommand(std::string const & s)
75 { return s == "bibitem"; }
80 docstring bibLabel() const;
82 /// \name Private functions inherited from Inset class
85 void doDispatch(Cursor & cur, FuncRequest & cmd);
87 Inset * clone() const { return new InsetBibitem(*this); }
90 /// \name Private functions inherited from InsetCommand class
93 docstring screenLabel() const;
96 friend docstring bibitemWidest(Buffer const & buffer, OutputParams const &);
98 /// The label that is set by updateBuffer
101 static int key_counter;
105 /// Return the widest label in the Bibliography.
106 docstring bibitemWidest(Buffer const &, OutputParams const &);
111 #endif // INSET_BIBITEM_H