]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiMenubar.h
Introducing GuiMenubar::init() to avoid destructing the object in order to re-initial...
[lyx.git] / src / frontends / qt4 / GuiMenubar.h
index a28ada3d2e6056c7a4359e8cdf9fc4ee94956903..fd48ea3ccfad1d48b30d7fc49fd61bfcb28269f6 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 /**
- * \file qt4/GuiMenubar.h
+ * \file GuiMenubar.h
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef QLMENUBAR_H
-#define QLMENUBAR_H
-
-#include "GuiPopupMenu.h"
-
-#include <map>
-#include <boost/scoped_ptr.hpp>
+#ifndef GUIMENUBAR_H
+#define GUIMENUBAR_H
 
 #include <QObject>
-#include <QMenuBar>
+#include <QHash>
+
+class QMenuBar;
 
 namespace lyx {
 
 class MenuBackend;
-class Menu;
-class MenuItem;
 
 namespace frontend {
 
-class GuiViewBase;
+class GuiView;
+class GuiPopupMenu;
 class LyXView;
 
-class GuiMenubar : public QObject {
+class GuiMenubar : public QObject
+{
        Q_OBJECT
 public:
        GuiMenubar(LyXView *, MenuBackend &);
 
+       ~GuiMenubar();
+
+       ///
+       void init();
+
        /// opens a top-level submenu given its name
-       void openByName(docstring const &);
+       void openByName(QString const & name);
 
        /// return the owning view
-       GuiViewBase * view() { return owner_; }
+       GuiView * view() { return owner_; }
 
        /// return the menu controller
        MenuBackend const & backend() { return menubackend_; }
@@ -50,28 +52,28 @@ public:
        QMenuBar * menuBar() const;
 
        /// update the state of the menuitems - not needed
-       void update();
+       void updateView();
 
 private:
        /// Initialize specific MACOS X menubar
        void macxMenuBarInit();
 
        /// owning view
-       GuiViewBase * owner_;
+       GuiView * owner_;
 
        /// menu controller
        MenuBackend & menubackend_;
 
-       typedef std::map<docstring, GuiPopupMenu *> NameMap;
+       typedef QHash<QString, GuiPopupMenu *> NameMap;
 
        /// name to menu for openByName
        NameMap name_map_;
 
        /// MACOS X special menubar.
-       boost::scoped_ptr<QMenuBar> mac_menubar_;
+       QMenuBar * mac_menubar_;
 };
 
 } // namespace frontend
 } // namespace lyx
 
-#endif // QLMENUBAR_H
+#endif // GUIMENUBAR_H