]> git.lyx.org Git - lyx.git/blob - src/insets/insetcite.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetcite.h
1 // -*- C++ -*-
2 /**
3  * \file insetcite.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 #include "bufferparams.h"
19
20
21 namespace lyx {
22
23
24 /** Used to insert citations
25  */
26 class InsetCitation : public InsetCommand {
27 public:
28         ///
29         InsetCitation(InsetCommandParams const &);
30         ///
31         docstring const getScreenLabel(Buffer const &) const;
32         ///
33         EDITABLE editable() const { return IS_EDITABLE; }
34         ///
35         InsetBase::Code lyxCode() const { return InsetBase::CITE_CODE; }
36         ///
37         int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
38         ///
39         int latex(Buffer const &, odocstream &,
40                   OutputParams const &) const;
41         ///
42         int docbook(Buffer const &, odocstream &,
43                   OutputParams const &) const;
44         /// the string that is passed to the TOC
45         virtual int textString(Buffer const &, odocstream &,
46                 OutputParams const &) const;
47         ///
48         void validate(LaTeXFeatures &) const;
49         ///
50         void replaceContents(std::string const & from, std::string const & to);
51
52 private:
53         virtual std::auto_ptr<InsetBase> doClone() const
54         {
55                 return std::auto_ptr<InsetBase>(new InsetCitation(params()));
56         }
57
58         /// This function does the donkey work of creating the pretty label
59         docstring const generateLabel(Buffer const &) const;
60
61         class Cache {
62         public:
63                 ///
64                 Cache() : engine(biblio::ENGINE_BASIC), params("cite") {}
65                 ///
66                 biblio::CiteEngine engine;
67                 ///
68                 InsetCommandParams params;
69                 ///
70                 docstring generated_label;
71                 ///
72                 docstring screen_label;
73         };
74         ///
75         mutable Cache cache;
76 };
77
78
79 } // namespace lyx
80
81 #endif // INSET_CITE_H