]> git.lyx.org Git - features.git/blob - src/insets/InsetLabel.h
3ab79b6f2825c7194d573d6573738325c7d0079d
[features.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::initView.
28           **/
29         void initView();
30
31         ///
32         docstring screenLabel() const;
33         ///
34         EDITABLE editable() const { return IS_EDITABLE; }
35         ///
36         InsetCode lyxCode() const { return LABEL_CODE; }
37         ///
38         int latex(odocstream &, OutputParams const &) const;
39         ///
40         int plaintext(odocstream &, OutputParams const &) const;
41         ///
42         int docbook(odocstream &, OutputParams const &) const;
43         ///
44         static ParamInfo const & findInfo(std::string const &);
45         ///
46         static std::string defaultCommand() { return "label"; };
47         ///
48         static bool isCompatibleCommand(std::string const & s) 
49                 { return s == "label"; }
50         ///
51         void updateLabels(ParIterator const & it);
52         ///
53         void addToToc(ParConstIterator const &) const;
54         ///
55         void updateCommand(docstring const & new_label, bool updaterefs = true);
56 protected:
57         ///
58         void doDispatch(Cursor & cur, FuncRequest & cmd);
59 private:
60         ///
61         Inset * clone() const { return new InsetLabel(*this); }
62         ///
63         docstring screen_label_;
64 };
65
66
67 } // namespace lyx
68
69 #endif