]> git.lyx.org Git - lyx.git/blob - src/insets/insetref.h
fix #832
[lyx.git] / src / insets / insetref.h
1 // -*- C++ -*-
2 /**
3  * \file insetref.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author José Matos
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef INSET_REF_H
13 #define INSET_REF_H
14
15
16 #include "insetcommand.h"
17
18 struct LaTeXFeatures;
19
20 /** The reference inset
21  */
22 class InsetRef : public InsetCommand {
23 public:
24         struct type_info {
25                 ///
26                 string latex_name;
27                 ///
28                 string gui_name;
29                 ///
30                 string short_gui_name;
31         };
32         static type_info types[];
33         ///
34         static int getType(string const & name);
35         ///
36         static string const & getName(int type);
37
38         ///
39         InsetRef(InsetCommandParams const &, Buffer const &, bool same_id = false);
40         ///
41         ~InsetRef();
42         ///
43         virtual Inset * clone(Buffer const & buffer, bool same_id = false) const {
44                 return new InsetRef(params(), buffer, same_id);
45         }
46         ///
47         dispatch_result localDispatch(FuncRequest const & cmd);
48         ///
49         string const getScreenLabel(Buffer const *) const;
50         ///
51         EDITABLE editable() const { return IS_EDITABLE; }
52         ///
53         Inset::Code lyxCode() const { return Inset::REF_CODE; }
54         ///
55         bool display() const { return false; }
56         ///
57         int latex(Buffer const *, std::ostream &,
58                   bool fragile, bool free_spc) const;
59         ///
60         int ascii(Buffer const *, std::ostream &, int linelen) const;
61         ///
62         int linuxdoc(Buffer const *, std::ostream &) const;
63         ///
64         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
65         ///
66         void validate(LaTeXFeatures & features) const;
67 private:
68         ///
69         bool isLatex;
70 };
71 #endif