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"
|
|
|
|
|
|
|
|
class Buffer;
|
|
|
|
|
|
|
|
/** 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-02-25 14:51:38 +00:00
|
|
|
~InsetBibitem();
|
|
|
|
///
|
2003-07-25 17:11:25 +00:00
|
|
|
std::auto_ptr<InsetBase> clone() const;
|
2003-05-26 09:13:55 +00:00
|
|
|
///
|
2003-02-26 19:28:38 +00:00
|
|
|
virtual dispatch_result localDispatch(FuncRequest const & cmd);
|
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-08-28 07:41:31 +00:00
|
|
|
virtual 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
|
|
|
///
|
|
|
|
string const getBibLabel() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
int counter;
|
|
|
|
///
|
|
|
|
static int key_counter;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INSET_BIBITEM_H
|