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
|
|
|
|
|
|
|
|
|
#include <QObject>
|
2007-09-28 23:26:59 +00:00
|
|
|
|
#include <QHash>
|
|
|
|
|
|
|
|
|
|
class QMenuBar;
|
2006-03-12 17:44:38 +00:00
|
|
|
|
|
2007-08-14 09:54:59 +00:00
|
|
|
|
namespace lyx {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-11-05 13:52:37 +00:00
|
|
|
|
class GuiView;
|
2007-09-28 23:26:59 +00:00
|
|
|
|
class GuiPopupMenu;
|
2007-11-23 09:44:02 +00:00
|
|
|
|
class GuiView;
|
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-12-25 22:27:32 +00:00
|
|
|
|
GuiMenubar(GuiView *);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-10-02 07:51:25 +00:00
|
|
|
|
~GuiMenubar();
|
|
|
|
|
|
2007-11-21 21:14:34 +00:00
|
|
|
|
///
|
|
|
|
|
void init();
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
/// opens a top-level submenu given its name
|
2007-09-28 23:26:59 +00:00
|
|
|
|
void openByName(QString const & name);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// return the owning view
|
2007-11-05 13:52:37 +00:00
|
|
|
|
GuiView * view() { return owner_; }
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// 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-11-05 13:52:37 +00:00
|
|
|
|
GuiView * owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-28 23:26:59 +00:00
|
|
|
|
typedef QHash<QString, GuiPopupMenu *> NameMap;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// name to menu for openByName
|
|
|
|
|
NameMap name_map_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#endif // GUIMENUBAR_H
|