+ ///
+ docstring name() const;
+ ///
+ bool validName() const;
+ ///
+ size_t arity() const {
+ if (displayMode_ == DISPLAY_NORMAL )
+ return cells_.size();
+ else
+ return 0;
+ }
+
+ ///
+ size_t optionals() const { return optionals_; }
+ ///
+ void setOptionals(int n) {
+ if (n <= int(nargs()))
+ optionals_ = n;
+ }
+
+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);
+ /// 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 const * bvCur);
+ /// 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);
+ ///
+ MacroData const * macro() { return macro_; }
+ ///
+ bool editMetrics(BufferView const * bv) const;
+
+private:
+ ///
+ virtual Inset * clone() const;
+ ///
+ bool editMode(BufferView const * bv) const;
+