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 docstring toolTip(BufferView const & bv, int x, int y) const;
45 InsetCode lyxCode() const { return CITE_CODE; }
47 int latex(odocstream &, OutputParams const &) const;
49 int plaintext(odocstream &, OutputParams const &) const;
51 int docbook(odocstream &, OutputParams const &) const;
52 /// the string that is passed to the TOC
53 void tocString(odocstream &) const;
55 void validate(LaTeXFeatures &) const;
57 void updateLabels(ParIterator const & it);
59 void addToToc(DocIterator const &);
62 static ParamInfo const & findInfo(std::string const &);
63 // FIXME This is the locus of the design problem we have.
64 // It really ought to do what default_cite_command() does,
65 // but to do that it needs to know what CiteEngine we are
67 static std::string defaultCommand() { return "cite"; }
69 static bool isCompatibleCommand(std::string const & cmd);
71 virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
74 Inset * clone() const { return new InsetCitation(*this); }
75 /// we'll eventually want to be able to get info on this from the
76 /// various CiteEngines
77 static ParamInfo param_info_;
78 /// This function does the donkey work of creating the pretty label
79 docstring generateLabel() const;
85 Cache() : engine(ENGINE_BASIC), params(CITE_CODE) {}
89 InsetCommandParams params;
91 docstring generated_label;
93 docstring screen_label;
101 #endif // INSET_CITATION_H