// -*- C++ -*-
-/*
+/**
* File: math_inset.h
* Purpose: Declaration of insets for mathed
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
#ifndef MATH_INSET_H
#define MATH_INSET_H
-#include <config.h>
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include <config.h>
#include "LString.h"
#include "frontends/mouse_state.h"
+#include "insets/insetbase.h"
#include "math_data.h"
/**
class MathDelimInset;
class MathGridInset;
class MathFracInset;
+class MathFontInset;
class MathHullInset;
class MathMatrixInset;
class MathNestInset;
class NormalStream;
class OctaveStream;
class MapleStream;
+class MaximaStream;
class MathematicaStream;
class MathMLStream;
class WriteStream;
class MathMacroTemplate;
class MathPosFinder;
class Dimension;
+class FuncRequest;
-class MathInset {
+class MathInset : public InsetBase {
public:
/// short of anything else reasonable
typedef MathArray::size_type size_type;
/// our members behave nicely...
MathInset() {}
- /// the virtual base destructor
- virtual ~MathInset() {}
/// reproduce itself
virtual MathInset * clone() const = 0;
virtual MathDelimInset const * asDelimInset() const { return 0; }
virtual MathFracInset * asFracInset() { return 0; }
virtual MathFracInset const * asFracInset() const { return 0; }
+ virtual MathFontInset * asFontInset() { return 0; }
+ virtual MathFontInset const * asFontInset() const { return 0; }
virtual MathGridInset * asGridInset() { return 0; }
virtual MathGridInset const * asGridInset() const { return 0; }
virtual MathHullInset * asHullInset() { return 0; }
/// is the a relational operator (used for splitting equations)
virtual bool isRelOp() const { return false; }
/// -1: text mode, 1: math mode, 0 undecided
- enum mode_type {UNDECIDED_MODE, TEXT_MODE, MATH_MODE, VERBATIM_MODE};
+ enum mode_type {UNDECIDED_MODE, TEXT_MODE, MATH_MODE};
+
virtual mode_type currentMode() const { return UNDECIDED_MODE; }
/// will this get written as a single block in {..}
virtual bool extraBraces() const { return false; }
/// access to the lock (only nest array have one)
virtual void lock(bool) {}
/// get notification when the cursor leaves this inset
- virtual void notifyCursorLeaves() {}
+ virtual void notifyCursorLeaves(idx_type) {}
/// write LaTeX and Lyx code
virtual void write(WriteStream & os) const;
/// write normalized content
virtual void normalize(NormalStream &) const;
/// write content as something readable by Maple
- virtual void maplize(MapleStream &) const;
+ virtual void maple(MapleStream &) const;
+ /// write content as something readable by Maxima
+ virtual void maxima(MaximaStream &) const;
/// write content as something readable by Mathematica
- virtual void mathematicize(MathematicaStream &) const;
+ virtual void mathematica(MathematicaStream &) const;
/// write content as something resembling MathML
virtual void mathmlize(MathMLStream &) const;
/// write content as something readable by Octave
- virtual void octavize(OctaveStream &) const;
- /// describe content
+ virtual void octave(OctaveStream &) const;
+ /// describe content if cursor inside
virtual void infoize(std::ostream &) const {}
+ /// describe content if cursor behind
+ virtual void infoize2(std::ostream &) const {}
/// plain ascii output
virtual int ascii(std::ostream & os, int) const;
/// linuxdoc output
/// dump content to stderr for debugging
virtual void dump() const;
- /// local dispatcher
- virtual int dispatch(string const & cmd, idx_type idx, pos_type pos);
/// LyXInset stuff
/// write labels into a list
std::ostream & operator<<(std::ostream &, MathAtom const &);
+// converts single cell to string
string asString(MathArray const & ar);
+// converts string to single cell
MathArray asArray(string const & str);
+
+// initialize math
void initMath();
/// here to ssave a few includes in the insets
class Dialogs;
-class LyXFunc;
-
-Dialogs * getDialogs();
-LyXFunc * getLyXFunc();
+Dialogs & getDialogs();
#endif