]> git.lyx.org Git - features.git/blob - src/insets/InsetRef.h
try to pass a Buffer & to inset construction if some buffer(param)
[features.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(Buffer const & buffer, InsetCommandParams const &);
40
41         /// verify label and reference.
42         /**
43           * Overloaded from Inset::initView.
44           **/
45         void initView();
46         ///
47         docstring screenLabel() const;
48         ///
49         EDITABLE editable() const { return IS_EDITABLE; }
50         ///
51         InsetCode lyxCode() const { return REF_CODE; }
52         ///
53         DisplayType display() const { return Inline; }
54         ///
55         int latex(odocstream &, OutputParams const &) const;
56         ///
57         int plaintext(odocstream &, OutputParams const &) const;
58         ///
59         int docbook(odocstream &, OutputParams const &) const;
60         /// the string that is passed to the TOC
61         void textString(odocstream &) const;
62         ///
63         void validate(LaTeXFeatures & features) const;
64         ///
65         static ParamInfo const & findInfo(std::string const &);
66         ///
67         static std::string defaultCommand() { return "ref"; };
68         ///
69         static bool isCompatibleCommand(std::string const & s);
70         ///
71         void updateLabels(ParIterator const & it);
72         ///
73         void addToToc(ParConstIterator const &) const;
74 protected:
75         ///
76         InsetRef(InsetRef const &);
77         ///
78         void doDispatch(Cursor & cur, FuncRequest & cmd);
79 private:
80         ///
81         Inset * clone() const { return new InsetRef(*this); }
82         ///
83         bool isLatex;
84         ///
85         mutable docstring screen_label_;
86 };
87
88 } // namespace lyx
89
90 #endif