2006-03-05 17:24:44 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2006-04-24 13:25:50 +00:00
|
|
|
|
* \file qt4/QLMenubar.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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef QLMENUBAR_H
|
|
|
|
|
#define QLMENUBAR_H
|
|
|
|
|
|
|
|
|
|
#include "frontends/Menubar.h"
|
|
|
|
|
|
|
|
|
|
#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>
|
|
|
|
|
|
|
|
|
|
#include "QLPopupMenu.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
class LyXView;
|
|
|
|
|
class MenuBackend;
|
|
|
|
|
class Menu;
|
|
|
|
|
class MenuItem;
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2006-06-20 09:33:01 +00:00
|
|
|
|
class GuiView;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
class QLMenubar : public QObject, public Menubar {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
QLMenubar(LyXView *, MenuBackend &);
|
|
|
|
|
|
|
|
|
|
/// opens a top-level submenu given its name
|
2006-09-09 22:27:22 +00:00
|
|
|
|
void openByName(lyx::docstring const &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// return the owning view
|
2006-06-20 09:33:01 +00:00
|
|
|
|
GuiView * view();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// return the menu controller
|
|
|
|
|
MenuBackend const & backend();
|
|
|
|
|
|
|
|
|
|
/// The QMenuBar used by LyX
|
|
|
|
|
QMenuBar * menuBar() const;
|
|
|
|
|
|
|
|
|
|
/// update the state of the menuitems - not needed
|
|
|
|
|
void update();
|
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
|
public Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
|
/// populate a toplevel menu and all its children on demand
|
|
|
|
|
// void updateMenu();
|
|
|
|
|
|
|
|
|
|
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
|
2006-06-20 09:33:01 +00:00
|
|
|
|
GuiView * owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// menu controller
|
|
|
|
|
MenuBackend & menubackend_;
|
|
|
|
|
|
2006-09-09 22:27:22 +00:00
|
|
|
|
typedef std::map<lyx::docstring, QLPopupMenu *> 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
|
|
|
|
|
|
|
|
|
|
#endif // QLMENUBAR_H
|