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"
20 /////////////////////////////////////////////////////////////////////////
24 /////////////////////////////////////////////////////////////////////////
26 /// Used to insert citations
27 class InsetCitation : public InsetCommand
31 InsetCitation(Buffer * buf, InsetCommandParams const &);
36 bool addKey(std::string const & key);
38 /// \name Public functions inherited from Inset class
41 bool isLabeled() const { return true; }
43 bool hasSettings() const { return true; }
45 docstring toolTip(BufferView const & bv, int x, int y) const;
47 void doDispatch(Cursor & cur, FuncRequest & cmd);
49 InsetCode lyxCode() const { return CITE_CODE; }
51 void latex(otexstream &, OutputParams const &) const;
53 int plaintext(odocstringstream & ods, OutputParams const & op,
54 size_t max_length = INT_MAX) const;
56 int docbook(odocstream &, OutputParams const &) const;
58 docstring xhtml(XHTMLStream &, OutputParams const &) const;
60 void toString(odocstream &) const;
62 void forOutliner(docstring &, size_t const, bool const) const;
64 void validate(LaTeXFeatures &) const {}
66 void updateBuffer(ParIterator const & it, UpdateType);
68 void addToToc(DocIterator const & di, bool output_active,
69 UpdateType utype) const;
71 std::string contextMenuName() const;
74 /// \name Static public methods obligated for InsetCommand derived classes
77 static ParamInfo const & findInfo(std::string const &);
79 static std::string defaultCommand() { return "cite"; }
81 static bool isCompatibleCommand(std::string const & cmd);
85 /// tries to make a pretty label and makes a basic one if not
86 docstring generateLabel(bool for_xhtml = false) const;
87 /// makes a pretty label
88 docstring complexLabel(bool for_xhtml = false) const;
89 /// makes a very basic label, in case we can't make a pretty one
90 docstring basicLabel(bool for_xhtml = false) const;
92 /// \name Private functions inherited from Inset class
95 Inset * clone() const { return new InsetCitation(*this); }
98 /// \name Private functions inherited from InsetCommand class
101 docstring screenLabel() const;
104 /// we'll eventually want to be able to get info on this from the
105 /// various CiteEngines
106 static ParamInfo param_info_;
110 Cache() : recalculate(true) {}
114 docstring generated_label;
116 docstring screen_label;
125 #endif // INSET_CITATION_H