2006-03-05 17:24:44 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2007-08-31 22:16:11 +00:00
|
|
|
|
* \file GuiMenubar.h
|
2006-03-05 17:24:44 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#ifndef GUIMENUBAR_H
|
|
|
|
|
#define GUIMENUBAR_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiPopupMenu.h"
|
2007-08-14 09:54:59 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include <map>
|
2006-03-12 17:44:38 +00:00
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
#include <QObject>
|
2006-03-12 17:44:38 +00:00
|
|
|
|
#include <QMenuBar>
|
|
|
|
|
|
2007-08-14 09:54:59 +00:00
|
|
|
|
namespace lyx {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
class MenuBackend;
|
|
|
|
|
class Menu;
|
|
|
|
|
class MenuItem;
|
|
|
|
|
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
class GuiViewBase;
|
2007-08-14 09:54:59 +00:00
|
|
|
|
class LyXView;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
class GuiMenubar : public QObject
|
|
|
|
|
{
|
2006-03-05 17:24:44 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiMenubar(LyXView *, MenuBackend &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// opens a top-level submenu given its name
|
2007-04-25 16:39:21 +00:00
|
|
|
|
void openByName(docstring const &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// return the owning view
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiViewBase * view() { return owner_; }
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// return the menu controller
|
2007-08-31 05:53:55 +00:00
|
|
|
|
MenuBackend const & backend() { return menubackend_; }
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// The QMenuBar used by LyX
|
|
|
|
|
QMenuBar * menuBar() const;
|
|
|
|
|
|
|
|
|
|
/// update the state of the menuitems - not needed
|
2007-09-03 20:28:26 +00:00
|
|
|
|
void updateView();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/// Initialize specific MACOS X menubar
|
2006-03-12 17:29:34 +00:00
|
|
|
|
void macxMenuBarInit();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// owning view
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiViewBase * owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// menu controller
|
|
|
|
|
MenuBackend & menubackend_;
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
typedef std::map<docstring, GuiPopupMenu *> NameMap;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// name to menu for openByName
|
|
|
|
|
NameMap name_map_;
|
|
|
|
|
|
2006-03-12 17:44:38 +00:00
|
|
|
|
/// MACOS X special menubar.
|
|
|
|
|
boost::scoped_ptr<QMenuBar> mac_menubar_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#endif // GUIMENUBAR_H
|