]> 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 dce206d67a62b5ee5603ecaa31309a34c8730a4a..ee57daf7dee37b79b75cbd3ac792976ba35a39db 100644 (file)
 
 #include "support/docstring.h"
 
-#include <Qmenu>
+#include <QMenu>
 
 #include <vector>
 
 class QString;
+class QMenuBar;
 
 namespace lyx {
 
@@ -30,25 +31,50 @@ namespace frontend {
 
 class GuiView;
 
+class Menu : public QMenu
+{
+       Q_OBJECT
+public:
+       ///
+       Menu(GuiView * gv, QString const & name, bool top_level);
+
+       ///
+       ~Menu();
+       
+private Q_SLOTS:
+       ///
+       void updateView();
+
+private:
+       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;
+};
+
+
 class Menus
 {
 public:
        Menus();
+       ~Menus();
        
        ///
        bool searchMenu(FuncRequest const & func,
                std::vector<docstring> & names) const;
        ///
-       void fillMenuBar(GuiView * view);
+       void fillMenuBar(QMenuBar * qmb, GuiView * view, bool initial = false);
 
        /// \return a top-level submenu given its name.
-       QMenu * menu(QString const & name, GuiView & view);
+       Menu * menu(QString const & name, GuiView & view);
 
        ///
        void read(Lexer &);
 
        ///
-       void updateMenu(QString const & name);
+       void updateMenu(Menu * qmenu);
 
 private:
        /// Use the Pimpl idiom to hide the internals.
@@ -57,24 +83,6 @@ private:
        Impl * const d;
 };
 
-
-class GuiPopupMenuBase : public QMenu
-{
-       Q_OBJECT
-       
-public:
-       ///
-       GuiPopupMenuBase(QWidget * parent = 0)
-               : QMenu(parent)
-       {
-               connect(this, SIGNAL(aboutToShow()), this, SLOT(updateView()));
-       }
-       
-private Q_SLOTS:
-       ///
-       virtual void updateView() = 0;
-};
-
 } // namespace frontend
 } // namespace lyx