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"
|
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 &);
|
|
|
|
///
|
2007-04-26 11:30:54 +00:00
|
|
|
void read(Buffer const &, Lexer & lex);
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring const getScreenLabel(Buffer const &) const;
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
|
|
|
///
|
2007-04-29 13:39:47 +00:00
|
|
|
Inset::Code lyxCode() const { return Inset::BIBITEM_CODE; }
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
|
|
|
void setCounter(int);
|
|
|
|
///
|
2003-05-16 07:44:00 +00:00
|
|
|
int getCounter() const { return counter; }
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring const getBibLabel() const;
|
2004-08-14 18:41:27 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
|
2007-08-14 16:50:51 +00:00
|
|
|
///
|
|
|
|
virtual void fillWithBibKeys(Buffer const &,
|
|
|
|
std::vector<std::pair<std::string, docstring> > &,
|
|
|
|
InsetIterator const &) const;
|
|
|
|
|
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:
|
2007-04-29 13:39:47 +00:00
|
|
|
virtual std::auto_ptr<Inset> doClone() const;
|
2004-11-23 23:04:52 +00:00
|
|
|
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
|
|
|
int counter;
|
|
|
|
///
|
|
|
|
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
|