]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathRef.h
New DocBook support
[lyx.git] / src / mathed / InsetMathRef.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathRef.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef REF_INSET_H
13 #define REF_INSET_H
14
15
16 #include "InsetMathCommand.h"
17
18
19 namespace lyx {
20 class Buffer;
21
22 // for \ref
23 class InsetMathRef : public InsetMathCommand {
24 public:
25         ///
26         explicit InsetMathRef(Buffer * buf);
27         ///
28         explicit InsetMathRef(Buffer * buf, docstring const & data);
29         ///
30         void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
31         ///
32         //void write(WriteStream & os) const;
33         ///
34         void infoize(odocstream & os) const;
35         ///
36         mode_type currentMode() const { return TEXT_MODE; }
37         ///
38         bool lockedMode() const { return true; }
39         ///
40         bool asciiOnly() const { return true; }
41         ///
42         docstring const screenLabel() const;
43         ///
44         void validate(LaTeXFeatures & features) const;
45         ///
46         void changeTarget(docstring const & target);
47         ///
48         virtual InsetMathRef * asRefInset() { return this; }
49
50         /// docbook output
51         void docbook(XMLStream &, OutputParams const &) const;
52         /// generate something that will be understood by the Dialogs.
53         std::string const createDialogStr() const;
54
55         struct ref_type_info {
56                 ///
57                 docstring latex_name;
58                 ///
59                 docstring gui_name;
60                 ///
61                 docstring short_gui_name;
62         };
63         static ref_type_info types[];
64         ///
65         static int getType(docstring const & name);
66         ///
67         static docstring const & getName(int type);
68         ///
69         docstring const getTarget() const;
70         ///
71         InsetCode lyxCode() const { return MATH_REF_CODE; }
72
73 protected:
74         ///
75         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
76         ///
77         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
78 private:
79         ///
80         virtual Inset * clone() const;
81 };
82
83
84
85 } // namespace lyx
86 #endif