]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLabel.h
Initialize biblioChanged_ when we update the document settings dialog.
[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 Counter;
21
22 class InsetLabel : public InsetCommand 
23 {
24 public:
25         ///
26         InsetLabel(Buffer * buf, InsetCommandParams const &);
27
28         ///
29         docstring const & activeCounter() const { return active_counter_; }
30         ///
31         docstring const & counterValue() const { return counter_value_; }
32         ///
33         docstring const & prettyCounter() const { return pretty_counter_; }
34         /// Updates only the label string, doesn't handle undo nor references.
35         void updateLabel(docstring const & new_label);
36         /// Updates the label and the references to it.
37         /// Will also handle undo/redo if \p cursor is passed.
38         void updateLabelAndRefs(docstring const & new_label, Cursor * cursor = 0);
39
40         /// \name Public functions inherited from Inset class
41         //@{
42         /// verify label and update references.
43         void initView();
44         ///
45         bool isLabeled() const { return true; }
46         ///
47         bool hasSettings() const { return true; }
48         ///
49         InsetCode lyxCode() const { return LABEL_CODE; }
50         ///
51         int plaintext(odocstream &, OutputParams const &) const;
52         ///
53         int docbook(odocstream &, OutputParams const &) const;
54         ///
55         docstring xhtml(XHTMLStream &, OutputParams const &) const;
56         ///
57         void updateBuffer(ParIterator const & it, UpdateType);
58         ///
59         void addToToc(DocIterator const &) const;
60         //@}
61
62         /// \name Static public methods obligated for InsetCommand derived classes
63         //@{
64         ///
65         static ParamInfo const & findInfo(std::string const &);
66         ///
67         static std::string defaultCommand() { return "label"; }
68         ///
69         static bool isCompatibleCommand(std::string const & s) 
70                 { return s == "label"; }
71         //@}
72
73         //FIXME: private
74         /// \name Private functions inherited from InsetCommand class
75         //@{
76         ///
77         docstring screenLabel() const;
78         //@}
79         
80 private:
81         /// \name Private functions inherited from Inset class
82         //@{
83         ///
84         Inset * clone() const { return new InsetLabel(*this); }
85         ///
86         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const;
87         ///
88         void doDispatch(Cursor & cur, FuncRequest & cmd);
89         //@}
90
91         ///
92         void uniqueLabel(docstring & label) const;
93         ///
94         void updateReferences(docstring const & old_label,
95                 docstring const & new_label);
96         ///
97         docstring screen_label_;
98         ///
99         docstring active_counter_;
100         ///
101         docstring counter_value_;
102         ///
103         docstring pretty_counter_;
104 };
105
106
107 } // namespace lyx
108
109 #endif