]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.h
small up/down tweaking
[lyx.git] / src / mathed / math_inset.h
index 8ca244a7542f54060d9519ae7cc4cf71568251d2..bae365ab860d4d135627568c6196fdbb456e4659 100644 (file)
@@ -1,5 +1,5 @@
 // -*- 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 "math_data.h"
@@ -53,6 +53,7 @@ class MathCharInset;
 class MathDelimInset;
 class MathGridInset;
 class MathFracInset;
+class MathFontInset;
 class MathHullInset;
 class MathMatrixInset;
 class MathNestInset;
@@ -68,6 +69,7 @@ class InsetRef;
 class NormalStream;
 class OctaveStream;
 class MapleStream;
+class MaximaStream;
 class MathematicaStream;
 class MathMLStream;
 class WriteStream;
@@ -199,6 +201,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; }
@@ -227,7 +231,14 @@ 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};
+       enum mode_type {UNDECIDED_MODE, TEXT_MODE, MATH_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
+       };
+
        virtual mode_type currentMode() const { return UNDECIDED_MODE; }
        /// will this get written as a single block in {..}
        virtual bool extraBraces() const { return false; }
@@ -255,7 +266,7 @@ 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;
@@ -263,14 +274,18 @@ public:
        virtual void normalize(NormalStream &) const;
        /// write content as something readable by Maple
        virtual void maplize(MapleStream &) const;
+       /// write content as something readable by Maxima
+       virtual void maximize(MaximaStream &) const;
        /// write content as something readable by Mathematica
        virtual void mathematicize(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
+       /// 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
@@ -281,7 +296,8 @@ public:
        /// dump content to stderr for debugging
        virtual void dump() const;
        /// local dispatcher
-       virtual int dispatch(FuncRequest const & cmd, idx_type idx, pos_type pos);
+       virtual result_type dispatch
+               (FuncRequest const & cmd, idx_type & idx, pos_type & pos);
 
        /// LyXInset stuff
        /// write labels into a list
@@ -300,15 +316,16 @@ public:
 
 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();
 
 #endif