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.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* 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"
|
2007-04-29 23:33:02 +00:00
|
|
|
|
#include "Text.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:
|
|
|
|
|
///
|
2007-02-23 08:27:03 +00:00
|
|
|
|
explicit InsetMathMBox();
|
2008-03-06 21:31:27 +00:00
|
|
|
|
explicit InsetMathMBox(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
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
|
int latex(odocstream & os, OutputParams const & runparams) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
///
|
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;
|
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
|
|
|
|
///
|
2007-04-29 23:33:02 +00:00
|
|
|
|
mutable Text 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
|