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.
13 #ifndef INSET_CITATION_H
14 #define INSET_CITATION_H
16 #include "InsetCommand.h"
17 #include "InsetCode.h"
19 #include "BiblioInfo.h"
24 /////////////////////////////////////////////////////////////////////////
28 /////////////////////////////////////////////////////////////////////////
30 /// Used to insert citations
31 class InsetCitation : public InsetCommand
35 explicit InsetCitation(InsetCommandParams const &);
37 bool isLabeled() const { return true; }
39 docstring screenLabel() const;
41 EDITABLE editable() const { return IS_EDITABLE; }
43 InsetCode lyxCode() const { return CITE_CODE; }
45 int latex(odocstream &, OutputParams const &) const;
47 int plaintext(odocstream &, OutputParams const &) const;
49 int docbook(odocstream &, OutputParams const &) const;
50 /// the string that is passed to the TOC
51 void textString(odocstream &) const;
53 void validate(LaTeXFeatures &) const;
55 void updateLabels(ParIterator const & it);
57 void addToToc(ParConstIterator const &) const;
60 static ParamInfo const & findInfo(std::string const &);
61 // FIXME This is the locus of the design problem we have.
62 // It really ought to do what default_cite_command() does,
63 // but to do that it needs to know what CiteEngine we are
65 static std::string defaultCommand() { return "cite"; }
67 static bool isCompatibleCommand(std::string const & cmd);
69 virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
72 Inset * clone() const { return new InsetCitation(*this); }
73 /// we'll eventually want to be able to get info on this from the
74 /// various CiteEngines
75 static ParamInfo param_info_;
76 /// This function does the donkey work of creating the pretty label
77 docstring generateLabel() const;
83 Cache() : engine(ENGINE_BASIC), params(CITE_CODE) {}
87 InsetCommandParams params;
89 docstring generated_label;
91 docstring screen_label;
99 #endif // INSET_CITATION_H