2001-02-16 09:25:43 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
|
* \file InsetMathFrac.h
|
2003-08-19 13:00:56 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
|
#ifndef MATH_FRACINSET_H
|
|
|
|
|
#define MATH_FRACINSET_H
|
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
|
#include "InsetMathFracBase.h"
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/// Fraction like objects (frac, binom)
|
2006-09-16 18:11:38 +00:00
|
|
|
|
class InsetMathFrac : public InsetMathFracBase {
|
2001-02-13 13:28:32 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
2006-04-06 09:46:01 +00:00
|
|
|
|
enum Kind {
|
|
|
|
|
FRAC,
|
2006-07-19 10:50:18 +00:00
|
|
|
|
OVER,
|
2006-04-06 09:46:01 +00:00
|
|
|
|
ATOP,
|
|
|
|
|
NICEFRAC
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///
|
2006-09-16 18:11:38 +00:00
|
|
|
|
explicit InsetMathFrac(Kind kind = FRAC);
|
2001-02-13 13:28:32 +00:00
|
|
|
|
///
|
2006-11-28 15:15:49 +00:00
|
|
|
|
bool metrics(MetricsInfo & mi, Dimension & dim) const;
|
2001-04-25 15:43:57 +00:00
|
|
|
|
///
|
2003-03-21 14:20:48 +00:00
|
|
|
|
void draw(PainterInfo &, int x, int y) const;
|
2001-11-13 18:33:48 +00:00
|
|
|
|
///
|
2003-05-28 13:22:36 +00:00
|
|
|
|
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
|
2002-03-19 16:55:58 +00:00
|
|
|
|
///
|
2002-03-21 06:57:13 +00:00
|
|
|
|
void drawT(TextPainter &, int x, int y) const;
|
2002-08-08 16:08:11 +00:00
|
|
|
|
/// identifies FracInsets
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathFrac * asFracInset();
|
2002-08-08 16:08:11 +00:00
|
|
|
|
/// identifies FracInsets
|
2006-09-16 18:11:38 +00:00
|
|
|
|
InsetMathFrac const * asFracInset() const;
|
2002-08-01 15:53:46 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
docstring name() const;
|
2006-07-16 17:19:05 +00:00
|
|
|
|
///
|
|
|
|
|
bool extraBraces() const;
|
2001-11-09 08:35:57 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
void write(WriteStream & os) const;
|
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void maple(MapleStream &) const;
|
2001-11-07 17:30:26 +00:00
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void mathematica(MathematicaStream &) const;
|
2002-07-01 11:17:14 +00:00
|
|
|
|
///
|
2003-02-14 14:30:09 +00:00
|
|
|
|
void octave(OctaveStream &) const;
|
2002-04-25 15:37:10 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
void mathmlize(MathStream &) const;
|
2006-04-06 09:46:01 +00:00
|
|
|
|
///
|
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2001-08-17 17:50:00 +00:00
|
|
|
|
public:
|
2007-04-29 13:39:47 +00:00
|
|
|
|
virtual std::auto_ptr<Inset> doClone() const;
|
2001-08-17 17:50:00 +00:00
|
|
|
|
///
|
2006-04-06 09:46:01 +00:00
|
|
|
|
Kind kind_;
|
2001-02-13 13:28:32 +00:00
|
|
|
|
};
|
2001-02-16 09:25:43 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
2001-02-13 13:28:32 +00:00
|
|
|
|
#endif
|