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"
22 /////////////////////////////////////////////////////////////////////////
26 /////////////////////////////////////////////////////////////////////////
28 /// Used to insert citations
29 class InsetCitation : public InsetCommand
33 InsetCitation(Buffer * buf, InsetCommandParams const &);
35 /// \name Public functions inherited from Inset class
38 bool isLabeled() const { return true; }
40 bool hasSettings() const { return true; }
42 docstring toolTip(BufferView const & bv, int x, int y) const;
44 void doDispatch(Cursor & cur, FuncRequest & cmd);
46 InsetCode lyxCode() const { return CITE_CODE; }
48 void latex(otexstream &, 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 toString(odocstream &) const;
58 void forToc(docstring &, size_t) const;
60 void validate(LaTeXFeatures &) const;
62 void updateBuffer(ParIterator const & it, UpdateType);
64 void addToToc(DocIterator const &) const;
66 docstring contextMenuName() const;
69 /// \name Static public methods obligated for InsetCommand derived classes
72 static ParamInfo const & findInfo(std::string const &);
73 // FIXME This is the locus of the design problem we have.
74 // It really ought to do what default_cite_command() does,
75 // but to do that it needs to know what CiteEngine we are
77 static std::string defaultCommand() { return "cite"; }
79 static bool isCompatibleCommand(std::string const & cmd);
83 /// tries to make a pretty label and makes a basic one if not
84 docstring generateLabel(bool for_xhtml = false) const;
85 /// makes a pretty label
86 docstring complexLabel(bool for_xhtml = false) const;
87 /// makes a very basic label, in case we can't make a pretty one
88 docstring basicLabel(bool for_xhtml = false) const;
90 /// \name Private functions inherited from Inset class
93 Inset * clone() const { return new InsetCitation(*this); }
96 /// \name Private functions inherited from InsetCommand class
99 docstring screenLabel() const;
102 /// we'll eventually want to be able to get info on this from the
103 /// various CiteEngines
104 static ParamInfo param_info_;
108 Cache() : recalculate(true) {};
112 docstring generated_label;
114 docstring screen_label;
123 #endif // INSET_CITATION_H