X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FMenus.h;h=1ab407a5e100c077f7193f1c28b98f777cabc3bb;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=77da32d57f9a702f40ca99e9e9708e5b3867a9f0;hpb=780556c5d8e2b094805d6c6b01dd347e6b6d2fb6;p=lyx.git diff --git a/src/frontends/qt4/Menus.h b/src/frontends/qt4/Menus.h index 77da32d57f..1ab407a5e1 100644 --- a/src/frontends/qt4/Menus.h +++ b/src/frontends/qt4/Menus.h @@ -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. @@ -13,44 +13,76 @@ #ifndef MENUS_H #define MENUS_H -#include "MenuBackend.h" +#include -#include -#include - -class QMenu; +#include +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; +}; + + +class Menus +{ +public: + Menus(); + ~Menus(); - typedef QHash NameMap; + /// + void reset(); + + /// + 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); - /// name to menu for \c menu() method. - NameMap name_map_; + /// + void read(Lexer &); + + /// + void updateMenu(Menu * qmenu); + +private: + /// Use the Pimpl idiom to hide the internals. + struct Impl; + /// + Impl * d; }; } // namespace frontend