]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathRef.h
This commit fixes a crash when accessing a math inset. This was due to an invalid...
[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 class Buffer;
18
19 // for \ref
20 class RefInset : public CommandInset {
21 public:
22         ///
23         RefInset();
24         ///
25         explicit RefInset(std::string const & data);
26         ///
27         //void write(WriteStream & os) const;
28         ///
29         void infoize(std::ostream & os) const;
30         ///
31         lyx::docstring const screenLabel() const;
32         ///
33         void validate(LaTeXFeatures & features) const;
34         ///
35         virtual RefInset * asRefInset() { return this; }
36
37         /// plain text output in ucs4 encoding
38         int plaintext(lyx::odocstream &, OutputParams const &) const;
39         /// docbook output
40         int docbook(Buffer const & buf, std::ostream & os, OutputParams const &) const;
41
42         struct ref_type_info {
43                 ///
44                 std::string latex_name;
45                 ///
46                 std::string gui_name;
47                 ///
48                 std::string short_gui_name;
49         };
50         static ref_type_info types[];
51         ///
52         static int getType(std::string const & name);
53         ///
54         static std::string const & getName(int type);
55 protected:
56         ///
57         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
58         ///
59         bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
60 private:
61         ///
62         virtual std::auto_ptr<InsetBase> doClone() const;
63 };
64
65 #endif