]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLabel.h
7fe8a0c290134a29a8fdfed290df1629b8275d44
[lyx.git] / src / insets / InsetLabel.h
1 // -*- C++ -*-
2 /**
3  * \file InsetLabel.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  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_LABEL_H
13 #define INSET_LABEL_H
14
15 #include "InsetCommand.h"
16
17
18 namespace lyx {
19
20 class InsetLabel : public InsetCommand {
21 public:
22         ///
23         InsetLabel(InsetCommandParams const &);
24
25         /// verify label and update references.
26         /**
27           * Overloaded from Inset::validate.
28           **/
29         void validate();
30
31         ///
32         docstring screenLabel() const;
33         ///
34         EDITABLE editable() const { return IS_EDITABLE; }
35         ///
36         InsetCode lyxCode() const { return LABEL_CODE; }
37         /// Appends \c list with this label
38         void getLabelList(std::vector<docstring> & list) const;
39         ///
40         int latex(odocstream &, OutputParams const &) const;
41         ///
42         int plaintext(odocstream &, OutputParams const &) const;
43         ///
44         int docbook(odocstream &, OutputParams const &) const;
45         ///
46         static ParamInfo const & findInfo(std::string const &);
47         ///
48         static std::string defaultCommand() { return "label"; };
49         ///
50         static bool isCompatibleCommand(std::string const & s) 
51                 { return s == "label"; }
52         ///
53         void updateLabels(ParIterator const & it);
54         ///
55         void addToToc(ParConstIterator const &) const;
56         ///
57         void update(docstring const & new_label, bool updaterefs = true);
58 protected:
59         ///
60         void doDispatch(Cursor & cur, FuncRequest & cmd);
61 private:
62         ///
63         Inset * clone() const { return new InsetLabel(*this); }
64 };
65
66
67 } // namespace lyx
68
69 #endif