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 InsetCitation(Buffer * buf, InsetCommandParams const &);
37 /// \name Public functions inherited from Inset class
40 bool isLabeled() const { return true; }
42 bool hasSettings() const { return true; }
44 docstring toolTip(BufferView const & bv, int x, int y) const;
46 InsetCode lyxCode() const { return CITE_CODE; }
48 int latex(odocstream &, OutputParams const &) const;
50 int plaintext(odocstream &, OutputParams const &) const;
52 int docbook(odocstream &, OutputParams const &) const;
54 docstring xhtml(XHTMLStream &, OutputParams const &) const;
56 void tocString(odocstream &) const;
58 void validate(LaTeXFeatures &) const;
60 void updateBuffer(ParIterator const & it, UpdateType);
62 void addToToc(DocIterator const &);
64 docstring contextMenu(BufferView const & bv, int x, int y) const;
67 /// \name Static public methods obligated for InsetCommand derived classes
70 static ParamInfo const & findInfo(std::string const &);
71 // FIXME This is the locus of the design problem we have.
72 // It really ought to do what default_cite_command() does,
73 // but to do that it needs to know what CiteEngine we are
75 static std::string defaultCommand() { return "cite"; }
77 static bool isCompatibleCommand(std::string const & cmd);
81 /// tries to make a pretty label and makes a basic one if not
82 docstring generateLabel(bool for_xhtml = false) const;
83 /// makes a pretty label
84 docstring complexLabel(bool for_xhtml = false) const;
85 /// makes a very basic label, in case we can't make a pretty one
86 docstring basicLabel(bool for_xhtml = false) const;
88 /// \name Private functions inherited from Inset class
91 Inset * clone() const { return new InsetCitation(*this); }
94 /// \name Private functions inherited from InsetCommand class
97 docstring screenLabel() const;
100 /// we'll eventually want to be able to get info on this from the
101 /// various CiteEngines
102 static ParamInfo param_info_;
108 Cache() : engine(ENGINE_BASIC), params(CITE_CODE) {}
112 InsetCommandParams params;
114 docstring generated_label;
116 docstring screen_label;
125 #endif // INSET_CITATION_H