]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Menus.h
Revert "Mark some intentional fall-throughs (in a way understandable to gcc)"
[lyx.git] / src / frontends / qt4 / Menus.h
index f0b0789e20264666fdca6c377c29408523ddbf85..9bc78e348073cbf067b6f05e8641e2996be62c8c 100644 (file)
@@ -4,7 +4,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author John Levon
  *
  * Full author contact details are available in file CREDITS.
 #ifndef MENUS_H
 #define MENUS_H
 
-#include "support/docstring.h"
-
 #include <QMenu>
 
-#include <vector>
-
 class QString;
 class QMenuBar;
 
 namespace lyx {
 
+class docstring_list;
 class Lexer;
 class FuncRequest;
 
@@ -36,11 +33,15 @@ class Menu : public QMenu
        Q_OBJECT
 public:
        ///
-       Menu(GuiView * gv, QString const & name, bool top_level);
+       Menu(GuiView * gv, QString const & name, bool top_level,
+               bool keyboard = false);
 
        ///
        ~Menu();
-       
+
+       /// QMenu::clear() reimplementation to handle the deletion of submenus.
+       void clear();
+
 private Q_SLOTS:
        ///
        void updateView();
@@ -57,17 +58,24 @@ private:
 
 class Menus
 {
+       /// noncopyable
+       Menus(Menus const &);
+       void operator=(Menus const &);
 public:
        Menus();
-       
+       ~Menus();
+
+       ///
+       void reset();
+
        ///
        bool searchMenu(FuncRequest const & func,
-               std::vector<docstring> & names) const;
+               docstring_list & 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);
+       Menu * menu(QString const & name, GuiView & view, bool keyboard = false);
 
        ///
        void read(Lexer &);
@@ -78,8 +86,8 @@ public:
 private:
        /// Use the Pimpl idiom to hide the internals.
        struct Impl;
-       /// The pointer never changes although *d's contents may.
-       Impl * const d;
+       ///
+       Impl * d;
 };
 
 } // namespace frontend