2003-02-21 09:20:18 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file insetbibitem.h
|
|
|
|
* 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
|
|
|
|
|
|
|
|
|
|
|
|
#include "insetcommand.h"
|
|
|
|
|
|
|
|
/** 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 &);
|
|
|
|
///
|
2003-07-25 17:11:25 +00:00
|
|
|
std::auto_ptr<InsetBase> clone() const;
|
2003-02-21 09:20:18 +00:00
|
|
|
/** Currently \bibitem is used as a LyX2.x command,
|
|
|
|
so we need this method.
|
|
|
|
*/
|
2003-08-28 07:41:31 +00:00
|
|
|
void write(Buffer const &, std::ostream &) const;
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
2003-08-28 07:41:31 +00:00
|
|
|
void read(Buffer const &, LyXLex & lex);
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual std::string const getScreenLabel(Buffer const &) const;
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
|
|
|
///
|
2003-07-25 21:20:24 +00:00
|
|
|
InsetOld::Code lyxCode() const { return InsetOld::BIBITEM_CODE; }
|
2003-02-21 09:20:18 +00:00
|
|
|
/// keep .lyx format compatible
|
|
|
|
bool directWrite() const { return true; }
|
|
|
|
///
|
|
|
|
void setCounter(int);
|
|
|
|
///
|
2003-05-16 07:44:00 +00:00
|
|
|
int getCounter() const { return counter; }
|
2003-02-21 09:20:18 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const getBibLabel() const;
|
2004-08-14 18:41:27 +00:00
|
|
|
///
|
|
|
|
int plaintext(Buffer const &, std::ostream &,
|
|
|
|
OutputParams const &) const;
|
2003-10-17 18:01:15 +00:00
|
|
|
protected:
|
|
|
|
///
|
2004-03-18 12:53:43 +00:00
|
|
|
virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd);
|
2003-02-21 09:20:18 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
int counter;
|
|
|
|
///
|
|
|
|
static int key_counter;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INSET_BIBITEM_H
|