]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.h
adjust
[lyx.git] / src / MenuBackend.h
index 878046db38cb18226a827f1d50581c73484904d0..c9f3e8de01e769dfb2f7e4b5414bd061eec980a1 100644 (file)
 #define MENUBACKEND_H
 
 #include "FuncStatus.h"
-#include "funcrequest.h"
+#include "FuncRequest.h"
 
 #include <boost/shared_ptr.hpp>
 
 #include <vector>
+#include <stack>
 
 
 namespace lyx {
 
-class LyXLex;
+class Lexer;
 class Buffer;
 class Menu;
 
@@ -44,6 +45,8 @@ public:
                /** This is the list of opened Documents,
                    typically for the Documents menu. */
                Documents,
+               /** This is the bookmarks */
+               Bookmarks,
                ///
                Toc,
                /** This is a list of viewable formats
@@ -61,6 +64,12 @@ public:
                /** This is the list of elements available
                 * for insertion into document. */
                CharStyles,
+               /** This is the list of user-configurable
+               insets to insert into document */
+               Custom,
+               /** This is the list of XML elements to
+               insert into the document */
+               Elements,
                /** This is the list of floats that we can
                    insert a list for. */
                FloatListInsert,
@@ -70,6 +79,8 @@ public:
                /** This is the list of selections that can
                    be pasted. */
                PasteRecent,
+               /** toolbars */
+               Toolbars,
                /** Available branches in document */
                Branches
        };
@@ -106,8 +117,11 @@ public:
        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
-       docstring const binding() const;
+       /**
+        * 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
@@ -154,7 +168,7 @@ public:
        /// menu item.
        Menu & addWithStatusCheck(MenuItem const &);
        ///
-       Menu & read(LyXLex &);
+       Menu & read(Lexer &);
        ///
        docstring const & name() const { return name_; }
        ///
@@ -178,6 +192,10 @@ public:
 
        // Check whether the menu shortcuts are unique
        void checkShortcuts() const;
+       
+       // search for func in this menu iteratively, and put menu
+       // names in a stack.
+       bool searchFunc(FuncRequest & func, std::stack<docstring> & names);
 
 private:
        friend class MenuBackend;
@@ -198,9 +216,9 @@ public:
        ///
        typedef MenuList::iterator iterator;
        ///
-       MenuBackend() : specialmenu_(0) {}
+       MenuBackend() {}
        ///
-       void read(LyXLex &);
+       void read(Lexer &);
        ///
        void add(Menu const &);
        ///
@@ -214,10 +232,13 @@ public:
        ///
        bool empty() const { return menulist_.empty(); }
        /** This defines a menu whose entries list the FuncRequests
-           will be removed by expand() in other menus. This is used by
-           the Qt/Mac code
+           that will be removed by expand() in other menus. This is
+           used by the Qt/Mac code
        */
-       void specialMenu(docstring const &);
+       void specialMenu(Menu const &);
+       ///
+       Menu const & specialMenu() { return specialmenu_; }
+
        /// Expands some special entries of the menu
        /** The entries with the following kind are expanded to a
            sequence of Command MenuItems: Lastfiles, Documents,
@@ -247,7 +268,7 @@ private:
        ///
        Menu menubar_;
        ///
-       Menu specialmenu_;
+       Menu specialmenu_;
 };
 
 ///