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
17 #include "insetcommand.h"
19 /** Used to insert citations
21 class InsetCitation : public InsetCommand {
24 InsetCitation(InsetCommandParams const &, bool same_id = false);
28 Inset * clone(Buffer const &, bool same_id = false) const {
29 return new InsetCitation(params(), same_id);
32 string const getScreenLabel(Buffer const *) const;
34 EDITABLE editable() const { return IS_EDITABLE; }
36 Inset::Code lyxCode() const { return Inset::CITE_CODE; }
38 int ascii(Buffer const *, std::ostream &, int linelen) const;
40 int latex(Buffer const *, std::ostream &, LatexRunParams const &,
43 dispatch_result localDispatch(FuncRequest const & cmd);
45 void validate(LaTeXFeatures &) const;
46 /** Invoked by BufferView::Pimpl::dispatch when a new citation key
47 is inserted. Tells us that the buffer is no longer being loaded
48 and that the cache of BibTeX keys should be reloaded in the future.
50 void setLoadingBuffer(Buffer const * buffer, bool state) const;
63 Cache() : style(BASIC) {}
67 InsetCommandParams params;
69 string generated_label;
74 /// This function does the donkey work of creating the pretty label
75 string const generateLabel(Buffer const *) const;
77 Cache::Style getStyle(Buffer const * buffer) const;
83 #endif // INSET_CITE_H