]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.h
rename commandtags.h to lfuns.h and renumber/cleanup. Rebuild the tree !
[lyx.git] / src / mathed / math_inset.h
index b847533983ddf9f4aa956a732ad1e97ed0d0df0c..ed95d8d3e2f60d0c71808647e522ae44664fbc6f 100644 (file)
 #ifndef MATH_INSET_H
 #define MATH_INSET_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"
 
 /**
@@ -53,6 +51,7 @@ class MathCharInset;
 class MathDelimInset;
 class MathGridInset;
 class MathFracInset;
+class MathFontInset;
 class MathHullInset;
 class MathMatrixInset;
 class MathNestInset;
@@ -63,7 +62,7 @@ class MathSpaceInset;
 class MathSymbolInset;
 class MathUnknownInset;
 
-class InsetRef;
+class RefInset;
 
 class NormalStream;
 class OctaveStream;
@@ -84,7 +83,7 @@ class Dimension;
 class FuncRequest;
 
 
-class MathInset {
+class MathInset : public InsetBase {
 public:
        /// short of anything else reasonable
        typedef MathArray::size_type        size_type;
@@ -101,8 +100,6 @@ public:
 
        /// our members behave nicely...
        MathInset() {}
-       /// the virtual base destructor
-       virtual ~MathInset() {}
 
        /// reproduce itself
        virtual MathInset * clone() const = 0;
@@ -200,6 +197,8 @@ public:
        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; }
@@ -219,7 +218,7 @@ public:
        virtual MathSymbolInset const   * asSymbolInset() const   { return 0; }
        virtual MathUnknownInset        * asUnknownInset()        { return 0; }
        virtual MathUnknownInset const  * asUnknownInset() const  { return 0; }
-       virtual InsetRef                * asInsetRef()            { return 0; }
+       virtual RefInset                * asRefInset()            { return 0; }
 
        /// identifies things that can get scripts
        virtual bool isScriptable() const { return false; }
@@ -228,13 +227,7 @@ public:
        /// 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};
-       /// Dispatch result codes, see inset/inset.h
-       enum result_type {
-               UNDISPATCHED = 0, DISPATCHED, DISPATCHED_NOUPDATE,
-               FINISHED, FINISHED_RIGHT, FINISHED_UP, FINISHED_DOWN,
-               DISPATCHED_POP
-       };
+       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 {..}
@@ -263,24 +256,26 @@ public:
        /// 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 maximize(MaximaStream &) const;
+       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
@@ -290,9 +285,6 @@ public:
 
        /// dump content to stderr for debugging
        virtual void dump() const;
-       /// local dispatcher
-       virtual result_type dispatch
-               (FuncRequest const & cmd, idx_type & idx, pos_type & pos);
 
        /// LyXInset stuff
        /// write labels into a list
@@ -307,6 +299,10 @@ public:
        virtual string fileInsetLabel() const { return "Formula"; }
        /// usually the latex name
        virtual string name() const;
+
+protected:
+       /// a dirty hack
+       BufferView * view() const;
 };
 
 std::ostream & operator<<(std::ostream &, MathAtom const &);
@@ -319,8 +315,4 @@ MathArray asArray(string const & str);
 // initialize math
 void initMath();
 
-/// here to ssave a few includes in the insets
-class Dialogs;
-Dialogs & getDialogs();
-
 #endif