]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNomencl.h
Add Nomenclature to the TOC.
[lyx.git] / src / insets / InsetNomencl.h
1 // -*- C++ -*-
2 /**
3  * \file InsetNomencl.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author O. U. Baran
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSET_NOMENCL_H
14 #define INSET_NOMENCL_H
15
16
17 #include "InsetCommand.h"
18
19
20 namespace lyx {
21
22 class LaTeXFeatures;
23
24 /** Used to insert nomenclature entries
25   */
26 class InsetNomencl : public InsetCommand {
27 public:
28         ///
29         InsetNomencl(Buffer * buf, InsetCommandParams const &);
30
31         ///
32         int docbookGlossary(odocstream &) const;
33
34         /// \name Public functions inherited from Inset class
35         //@{
36         ///
37         docstring toolTip(BufferView const & bv, int x, int y) const;
38         ///
39         bool hasSettings() const { return true; }
40         /// Updates needed features for this inset.
41         void validate(LaTeXFeatures & features) const;
42         ///
43         void addToToc(DocIterator const & di, bool output_active) const;
44         ///
45         InsetCode lyxCode() const { return NOMENCL_CODE; }
46         ///
47         int docbook(odocstream &, OutputParams const &) const;
48         /// Does nothing at the moment.
49         docstring xhtml(XHTMLStream &, OutputParams const &) const;
50         //@}
51
52         /// \name Static public methods obligated for InsetCommand derived classes
53         //@{
54         ///
55         static ParamInfo const & findInfo(std::string const &);
56         ///
57         static std::string defaultCommand() { return "nomenclature"; };
58         ///
59         static bool isCompatibleCommand(std::string const & s) 
60                 { return s == "nomenclature"; }
61         //@}
62
63 private:
64         /// \name Private functions inherited from Inset class
65         //@{
66         ///
67         Inset * clone() const { return new InsetNomencl(*this); }
68         //@}
69
70         /// \name Private functions inherited from InsetCommand class
71         //@{
72         ///
73         docstring screenLabel() const;
74         //@}
75
76         /// unique id for this nomenclature entry for docbook export
77         docstring nomenclature_entry_id;
78 };
79
80
81 class InsetPrintNomencl : public InsetCommand {
82 public:
83         ///
84         InsetPrintNomencl(Buffer * buf, InsetCommandParams const &);
85
86         /// \name Public functions inherited from Inset class
87         //@{
88         /// Updates needed features for this inset.
89         void validate(LaTeXFeatures & features) const;
90         ///
91         int docbook(odocstream &, OutputParams const &) const;
92         /// Does nothing at the moment.
93         docstring xhtml(XHTMLStream &, OutputParams const &) const;
94         ///
95         InsetCode lyxCode() const;
96         ///
97         bool hasSettings() const { return true; }
98         ///
99         DisplayType display() const { return AlignCenter; }
100         ///
101         void latex(otexstream &, OutputParams const &) const;
102         ///
103         std::string contextMenuName() const;
104         //@}
105
106         /// \name Static public methods obligated for InsetCommand derived classes
107         //@{
108         ///
109         static ParamInfo const & findInfo(std::string const &);
110         ///
111         static std::string defaultCommand() { return "printnomenclature"; };
112         ///
113         static bool isCompatibleCommand(std::string const & s) 
114                 { return s == "printnomenclature"; }
115         //@}
116
117 private:
118         /// \name Private functions inherited from Inset class
119         //@{
120         ///
121         Inset * clone() const { return new InsetPrintNomencl(*this); }
122         ///
123         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const;
124         ///
125         void doDispatch(Cursor & cur, FuncRequest & cmd);
126         //@}
127
128         /// \name Private functions inherited from InsetCommand class
129         //@{
130         ///
131         docstring screenLabel() const;
132         //@}
133 };
134
135 } // namespace lyx
136
137 #endif