]> git.lyx.org Git - lyx.git/blob - src/insets/insetref.h
Prevent an assert when opening the citation dialog if the bibtex
[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                 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         InsetRef(InsetRef const &);
42
43         ~InsetRef();
44         ///
45         virtual std::auto_ptr<InsetBase> clone() const {
46                 return std::auto_ptr<InsetBase>(new InsetRef(*this));
47         }
48         ///
49         std::string const getScreenLabel(Buffer const &) const;
50         ///
51         EDITABLE editable() const { return IS_EDITABLE; }
52         ///
53         InsetOld::Code lyxCode() const { return InsetOld::REF_CODE; }
54         ///
55         bool display() const { return false; }
56         ///
57         int latex(Buffer const &, std::ostream &,
58                   OutputParams const &) const;
59         ///
60         int plaintext(Buffer const &, std::ostream &,
61                   OutputParams const &) const;
62         ///
63         int linuxdoc(Buffer const &, std::ostream &,
64                      OutputParams const &) const;
65         ///
66         int docbook(Buffer const &, std::ostream &,
67                     OutputParams const &) const;
68         ///
69         void validate(LaTeXFeatures & features) const;
70 protected:
71         ///
72         virtual
73         DispatchResult
74         priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
75 private:
76         ///
77         bool isLatex;
78 };
79 #endif