]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLabel.h
Cocoa based Qt-4.6 needs to paint every character separately to match metrics computa...
[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         ///
35         void updateCommand(docstring const & new_label, bool updaterefs = true);
36
37         /// \name Public functions inherited from Inset class
38         //@{
39         /// verify label and update references.
40         void initView();
41         ///
42         bool isLabeled() const { return true; }
43         ///
44         bool hasSettings() const { return true; }
45         ///
46         InsetCode lyxCode() const { return LABEL_CODE; }
47         ///
48         int plaintext(odocstream &, OutputParams const &) const;
49         ///
50         int docbook(odocstream &, OutputParams const &) const;
51         ///
52         docstring xhtml(XHTMLStream &, OutputParams const &) const;
53         ///
54         void updateBuffer(ParIterator const & it, UpdateType);
55         ///
56         void addToToc(DocIterator const &) const;
57         //@}
58
59         /// \name Static public methods obligated for InsetCommand derived classes
60         //@{
61         ///
62         static ParamInfo const & findInfo(std::string const &);
63         ///
64         static std::string defaultCommand() { return "label"; }
65         ///
66         static bool isCompatibleCommand(std::string const & s) 
67                 { return s == "label"; }
68         //@}
69
70         //FIXME: private
71         /// \name Private functions inherited from InsetCommand class
72         //@{
73         ///
74         docstring screenLabel() const;
75         //@}
76         
77 private:
78         /// \name Private functions inherited from Inset class
79         //@{
80         ///
81         Inset * clone() const { return new InsetLabel(*this); }
82         ///
83         bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & status) const;
84         ///
85         void doDispatch(Cursor & cur, FuncRequest & cmd);
86         //@}
87
88         ///
89         docstring screen_label_;
90         ///
91         docstring active_counter_;
92         ///
93         docstring counter_value_;
94         ///
95         docstring pretty_counter_;
96 };
97
98
99 } // namespace lyx
100
101 #endif