]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibitem.h
* add PreBabelPreamble to Language definition (fixes #4786).
[lyx.git] / src / insets / InsetBibitem.h
index d039eb04b050ee9c6f3f18d09dac17245b5ca6db..9231b3cb9b0f01ea7c464e6a089e9120fb01cf49 100644 (file)
 
 
 #include "InsetCommand.h"
-#include "BiblioInfo.h"
 
 
 namespace lyx {
 
-/** Used to insert bibitem's information (key and label)
+class BiblioInfo;
 
-  Must be automatically inserted as the first object in a
-  bibliography paragraph.
-  */
-class InsetBibitem : public InsetCommand {
+/////////////////////////////////////////////////////////////////////////
+//
+// InsetBibItem
+//
+/////////////////////////////////////////////////////////////////////////
+
+/// Used to insert bibitem's information (key and label)
+
+//  Must be automatically inserted as the first object in a
+//  bibliography paragraph.
+class InsetBibitem : public InsetCommand
+{
 public:
        ///
-       InsetBibitem(InsetCommandParams const &);
+       InsetBibitem(Buffer *, InsetCommandParams const &);
+       ///
+       ~InsetBibitem();
+
+       ///
+       void updateCommand(docstring const & new_key, bool dummy = false);
+
+       /// \name Public functions inherited from Inset class
+       //@{
        ///
-       void read(Buffer const &, Lexer & lex);
+       InsetCode lyxCode() const { return BIBITEM_CODE; }
        ///
-       docstring const getScreenLabel(Buffer const &) const;
+       bool hasSettings() const { return true; }
+       /// \copydoc Inset::initView()
+       /// verify label and update references.
+       void initView();
        ///
-       EDITABLE editable() const { return IS_EDITABLE; }
+       bool isLabeled() const { return true; }
        ///
-       Inset::Code lyxCode() const { return Inset::BIBITEM_CODE; }
+       void read(Lexer & lex);
        ///
-       docstring const getBibLabel() const;
+       int plaintext(odocstream &, OutputParams const &) const;
        ///
-       int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
+       docstring xhtml(XHTMLStream &, OutputParams const &) const;
        ///
-       virtual void fillWithBibKeys(Buffer const &,
-               BiblioInfo &, InsetIterator const &) const;
-       /// Update the counter of this inset
-       virtual void updateLabels(Buffer const &, ParIterator const &);
+       void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
+       /// update the counter of this inset
+       void updateBuffer(ParIterator const &, UpdateType);
+       ///@}
 
-protected:
+       /// \name Static public methods obligated for InsetCommand derived classes
+       //@{
+       ///
+       static ParamInfo const & findInfo(std::string const &);
+       ///
+       static std::string defaultCommand() { return "bibitem"; }
        ///
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+       static bool isCompatibleCommand(std::string const & s) 
+               { return s == "bibitem"; }
+       ///@}
+
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
+       ///
+       docstring bibLabel() const;
+
+       /// \name Private functions inherited from Inset class
+       //@{
+       ///
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       ///
+       Inset * clone() const { return new InsetBibitem(*this); }
+       ///@}
+
+       /// \name Private functions inherited from InsetCommand class
+       //@{
+       ///
+       docstring screenLabel() const;
+       //@}
+
+       friend docstring bibitemWidest(Buffer const & buffer, OutputParams const &);
 
-       /// The label that is set by updateLabels
+       /// The label that is set by updateBuffer
        docstring autolabel_;
        ///
        static int key_counter;
@@ -60,7 +103,7 @@ private:
 
 
 /// Return the widest label in the Bibliography.
-docstring const bibitemWidest(Buffer const &);
+docstring bibitemWidest(Buffer const &, OutputParams const &);
 
 
 } // namespace lyx