]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLabel.h
This patch introduces an optional argument to Buffer::updateLabels(), so
[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(Buffer * buf, 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         bool hasSettings() const { return true; }
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         docstring xhtml(XHTMLStream &, OutputParams const &) const;
48         ///
49         static ParamInfo const & findInfo(std::string const &);
50         ///
51         static std::string defaultCommand() { return "label"; }
52         ///
53         static bool isCompatibleCommand(std::string const & s) 
54                 { return s == "label"; }
55         ///
56         void updateLabels(ParIterator const & it, bool);
57         ///
58         void addToToc(DocIterator const &);
59         ///
60         void updateCommand(docstring const & new_label, bool updaterefs = true);
61         ///
62         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const;
63 protected:
64         ///
65         void doDispatch(Cursor & cur, FuncRequest & cmd);
66 private:
67         ///
68         Inset * clone() const { return new InsetLabel(*this); }
69         ///
70         docstring screen_label_;
71 };
72
73
74 } // namespace lyx
75
76 #endif