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"
19 #include "support/strfwd.h"
23 /////////////////////////////////////////////////////////////////////////
27 /////////////////////////////////////////////////////////////////////////
29 /// Used to insert citations
30 class InsetCitation : public InsetCommand
34 InsetCitation(Buffer * buf, InsetCommandParams const &);
39 bool addKey(std::string const & key);
41 /// \name Public functions inherited from Inset class
44 bool isLabeled() const { return true; }
46 bool hasSettings() const { return true; }
48 docstring toolTip(BufferView const & bv, int x, int y) const;
50 void doDispatch(Cursor & cur, FuncRequest & cmd);
52 InsetCode lyxCode() const { return CITE_CODE; }
54 void latex(otexstream &, OutputParams const &) const;
56 int plaintext(odocstream &, OutputParams const &) const;
58 int docbook(odocstream &, OutputParams const &) const;
60 docstring xhtml(XHTMLStream &, OutputParams const &) const;
62 void toString(odocstream &) const;
64 void forToc(docstring &, size_t) const;
66 void validate(LaTeXFeatures &) const {}
68 void updateBuffer(ParIterator const & it, UpdateType);
70 void addToToc(DocIterator const &) const;
72 std::string contextMenuName() const;
75 /// \name Static public methods obligated for InsetCommand derived classes
78 static ParamInfo const & findInfo(std::string const &);
80 static std::string defaultCommand() { return "cite"; }
82 static bool isCompatibleCommand(std::string const & cmd);
86 /// tries to make a pretty label and makes a basic one if not
87 docstring generateLabel(bool for_xhtml = false) const;
88 /// makes a pretty label
89 docstring complexLabel(bool for_xhtml = false) const;
90 /// makes a very basic label, in case we can't make a pretty one
91 docstring basicLabel(bool for_xhtml = false) const;
93 /// \name Private functions inherited from Inset class
96 Inset * clone() const { return new InsetCitation(*this); }
99 /// \name Private functions inherited from InsetCommand class
102 docstring screenLabel() const;
105 /// we'll eventually want to be able to get info on this from the
106 /// various CiteEngines
107 static ParamInfo param_info_;
111 Cache() : recalculate(true) {};
115 docstring generated_label;
117 docstring screen_label;
126 #endif // INSET_CITATION_H