]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_decorationinset.h
split inset -> inset + updatableinset
[lyx.git] / src / mathed / math_decorationinset.h
index f6eb141034b019292034ff38fc63cafc85e232e1..97c56ba383852185d75f3d481ae8b05a8dc033be 100644 (file)
@@ -1,29 +1,53 @@
+// -*- C++ -*-
 #ifndef MATH_DECORATIONINSET_H
 #define MATH_DECORATIONINSET_H
 
-#include "math_parinset.h"
+#include "math_nestinset.h"
+#include "LString.h"
 
-/// Decorations over (below) a math object
-class MathDecorationInset: public MathParInset {
+
+/** Decorations and accents over (below) a math object
+ *  \author Alejandro Aguilar Sierra
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+class latexkeys;
+
+class MathDecorationInset : public MathNestInset {
 public:
        ///
-       MathDecorationInset(int, short st = LM_ST_TEXT);
+       explicit MathDecorationInset(latexkeys const * key);
        ///
-       MathedInset * Clone();
+       MathInset * clone() const;
        ///
-       void draw(Painter &, int, int);
+       void draw(MathPainterInfo &, int x, int y) const;
        ///
-       void Write(std::ostream &, bool fragile);
+       void write(WriteStream & os) const;
        ///
-       void Metrics();
+       void metrics(MathMetricsInfo & mi) const;
        ///
-       bool GetLimits() const;
-protected:
+       void normalize(NormalStream & os) const;
        ///
-       int deco;
+       void infoize(std::ostream & os) const;
        ///
-       bool upper;
+       bool isScriptable() const;
+
+private:
+       ///
+       bool upper() const;
+       ///
+       bool protect() const;
+       /// is it a wide decoration?
+       bool wide() const;
+
        ///
-       int dw, dh, dy;
+       latexkeys const * key_;
+       /// height cache of deco
+       mutable int dh_;
+       /// vertical offset cache of deco
+       mutable int dy_;
+       /// width for non-wide deco
+       mutable int dw_;
 };
 #endif