- // Create a copy of a given MenuItem
- MenuItem(MenuItem const &);
- // Create a Command type MenuItem
- MenuItem(Kind kind_, string const & label_ = string(),
- string const & command_ = string());
- //
- ~MenuItem() {}
-
- // The label of a given menuitem
- string const & label() const { return label_; }
- // The kind of entry
- Kind kind() const { return kind_; }
- // the action (if relevant)
- int action() const { return action_; }
- // the description of the submenu (if relevant)
- string const & submenu() const { return submenu_; }
-
+
+ explicit MenuItem(Kind kind);
+
+ MenuItem(Kind kind,
+ docstring const & label,
+ docstring const & submenu = docstring(),
+ bool optional = false);
+
+ MenuItem(Kind kind,
+ docstring const & label,
+ FuncRequest const & func,
+ bool optional = false);
+
+ /// This one is just to please boost::shared_ptr<>
+ ~MenuItem();
+ /// The label of a given menuitem
+ docstring const label() const;
+ /// The keyboard shortcut (usually underlined in the entry)
+ docstring const shortcut() const;
+ /// The complete label, with label and shortcut separated by a '|'
+ docstring const fulllabel() const { return label_;}
+ /// The kind of entry
+ Kind kind() const { return kind_; }
+ /// the action (if relevant)
+ FuncRequest const & func() const { return func_; }
+ /// returns true if the entry should be ommited when disabled
+ bool optional() const { return optional_; }
+ /// returns the status of the lfun associated with this entry
+ FuncStatus const & status() const { return status_; }
+ /// returns the status of the lfun associated with this entry
+ FuncStatus & status() { return status_; }
+ /// returns the status of the lfun associated with this entry
+ void status(FuncStatus const & status) { status_ = status; }
+ /**
+ * returns the binding associated to this action.
+ * Use the native UI format when \c forgui is true.
+ */
+ docstring const binding(bool forgui) const;
+ /// the description of the submenu (if relevant)
+ docstring const & submenuname() const { return submenuname_; }
+ /// set the description of the submenu
+ void submenuname(docstring const & name) { submenuname_ = name; }
+ ///
+ Menu * submenu() const { return submenu_.get(); }
+ ///
+ void submenu(Menu * menu);
+