2 #ifndef MATH_BOXINSET_H
3 #define MATH_BOXINSET_H
5 #include "math_gridinset.h"
14 // Try to implement the reference inset "natively" for mathed.
15 // This is here temporarily until I can do cvs add again.
17 class ButtonInset: public MathNestInset {
22 void metrics(MathMetricsInfo & mi) const;
24 void draw(MathPainterInfo & pi, int x, int y) const;
27 /// This should provide the text for the button
28 virtual string screenLabel() const = 0;
32 // for things like \name[options]{contents}
33 class CommandInset : public ButtonInset {
35 /// name, contents, options deliminited by '|++|'
36 explicit CommandInset(string const & data);
38 MathInset * clone() const;
40 void write(WriteStream & os) const;
42 //void infoize(std::ostream & os) const;
44 //int dispatch(string const & cmd, idx_type idx, pos_type pos);
46 string screenLabel() const;
53 class RefInset : public CommandInset {
58 explicit RefInset(string const & data);
60 MathInset * clone() const;
62 //void write(WriteStream & os) const;
64 void infoize(std::ostream & os) const;
66 int dispatch(string const & cmd, idx_type idx, pos_type pos);
68 string screenLabel() const;
70 void validate(LaTeXFeatures & features) const;
72 /// plain ascii output
73 int ascii(std::ostream & os, int) const;
75 int linuxdoc(std::ostream & os) const;
77 int docbook(std::ostream & os, bool) const;
86 string short_gui_name;
88 static type_info types[];
90 static int getType(string const & name);
92 static string const & getName(int type);
96 /// Support for \\mbox
98 class MathBoxInset : public MathGridInset {
101 explicit MathBoxInset(string const & name);
103 MathInset * clone() const;
105 void metrics(MathMetricsInfo & mi) const;
107 void draw(MathPainterInfo & pi, int x, int y) const;
108 /// identifies BoxInsets
109 MathBoxInset * asBoxInset() { return this; }
110 /// identifies BoxInsets
111 MathBoxInset const * asBoxInset() const { return this; }
115 void write(WriteStream & os) const;
117 void normalize(NormalStream & ns) const;
121 mutable MathMetricsInfo mi_;