]> git.lyx.org Git - lyx.git/blob - src/insets/InsetRef.h
This should be the last of the commits refactoring the InsetLayout code.
[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 #include "InsetCommand.h"
16
17
18 namespace lyx {
19
20
21 /// The reference inset
22 class InsetRef : public InsetCommand {
23 public:
24         struct type_info {
25                 ///
26                 std::string latex_name;
27                 ///
28                 std::string gui_name;
29                 ///
30                 std::string short_gui_name;
31         };
32         static type_info types[];
33         ///
34         static int getType(std::string const & name);
35         ///
36         static std::string const & getName(int type);
37
38
39         InsetRef(InsetCommandParams const &, Buffer const &);
40
41         ///
42         docstring const getScreenLabel(Buffer const &) const;
43         ///
44         EDITABLE editable() const { return IS_EDITABLE; }
45         ///
46         InsetCode lyxCode() const { return REF_CODE; }
47         ///
48         DisplayType display() const { return Inline; }
49         ///
50         int latex(Buffer const &, odocstream &, OutputParams const &) const;
51         ///
52         int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
53         ///
54         int docbook(Buffer const &, odocstream &, OutputParams const &) const;
55         /// the string that is passed to the TOC
56         void textString(Buffer const &, odocstream &) const;
57         ///
58         void validate(LaTeXFeatures & features) const;
59         ///
60         static CommandInfo const * findInfo(std::string const &);
61         ///
62         static std::string defaultCommand() { return "ref"; };
63         ///
64         static bool isCompatibleCommand(std::string const & s);
65 protected:
66         ///
67         InsetRef(InsetRef const &);
68
69         ///
70         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
71 private:
72         ///
73         Inset * clone() const { return new InsetRef(*this); }
74         ///
75         bool isLatex;
76 };
77
78 } // namespace lyx
79
80 #endif