]> git.lyx.org Git - lyx.git/blob - src/insets/insetcite.h
Translate labels for float:algorithm, float:figure and float:table.
[lyx.git] / src / insets / insetcite.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2000-2001 The LyX Team.
8  *
9  * ====================================================== */
10
11 #ifndef INSET_CITE_H
12 #define INSET_CITE_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "insetcommand.h"
19
20 /** Used to insert citations
21  */
22 class InsetCitation : public InsetCommand {
23 public:
24         ///
25         InsetCitation(InsetCommandParams const &, bool same_id = false);
26         ///
27         Inset * clone(Buffer const &, bool same_id = false) const {
28                 return new InsetCitation(params(), same_id);
29         }
30         ///
31         string const getScreenLabel(Buffer const *) const;
32         ///
33         EDITABLE editable() const { return IS_EDITABLE; }
34         ///
35         Inset::Code lyxCode() const { return Inset::CITE_CODE; }
36         ///
37         void edit(BufferView *, int, int, unsigned int);
38         ///
39         void edit(BufferView * bv, bool front = true);
40         ///
41         int ascii(Buffer const *, std::ostream &, int linelen) const;
42         ///
43         int latex(Buffer const *, std::ostream &, bool, bool) const;
44         ///
45         void validate(LaTeXFeatures &) const;
46 private:
47         struct Cache {
48                 ///
49                 enum Style {
50                         ///
51                         BASIC,
52                         ///
53                         NATBIB_AY,
54                         ///
55                         NATBIB_NUM
56                 };
57                 ///
58                 Cache() : style(BASIC) {}
59                 ///
60                 Style style;
61                 ///
62                 InsetCommandParams params;
63                 ///
64                 string generated_label;
65                 ///
66                 string screen_label;
67         };
68
69         /// This function does the donkey work of creating the pretty label
70         string const generateLabel(Buffer const *) const;
71         ///
72         Cache::Style getStyle(Buffer const * buffer) const;
73
74         ///
75         mutable Cache cache;
76 };
77
78 #endif // INSET_CITE_H