2000-06-07 08:53:40 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetcite.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2000-06-07 08:53:40 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author Angus Leeming
|
2003-09-07 01:45:40 +00:00
|
|
|
|
* \author Herbert Vo<EFBFBD>
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +00:00
|
|
|
|
*/
|
2000-06-07 08:53:40 +00:00
|
|
|
|
|
|
|
|
|
#ifndef INSET_CITE_H
|
|
|
|
|
#define INSET_CITE_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "insetcommand.h"
|
2004-05-14 13:13:20 +00:00
|
|
|
|
#include "bufferparams.h"
|
|
|
|
|
|
2000-07-20 10:04:27 +00:00
|
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
|
/** Used to insert citations
|
2000-06-07 08:53:40 +00:00
|
|
|
|
*/
|
2000-08-04 13:12:30 +00:00
|
|
|
|
class InsetCitation : public InsetCommand {
|
2000-06-07 08:53:40 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetCitation(InsetCommandParams const &);
|
|
|
|
|
///
|
2006-10-11 19:40:50 +00:00
|
|
|
|
lyx::docstring const getScreenLabel(Buffer const &) const;
|
2000-06-07 08:53:40 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
2001-01-31 20:39:53 +00:00
|
|
|
|
///
|
2004-11-25 19:13:07 +00:00
|
|
|
|
InsetBase::Code lyxCode() const { return InsetBase::CITE_CODE; }
|
2001-07-20 14:18:48 +00:00
|
|
|
|
///
|
2006-10-11 19:40:50 +00:00
|
|
|
|
int plaintext(Buffer const &, lyx::odocstream &, OutputParams const &) const;
|
2002-03-21 17:09:55 +00:00
|
|
|
|
///
|
2006-10-19 16:51:30 +00:00
|
|
|
|
int latex(Buffer const &, lyx::odocstream &,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2001-07-19 14:12:37 +00:00
|
|
|
|
///
|
2006-10-19 21:00:33 +00:00
|
|
|
|
int docbook(Buffer const &, lyx::odocstream &,
|
2004-10-21 22:39:20 +00:00
|
|
|
|
OutputParams const &) const;
|
2005-11-25 14:40:34 +00:00
|
|
|
|
/// the string that is passed to the TOC
|
2006-10-11 19:40:50 +00:00
|
|
|
|
virtual int textString(Buffer const &, lyx::odocstream &,
|
2005-11-25 14:40:34 +00:00
|
|
|
|
OutputParams const &) const;
|
2004-10-21 22:39:20 +00:00
|
|
|
|
///
|
2001-07-19 14:12:37 +00:00
|
|
|
|
void validate(LaTeXFeatures &) const;
|
2006-10-09 14:21:11 +00:00
|
|
|
|
///
|
|
|
|
|
void replaceContents(std::string const & from, std::string const & to);
|
2004-05-10 20:55:00 +00:00
|
|
|
|
|
2002-04-24 10:00:39 +00:00
|
|
|
|
private:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const
|
|
|
|
|
{
|
|
|
|
|
return std::auto_ptr<InsetBase>(new InsetCitation(params()));
|
|
|
|
|
}
|
|
|
|
|
|
2004-05-10 20:55:00 +00:00
|
|
|
|
/// This function does the donkey work of creating the pretty label
|
2006-10-11 19:40:50 +00:00
|
|
|
|
lyx::docstring const generateLabel(Buffer const &) const;
|
2004-05-10 20:55:00 +00:00
|
|
|
|
|
2005-01-19 15:03:31 +00:00
|
|
|
|
class Cache {
|
|
|
|
|
public:
|
2002-04-24 10:00:39 +00:00
|
|
|
|
///
|
Rework InsetCommandParams interface and file storage
* src/insets/insetcommandparams.[Ch]:
(operator[]): New, access a parameter
(clear): New, clear all parameters
(info_): New, stire info about this command
(cmdname): Rename to name_
(contents, options, sec_options): Replace with params_. Parameters
are now stored as docstring.
(findInfo): New factor for command info for all commands
(read, write): Use new syntax
(parameter set and get methods): reimplemenmt for new parameter storage
* src/insets/insetcommand.h
(getParam): New, get a parameter
(setParam): New, set a parameter
(parameter set and get methods): Adjust to InsetCommandParams changes
* src/insets/insetbibitem.[Ch]
(write): Remove, not needed anymore
(directWrite): ditto
* src/insets/insetbibitem.C
(InsetBibitem::read): Use InsetCommand::read
* src/insets/insetref.C
(InsetRef::latex): Use new InsetCommandParams interface
* src/mathed/InsetMathHull.C
(InsetMathHull::doDispatch): ditto
* src/text3.C
(LyXText::dispatch): ditto
* src/factory.C
(createInset): Create InsetCommandParams with command name
(readInset): ditto
(readInset): Remove error message for bibitem, since bibitem is
now a normal command inset
* src/buffer.C: Bump file format number
* src/frontends/controllers/ControlCommand.[Ch]
(ControlCommand): take an additional command name parameter
* src/text.C
(readParToken): Remove code for \bibitem
* lib/lyx2lyx/LyX.py: Bump latest file format number
* lib/lyx2lyx/lyx_1_5.py
(convert_bibitem, convert_commandparams): new, convert to new format
(revert_commandparams): new, convert to old format
* development/FORMAT: document new format
* many other files: Adjust to the changes above
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15357 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-17 21:07:16 +00:00
|
|
|
|
Cache() : engine(lyx::biblio::ENGINE_BASIC), params("cite") {}
|
2002-04-24 10:00:39 +00:00
|
|
|
|
///
|
2004-05-19 15:11:37 +00:00
|
|
|
|
lyx::biblio::CiteEngine engine;
|
2002-04-24 10:00:39 +00:00
|
|
|
|
///
|
|
|
|
|
InsetCommandParams params;
|
|
|
|
|
///
|
2006-10-11 19:40:50 +00:00
|
|
|
|
lyx::docstring generated_label;
|
2002-04-24 10:00:39 +00:00
|
|
|
|
///
|
2006-10-11 19:40:50 +00:00
|
|
|
|
lyx::docstring screen_label;
|
2002-04-24 10:00:39 +00:00
|
|
|
|
};
|
|
|
|
|
///
|
|
|
|
|
mutable Cache cache;
|
2000-06-07 08:53:40 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // INSET_CITE_H
|