+ docstring macroName() const;
+ /// Level of nesting in macros (including this one)
+ int nesting() const;
+ ///
+ bool validName() const;
+ ///
+ size_t arity() const;
+
+ ///
+ size_t optionals() const;
+ ///
+ void setOptionals(int n);
+ /// Return the maximal number of arguments the macro is greedy for.
+ size_t appetite() const;
+ ///
+ InsetCode lyxCode() const { return MATH_MACRO_CODE; }
+ /// This is not used for display; however whether it is mathrel determines
+ /// how to split equations intelligently.
+ MathClass mathClass() const; //override
+
+protected:
+ friend class MathData;
+ friend class ArgumentProxy;
+ friend class Cursor;
+
+ /// update the display mode (should only be called after detaching arguments)
+ void setDisplayMode(DisplayMode mode, int appetite = -1);
+ /// compute the next display mode
+ DisplayMode computeDisplayMode() const;
+ /// update macro definition
+ void updateMacro(MacroContext const & mc);
+ /// check if macro definition changed, argument changed etc. and adapt
+ void updateRepresentation(Cursor * cur, MacroContext const & mc,
+ UpdateType, int nesting);
+ /// empty macro, put arguments into args, possibly strip arity-attachedArgsNum_ empty ones.
+ /// Includes the optional arguments.
+ void detachArguments(std::vector<MathData> & args, bool strip);
+ /// attach arguments (maybe less than arity at the end of an MathData),
+ /// including the optional ones (even if it can be empty here)
+ void attachArguments(std::vector<MathData> const & args, size_t arity, int optionals);