3 * \file InsetCitation.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
17 #include "InsetCommand.h"
18 #include "InsetCode.h"
20 #include "BiblioInfo.h"
26 /** Used to insert citations
28 class InsetCitation : public InsetCommand {
31 InsetCitation(InsetCommandParams const &);
33 bool isLabeled() const { return true; }
35 docstring screenLabel() const;
37 EDITABLE editable() const { return IS_EDITABLE; }
39 InsetCode lyxCode() const { return CITE_CODE; }
41 int latex(odocstream &, OutputParams const &) const;
43 int plaintext(odocstream &, OutputParams const &) const;
45 int docbook(odocstream &, OutputParams const &) const;
46 /// the string that is passed to the TOC
47 void textString(odocstream &) const;
49 void validate(LaTeXFeatures &) const;
51 void updateLabels(ParIterator const & it);
53 void addToToc(ParConstIterator const &) const;
56 static ParamInfo const & findInfo(std::string const &);
57 //FIXME This is the locus of the design problem we have.
58 //It really ought to do what default_cite_command() does,
59 //but to do that it needs to know what CiteEngine we are
62 static std::string defaultCommand() { return "cite"; };
64 static bool isCompatibleCommand(std::string const & cmd);
67 Inset * clone() const { return new InsetCitation(*this); }
68 /// we'll eventually want to be able to get info on this from the
69 /// various CiteEngines
70 static ParamInfo param_info_;
71 /// This function does the donkey work of creating the pretty label
72 docstring generateLabel() const;
78 Cache() : engine(biblio::ENGINE_BASIC), params(CITE_CODE) {}
80 biblio::CiteEngine engine;
82 InsetCommandParams params;
84 docstring generated_label;
86 docstring screen_label;
95 #endif // INSET_CITE_H