2003-02-21 09:20:18 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetBibitem.h
|
2003-02-21 09:20:18 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-02-21 09:20:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INSET_BIBITEM_H
|
|
|
|
#define INSET_BIBITEM_H
|
|
|
|
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "InsetCommand.h"
|
2007-08-20 17:04:36 +00:00
|
|
|
#include "BiblioInfo.h"
|
2003-02-21 09:20:18 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2003-02-21 09:20:18 +00:00
|
|
|
/** 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 &);
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void read(Lexer & lex);
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
docstring screenLabel() const;
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
InsetCode lyxCode() const { return BIBITEM_CODE; }
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
docstring bibLabel() const;
|
2004-08-14 18:41:27 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int plaintext(odocstream &, OutputParams const &) const;
|
2007-08-14 16:50:51 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
virtual void fillWithBibKeys(BiblioInfo &, InsetIterator const &) const;
|
2007-08-16 11:12:56 +00:00
|
|
|
/// Update the counter of this inset
|
2008-02-27 20:43:16 +00:00
|
|
|
virtual void updateLabels(ParIterator const &);
|
2007-10-25 04:13:56 +00:00
|
|
|
///
|
2008-02-23 22:01:02 +00:00
|
|
|
static ParamInfo const & findInfo(std::string const &);
|
2007-10-25 04:13:56 +00:00
|
|
|
///
|
|
|
|
static std::string defaultCommand() { return "bibitem"; };
|
|
|
|
///
|
|
|
|
static bool isCompatibleCommand(std::string const & s)
|
|
|
|
{ return s == "bibitem"; }
|
2003-10-17 18:01:15 +00:00
|
|
|
protected:
|
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2003-02-21 09:20:18 +00:00
|
|
|
private:
|
2008-02-23 22:01:02 +00:00
|
|
|
///
|
2007-08-30 18:03:17 +00:00
|
|
|
virtual Inset * clone() const;
|
2007-08-16 11:12:56 +00:00
|
|
|
/// The label that is set by updateLabels
|
|
|
|
docstring autolabel_;
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
|
|
|
static int key_counter;
|
|
|
|
};
|
|
|
|
|
2005-01-23 16:36:36 +00:00
|
|
|
|
|
|
|
/// Return the widest label in the Bibliography.
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring const bibitemWidest(Buffer const &);
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
2005-01-23 16:36:36 +00:00
|
|
|
|
2003-02-21 09:20:18 +00:00
|
|
|
#endif // INSET_BIBITEM_H
|