]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathScript.h
Revert "DocBook: make openParTag/closeTag use paragraphs instead of layouts."
[lyx.git] / src / mathed / InsetMathScript.h
index d0707439b9a75bc2c79204e160ee815fded49104..bc048e2f1c2f61ab30c44e5c3a734d8a891127b3 100644 (file)
@@ -25,7 +25,7 @@ namespace lyx {
 class InsetMathScript : public InsetMathNest {
 public:
        /// create inset without scripts
-       InsetMathScript(Buffer * buf);
+       explicit InsetMathScript(Buffer * buf);
        /// create inset with single script
        explicit InsetMathScript(Buffer * buf, bool up);
        /// create inset with single script and given nucleus
@@ -49,10 +49,8 @@ public:
        bool idxForward(Cursor & cur) const;
        /// move cursor up or down
        bool idxUpDown(Cursor & cur, bool up) const;
-       /// Target pos when we enter the inset while moving forward
-       bool idxFirst(Cursor & cur) const;
-       /// Target pos when we enter the inset while moving backwards
-       bool idxLast(Cursor & cur) const;
+       /// The index of the cell entered while moving backward
+       size_type lastIdx() const { return 0; }
 
        /// write LaTeX and Lyx code
        void write(WriteStream & os) const;
@@ -74,10 +72,6 @@ public:
        ///
        InsetMathScript * asScriptInset();
 
-       /// set limits
-       void limits(int lim) { limits_ = lim; }
-       /// get limits
-       int limits() const { return limits_; }
        /// returns subscript. Always run 'hasDown' or 'has(false)' before!
        MathData const & down() const;
        /// returns subscript. Always run 'hasDown' or 'has(false)' before!
@@ -110,11 +104,6 @@ public:
        InsetCode lyxCode() const { return MATH_SCRIPT_CODE; }
        ///
        void validate(LaTeXFeatures &features) const;
-protected:
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
-       /// do we want to handle this event?
-       bool getStatus(Cursor & cur, FuncRequest const & cmd,
-               FuncStatus & status) const;
 private:
        virtual Inset * clone() const;
        /// returns x offset for main part
@@ -135,17 +124,20 @@ private:
        int nasc(BufferView const &) const;
        /// returns descent of nucleus if any
        int ndes(BufferView const &) const;
-       /// returns superscript kerning of nucleus if any
+       /// Italic correction: amount of displacement between subscript and
+       /// superscript in math mode as per Appendix G, rule 18f.  A positive value
+       /// shifts the superscript to the right, and a negative value shifts the
+       /// subscript to the left.
        int nker(BufferView const * bv) const;
-       /// where do we have to draw the scripts?
-       bool hasLimits() const;
+       /// do we we have to draw the scripts above/below nucleus?
+       bool hasLimits(FontInfo const &) const;
        /// clean up empty cells and return true if a cell has been deleted.
        bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
 
        /// possible subscript (index 0) and superscript (index 1)
        bool cell_1_is_up_;
-       /// 1 - "limits", -1 - "nolimits", 0 - "default"
-       int limits_;
+       /// remember whether we are in display mode (used by mathml output)
+       mutable bool has_limits_ = false;
 };