]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Menus.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / Menus.h
index 633cd721511a2df9576aea62c466e23c66e7ee40..ee57daf7dee37b79b75cbd3ac792976ba35a39db 100644 (file)
 #ifndef MENUS_H
 #define MENUS_H
 
-#include "MenuBackend.h"
+#include "support/docstring.h"
 
-#include <QObject>
-#include <QHash>
+#include <QMenu>
+
+#include <vector>
+
+class QString;
+class QMenuBar;
 
 namespace lyx {
+
+class Lexer;
+class FuncRequest;
+
 namespace frontend {
 
-class GuiView;
-class GuiPopupMenu;
 class GuiView;
 
-class Menus : public QObject, public MenuBackend
+class Menu : public QMenu
 {
        Q_OBJECT
 public:
-       Menus() {}
-
        ///
-       void fillMenuBar(GuiView * view);
+       Menu(GuiView * gv, QString const & name, bool top_level);
 
-       /// opens a top-level submenu given its name
-       void openByName(QString const & name);
-
-       /// update the state of the menuitems - not needed
+       ///
+       ~Menu();
+       
+private Q_SLOTS:
+       ///
        void updateView();
 
 private:
-       /// Initialize specific MACOS X menubar
-       void macxMenuBarInit(GuiView * view);
+       friend class Menus;
+
+       /// Use the Pimpl idiom to hide the internals.
+       struct Impl;
+       /// The pointer never changes although *d's contents may.
+       Impl * const d;
+};
 
-       typedef QHash<QString, GuiPopupMenu *> NameMap;
 
-       /// name to menu for openByName
-       NameMap name_map_;
+class Menus
+{
+public:
+       Menus();
+       ~Menus();
+       
+       ///
+       bool searchMenu(FuncRequest const & func,
+               std::vector<docstring> & names) const;
+       ///
+       void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
+
+       /// \return a top-level submenu given its name.
+       Menu * menu(QString const & name, GuiView & view);
+
+       ///
+       void read(Lexer &);
+
+       ///
+       void updateMenu(Menu * qmenu);
+
+private:
+       /// Use the Pimpl idiom to hide the internals.
+       struct Impl;
+       /// The pointer never changes although *d's contents may.
+       Impl * const d;
 };
 
 } // namespace frontend