]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathMacroTemplate.h
simplify GuiToc / TocWidget interaction. Much can still be simplified...
[lyx.git] / src / mathed / MathMacroTemplate.h
index c14bfcb3ebade4af9ebeb024efc737c91634ced1..6f2fa1d3b7e03b7696760bdf4f3390a82fb948a1 100644 (file)
@@ -38,6 +38,10 @@ public:
        ///
        EDITABLE editable() const { return HIGHLY_EDITABLE; }
        ///
+       void edit(Cursor & cur, bool front, EntryDirection entry_from);
+       ///
+       bool notifyCursorLeaves(Cursor & cur);
+       ///
        void read(Buffer const &, Lexer & lex);
        ///
        void write(Buffer const &, std::ostream & os) const;
@@ -76,6 +80,9 @@ public:
        /// Remove everything from the name which makes it invalid 
        /// and return true iff it is valid.
        bool fixNameAndCheckIfValid();
+       
+       /// request "external features"
+       virtual void validate(LaTeXFeatures &) const;
 
        /// decide whether its a redefinition
        void updateToContext(MacroContext const & mc) const;
@@ -90,6 +97,8 @@ public:
        MathMacroTemplate const * asMacroTemplate() const { return this; }
        ///
        InsetCode lyxCode() const { return MATHMACRO_CODE; }
+       ///
+       void infoize(odocstream & os) const;
 
 protected:
        ///
@@ -99,6 +108,10 @@ protected:
                FuncStatus & status) const;
 
 private:
+       friend class InsetLabelBox;
+       friend class DisplayLabelBox;
+       
+       ///
        virtual Inset * clone() const;
 
        /// remove #n with from<=n<=to
@@ -119,8 +132,10 @@ private:
        idx_type optIdx(idx_type n) const { return n + 1; }
        ///
        idx_type displayIdx() const { return optionals_ + 2; }
-       /// The label with some holes to edit
-       mutable MathData label_;
+       ///
+       void updateLook() const;
+       /// The representation of the macro tempalte, with some holes to edit
+       mutable MathData look_;
        ///
        mutable int numargs_;
        ///
@@ -133,6 +148,22 @@ private:
        mutable MacroType type_;
        /// defined before already?
        mutable bool redefinition_;
+       ///
+       void createLook() const;
+       ///
+       mutable bool lookOutdated_;
+       /// true if in pre-calculations of metrics to get height of boxes
+       mutable bool premetrics_;
+       ///
+       mutable int labelBoxAscent_;
+       ///
+       mutable int labelBoxDescent_;
+       ///
+       bool premetrics() const { return premetrics_; }
+       ///
+       int commonLabelBoxAscent() const { return labelBoxAscent_; }
+       ///
+       int commonLabelBoxDescent() const { return labelBoxDescent_; }
 };