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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef MATH_MBOXINSET_H
|
|
|
|
|
#define MATH_MBOXINSET_H
|
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
|
#include "InsetMathDim.h"
|
2004-01-30 11:41:12 +00:00
|
|
|
|
#include "lyxtext.h"
|
|
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
2004-04-07 18:15:29 +00:00
|
|
|
|
// almost a substitute for the real text inset...
|
2004-01-30 11:41:12 +00:00
|
|
|
|
|
2006-09-16 18:11:38 +00:00
|
|
|
|
class InsetMathMBox : public InsetMathDim {
|
2004-01-30 11:41:12 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
2006-09-16 18:11:38 +00:00
|
|
|
|
explicit InsetMathMBox(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
|
|
|
|
///
|
2004-11-30 01:59:49 +00:00
|
|
|
|
void drawSelection(PainterInfo & pi, 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;
|
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int latex(Buffer const &, odocstream & os,
|
2004-04-07 18:15:29 +00:00
|
|
|
|
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
|
|
|
|
///
|
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:
|
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
|
|
|
|
};
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
2004-01-30 11:41:12 +00:00
|
|
|
|
#endif
|