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