]> git.lyx.org Git - features.git/blob - src/insets/InsetRef.h
Organize header files in src\insets.
[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 * buffer, InsetCommandParams const &);
40
41         /// \name Public functions inherited from Inset class
42         //@{
43         ///
44         bool isLabeled() const { return true; }
45         ///
46         docstring toolTip(BufferView const &, int, int) const
47                 { return tooltip_; }
48         ///
49         bool hasSettings() const { return true; }
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         ///
61         docstring xhtml(XHTMLStream &, OutputParams const &) const;
62         /// the string that is passed to the TOC
63         void tocString(odocstream &) const;
64         ///
65         void validate(LaTeXFeatures & features) const;
66         ///
67         void updateBuffer(ParIterator const & it, UpdateType);
68         ///
69         void addToToc(DocIterator const &);
70         //@}
71
72         /// \name Static public methods obligated for InsetCommand derived classes
73         //@{
74         ///
75         static ParamInfo const & findInfo(std::string const &);
76         ///
77         static std::string defaultCommand() { return "ref"; }
78         ///
79         static bool isCompatibleCommand(std::string const & s);
80         //@}
81
82         //FIXME: private
83         /// \name Private functions inherited from InsetCommand class
84         //@{
85         ///
86         docstring screenLabel() const { return screen_label_; }
87         //@}
88
89 protected:
90         ///
91         InsetRef(InsetRef const &);
92
93 private:
94         /// \name Private functions inherited from Inset class
95         //@{
96         ///
97         Inset * clone() const { return new InsetRef(*this); }
98         //@}
99
100         ///
101         bool isLatex;
102         /// Force inset into LTR environment if surroundings are RTL
103         bool forceLTR() const { return true; }
104         ///
105         mutable docstring screen_label_;
106         ///
107         mutable docstring tooltip_;
108 };
109
110
111 } // namespace lyx
112
113 #endif // INSET_REF_H