]> git.lyx.org Git - lyx.git/blob - src/insets/insetref.h
fix bug 2089: Touching Navigate menu crashes Lyx when a TOC inset is in a section...
[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 /// The reference inset
19 class InsetRef : public InsetCommand {
20 public:
21         struct type_info {
22                 ///
23                 std::string latex_name;
24                 ///
25                 std::string gui_name;
26                 ///
27                 std::string short_gui_name;
28         };
29         static type_info types[];
30         ///
31         static int getType(std::string const & name);
32         ///
33         static std::string const & getName(int type);
34
35
36         InsetRef(InsetCommandParams const &, Buffer const &);
37
38         ///
39         std::string const getScreenLabel(Buffer const &) const;
40         ///
41         EDITABLE editable() const { return IS_EDITABLE; }
42         ///
43         InsetBase::Code lyxCode() const { return InsetBase::REF_CODE; }
44         ///
45         bool display() const { return false; }
46         ///
47         int latex(Buffer const &, std::ostream &,
48                   OutputParams const &) const;
49         ///
50         int plaintext(Buffer const &, std::ostream &,
51                   OutputParams const &) const;
52         ///
53         int linuxdoc(Buffer const &, std::ostream &,
54                      OutputParams const &) const;
55         ///
56         int docbook(Buffer const &, std::ostream &,
57                     OutputParams const &) const;
58         /// the string that is passed to the TOC
59         virtual int textString(Buffer const &, std::ostream & os,
60                 OutputParams const &) const;
61         ///
62         void validate(LaTeXFeatures & features) const;
63 protected:
64         InsetRef(InsetRef const &);
65
66         ///
67         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
68 private:
69         virtual std::auto_ptr<InsetBase> doClone() const {
70                 return std::auto_ptr<InsetBase>(new InsetRef(*this));
71         }
72         ///
73         bool isLatex;
74 };
75 #endif