]> git.lyx.org Git - lyx.git/blob - src/mathed/ref_inset.h
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / ref_inset.h
1 // -*- C++ -*-
2 /**
3  * \file ref_inset.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 "command_inset.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         std::string const screenLabel() const;
32         ///
33         void validate(LaTeXFeatures & features) const;
34         ///
35         virtual RefInset * asRefInset() { return this; }
36
37         /// plain ascii output
38         int plaintext(std::ostream & os, OutputParams const &) const;
39         /// linuxdoc output
40         int linuxdoc(std::ostream & os, OutputParams const &) const;
41         /// docbook output
42         int docbook(Buffer const & buf, std::ostream & os, OutputParams const &) const;
43
44         /// small wrapper for the time being
45         DispatchResult localDispatch(FuncRequest & cmd);
46
47         struct ref_type_info {
48                 ///
49                 std::string latex_name;
50                 ///
51                 std::string gui_name;
52                 ///
53                 std::string short_gui_name;
54         };
55         static ref_type_info types[];
56         ///
57         static int getType(std::string const & name);
58         ///
59         static std::string const & getName(int type);
60 protected:
61         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
62 private:
63         ///
64         virtual std::auto_ptr<InsetBase> doClone() const;
65 };
66
67 #endif