]> git.lyx.org Git - lyx.git/blob - src/insets/insetcite.h
Add support for the jurabib package (www.jurabib.org), a package for elegant BibTeX...
[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
19 /** Used to insert citations
20  */
21 class InsetCitation : public InsetCommand {
22 public:
23         ///
24         InsetCitation(InsetCommandParams const &);
25         ///
26         std::auto_ptr<InsetBase> clone() const {
27                 return std::auto_ptr<InsetBase>(new InsetCitation(params()));
28         }
29         ///
30         std::string const getScreenLabel(Buffer const &) const;
31         ///
32         EDITABLE editable() const { return IS_EDITABLE; }
33         ///
34         InsetOld::Code lyxCode() const { return InsetOld::CITE_CODE; }
35         ///
36         int plaintext(Buffer const &, std::ostream &, int linelen) const;
37         ///
38         int latex(Buffer const &, std::ostream &,
39                   OutputParams const &) const;
40         ///
41         void validate(LaTeXFeatures &) const;
42 private:
43         struct Cache {
44                 ///
45                 enum Style {
46                         ///
47                         BASIC,
48                         ///
49                         NATBIB_AY,
50                         ///
51                         NATBIB_NUM,
52                         ///
53                         JURABIB
54                 };
55                 ///
56                 Cache() : style(BASIC) {}
57                 ///
58                 Style style;
59                 ///
60                 InsetCommandParams params;
61                 ///
62                 std::string generated_label;
63                 ///
64                 std::string screen_label;
65         };
66
67         /// This function does the donkey work of creating the pretty label
68         std::string const generateLabel(Buffer const &) const;
69         ///
70         Cache::Style getStyle(Buffer const & buffer) const;
71
72         ///
73         mutable Cache cache;
74 };
75
76 #endif // INSET_CITE_H