2004-01-30 11:41:12 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file math_mboxinset.h
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef MATH_MBOXINSET_H
|
|
|
|
|
#define MATH_MBOXINSET_H
|
|
|
|
|
|
|
|
|
|
#include "math_diminset.h"
|
|
|
|
|
#include "lyxtext.h"
|
|
|
|
|
|
|
|
|
|
|
2004-04-07 18:15:29 +00:00
|
|
|
|
// almost a substitute for the real text inset...
|
2004-01-30 11:41:12 +00:00
|
|
|
|
|
|
|
|
|
class MathMBoxInset : public MathDimInset {
|
|
|
|
|
public:
|
|
|
|
|
///
|
2004-11-23 23:04:52 +00:00
|
|
|
|
explicit MathMBoxInset(BufferView & bv);
|
2004-01-30 11:41:12 +00:00
|
|
|
|
/// this stores metrics information in cache_
|
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
|
|
|
|
/// 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
|
|
|
|
///
|
|
|
|
|
void write(WriteStream & os) const;
|
|
|
|
|
///
|
|
|
|
|
int latex(Buffer const &, std::ostream & os,
|
|
|
|
|
OutputParams const & runparams) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
///
|
2004-04-03 08:37:12 +00:00
|
|
|
|
LyXText * getText(int) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
///
|
2004-04-13 12:47:48 +00:00
|
|
|
|
void getCursorPos(LCursor const & cur, int & x, int & y) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
protected:
|
2004-11-24 21:58:42 +00:00
|
|
|
|
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
|
|
|
|
|
|
2004-04-03 08:37:12 +00:00
|
|
|
|
///
|
2004-01-30 11:41:12 +00:00
|
|
|
|
mutable LyXText text_;
|
|
|
|
|
///
|
|
|
|
|
BufferView * const bv_;
|
2004-11-23 23:04:52 +00:00
|
|
|
|
private:
|
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|