]> git.lyx.org Git - lyx.git/blob - src/insets/InsetCitation.h
BUG 3598: display framed and shaded notes in a separate paragraph, require package...
[lyx.git] / src / insets / InsetCitation.h
1 // -*- C++ -*-
2 /**
3  * \file InsetCitation.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  * \author Herbert Voß
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSET_CITE_H
14 #define INSET_CITE_H
15
16
17 #include "InsetCommand.h"
18
19 #include "frontends/controllers/frontend_helpers.h"
20
21
22 namespace lyx {
23
24
25 /** Used to insert citations
26  */
27 class InsetCitation : public InsetCommand {
28 public:
29         ///
30         InsetCitation(InsetCommandParams const &);
31         ///
32         docstring const getScreenLabel(Buffer const &) const;
33         ///
34         EDITABLE editable() const { return IS_EDITABLE; }
35         ///
36         Inset::Code lyxCode() const { return Inset::CITE_CODE; }
37         ///
38         int latex(Buffer const &, odocstream &,
39                   OutputParams const &) const;
40         ///
41         int plaintext(Buffer const &, odocstream &,
42                       OutputParams const &) const;
43         ///
44         int docbook(Buffer const &, odocstream &,
45                     OutputParams const &) const;
46         /// the string that is passed to the TOC
47         virtual int textString(Buffer const &, odocstream &,
48                 OutputParams const &) const;
49         ///
50         void validate(LaTeXFeatures &) const;
51         ///
52         void replaceContents(std::string const & from, std::string const & to);
53
54 private:
55         virtual std::auto_ptr<Inset> doClone() const
56         {
57                 return std::auto_ptr<Inset>(new InsetCitation(params()));
58         }
59
60         /// This function does the donkey work of creating the pretty label
61         docstring const generateLabel(Buffer const &) const;
62
63         class Cache {
64         public:
65                 ///
66                 Cache() : engine(biblio::ENGINE_BASIC), params("cite") {}
67                 ///
68                 biblio::CiteEngine engine;
69                 ///
70                 InsetCommandParams params;
71                 ///
72                 docstring generated_label;
73                 ///
74                 docstring screen_label;
75         };
76         ///
77         mutable Cache cache;
78 };
79
80
81 } // namespace lyx
82
83 #endif // INSET_CITE_H