- virtual MathInset * asMathInset() { return 0; }
- /// identification as non-math inset
- virtual UpdatableInset * asUpdatableInset() { return 0; }
-
- // the real dispatcher
- void dispatch(LCursor & cur, FuncRequest const & cmd);
+ virtual InsetMath * asInsetMath() { return 0; }
+ /// true for 'math' math inset, but not for e.g. mbox
+ virtual bool inMathed() const { return false; }
+
+ /// the real dispatcher
+ void dispatch(LCursor & cur, FuncRequest & cmd);
+ /**
+ * \returns true if this function made a definitive decision on
+ * whether the inset wants to handle the request \p cmd or not.
+ * The result of this decision is put into \p status.
+ *
+ * Every request that is enabled in this method needs to be handled
+ * in doDispatch(). Normally we have a 1:1 relationship between the
+ * requests handled in getStatus() and doDispatch(), but there are
+ * some exceptions:
+ * - A request that is disabled in getStatus() does not need to
+ * appear in doDispatch(). It is guaranteed that doDispatch()
+ * is never called with this request.
+ * - A few requests are en- or disabled in InsetBase::getStatus().
+ * These need to be handled in the doDispatch() methods of the
+ * derived insets, since InsetBase::doDispatch() has not enough
+ * information to handle them.
+ * - LFUN_MOUSE_* need not to be handled in getStatus(), because these
+ * are dispatched directly
+ */
+ virtual bool getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const;