2004-01-30 11:41:12 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file InsetMathMBox.h
|
2004-01-30 11:41:12 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2004-01-30 11:41:12 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2007-02-23 08:27:03 +00:00
|
|
|
#define MATH_MBOX
|
|
|
|
|
|
|
|
#ifdef MATH_MBOX
|
|
|
|
|
2004-01-30 11:41:12 +00:00
|
|
|
#ifndef MATH_MBOXINSET_H
|
|
|
|
#define MATH_MBOXINSET_H
|
|
|
|
|
2007-04-30 10:31:51 +00:00
|
|
|
#include "InsetMath.h"
|
2009-08-09 15:05:36 +00:00
|
|
|
|
|
|
|
#include "insets/InsetText.h"
|
2004-01-30 11:41:12 +00:00
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2007-02-23 08:10:13 +00:00
|
|
|
class Buffer;
|
|
|
|
class BufferView;
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2004-04-07 18:15:29 +00:00
|
|
|
// almost a substitute for the real text inset...
|
2004-01-30 11:41:12 +00:00
|
|
|
|
2007-04-30 10:31:51 +00:00
|
|
|
class InsetMathMBox : public InsetMath {
|
2004-01-30 11:41:12 +00:00
|
|
|
public:
|
|
|
|
///
|
2009-11-08 15:53:21 +00:00
|
|
|
explicit InsetMathMBox(Buffer * buffer);
|
|
|
|
explicit InsetMathMBox(Buffer * buffer, Layout const & layout);
|
2007-02-23 08:27:03 +00:00
|
|
|
|
2004-01-30 11:41:12 +00:00
|
|
|
/// this stores metrics information in cache_
|
2007-09-21 20:39:47 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
/// draw according to cached metrics
|
|
|
|
void draw(PainterInfo &, int x, int y) const;
|
2004-02-25 14:39:14 +00:00
|
|
|
///
|
|
|
|
bool inMathed() const { return false; }
|
2004-04-07 18:15:29 +00:00
|
|
|
///
|
|
|
|
bool isActive() const { return true; }
|
2004-01-30 11:41:12 +00:00
|
|
|
|
2004-04-07 18:15:29 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void write(WriteStream & os) const;
|
2004-04-07 18:15:29 +00:00
|
|
|
///
|
2011-02-10 22:57:41 +00:00
|
|
|
void latex(otexstream & os, OutputParams const & runparams) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2009-12-31 20:44:09 +00:00
|
|
|
void mathmlize(MathStream &) const;
|
|
|
|
///
|
2010-03-31 19:01:15 +00:00
|
|
|
void htmlize(HtmlStream &) const;
|
|
|
|
///
|
2007-04-29 23:33:02 +00:00
|
|
|
Text * getText(int) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2006-10-17 16:23:27 +00:00
|
|
|
void cursorPos(BufferView const & bv, CursorSlice const & sl,
|
|
|
|
bool boundary, int & x, int & y) const;
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
|
|
|
InsetCode lyxCode() const { return MATH_MBOX_CODE; }
|
|
|
|
|
2004-01-30 11:41:12 +00:00
|
|
|
protected:
|
2007-04-26 14:56:30 +00:00
|
|
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2004-11-24 21:58:42 +00:00
|
|
|
|
2004-04-03 08:37:12 +00:00
|
|
|
///
|
2009-08-09 15:05:36 +00:00
|
|
|
mutable InsetText text_;
|
2007-02-23 08:10:13 +00:00
|
|
|
|
2004-11-23 23:04:52 +00:00
|
|
|
private:
|
2007-08-30 18:03:17 +00:00
|
|
|
virtual Inset * clone() const;
|
2004-01-30 11:41:12 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
2007-02-23 08:27:03 +00:00
|
|
|
|
|
|
|
#endif //MATH_MBOXINSET_H
|
|
|
|
|
|
|
|
#endif //MATH_MBOX
|