]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Menus.h
fix completion painting for RTL (inline completion and completion list)
[lyx.git] / src / frontends / qt4 / Menus.h
index 77da32d57f9a702f40ca99e9e9708e5b3867a9f0..5e438670fa5567d47c83bec84b537c367d43716b 100644 (file)
 #ifndef MENUS_H
 #define MENUS_H
 
-#include "MenuBackend.h"
+#include <QMenu>
 
-#include <QObject>
-#include <QHash>
-
-class QMenu;
+#include <vector>
 
+class QString;
+class QMenuBar;
 
 namespace lyx {
+
+class docstring_list;
+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);
-
-       /// \return a top-level submenu given its name.
-       QMenu * menu(QString const & name);
+       Menu(GuiView * gv, QString const & name, bool top_level);
 
-       /// 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 \c menu() method.
-       NameMap name_map_;
+class Menus
+{
+public:
+       Menus();
+       ~Menus();
+       
+       ///
+       bool searchMenu(FuncRequest const & func,
+               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);
+
+       ///
+       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