X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_boxinset.h;h=c155a76301cd3d4a0294dd8af8d69777cb133c44;hb=b447408de232872fef1537fca542abc23702d572;hp=52054662a6c9794c1f0e63d3d10551845dfffde3;hpb=3786644124baf1b39ba36826e7f8ec348de42cb6;p=lyx.git diff --git a/src/mathed/math_boxinset.h b/src/mathed/math_boxinset.h index 52054662a6..c155a76301 100644 --- a/src/mathed/math_boxinset.h +++ b/src/mathed/math_boxinset.h @@ -1,126 +1,48 @@ // -*- C++ -*- +/** + * \file math_boxinset.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author André Pönitz + * + * Full author contact details are available in file CREDITS. + */ + #ifndef MATH_BOXINSET_H #define MATH_BOXINSET_H -#include "math_gridinset.h" -#include "LString.h" - -#ifdef __GNUG__ -#pragma interface -#endif - -class LyXFont; - -// Try to implement the reference inset "natively" for mathed. -// This is here temporarily until I can do cvs add again. - -class ButtonInset: public MathNestInset { -public: - /// - ButtonInset(); - /// - void metrics(MathMetricsInfo & mi) const; - /// - void draw(MathPainterInfo & pi, int x, int y) const; - -protected: - /// This should provide the text for the button - virtual string screenLabel() const = 0; -}; - - -// for things like \name[options]{contents} -class CommandInset : public ButtonInset { -public: - /// name, contents, options deliminited by '|++|' - explicit CommandInset(string const & data); - /// - MathInset * clone() const; - /// - void write(WriteStream & os) const; - /// - //void infoize(std::ostream & os) const; - /// - //int dispatch(string const & cmd, idx_type idx, pos_type pos); - /// - string screenLabel() const; -public: - string name_; -}; - - -// for \ref -class RefInset : public CommandInset { -public: - /// - RefInset(); - /// - explicit RefInset(string const & data); - /// - MathInset * clone() const; - /// - //void write(WriteStream & os) const; - /// - void infoize(std::ostream & os) const; - /// - int dispatch(string const & cmd, idx_type idx, pos_type pos); - /// - string screenLabel() const; - /// - void validate(LaTeXFeatures & features) const; - - /// plain ascii output - int ascii(std::ostream & os, int) const; - /// linuxdoc output - int linuxdoc(std::ostream & os) const; - /// docbook output - int docbook(std::ostream & os, bool) const; +#include "math_nestinset.h" +#include - struct type_info { - /// - string latex_name; - /// - string gui_name; - /// - string short_gui_name; - }; - static type_info types[]; - /// - static int getType(string const & name); - /// - static string const & getName(int type); -}; +class LyXFont; /// Support for \\mbox -class MathBoxInset : public MathGridInset { +class MathBoxInset : public MathNestInset { public: /// - explicit MathBoxInset(string const & name); + explicit MathBoxInset(std::string const & name); /// - MathInset * clone() const; + virtual std::auto_ptr clone() const; /// - void metrics(MathMetricsInfo & mi) const; + mode_type currentMode() const { return TEXT_MODE; } /// - void draw(MathPainterInfo & pi, int x, int y) const; - /// identifies BoxInsets - MathBoxInset * asBoxInset() { return this; } - /// identifies BoxInsets - MathBoxInset const * asBoxInset() const { return this; } + void metrics(MetricsInfo & mi, Dimension & dim) const; /// - void rebreak(); + void draw(PainterInfo & pi, int x, int y) const; /// void write(WriteStream & os) const; /// void normalize(NormalStream & ns) const; + /// + void infoize(std::ostream & os) const; private: /// - mutable MathMetricsInfo mi_; - /// - string name_; + std::string name_; };