2002-06-19 05:20:29 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2003-07-25 21:34:45 +00:00
|
|
|
|
* \file qt2/QLMenubar.h
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-06-19 05:20:29 +00:00
|
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-19 05:20:29 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2003-07-25 21:34:45 +00:00
|
|
|
|
#ifndef QLMENUBAR_H
|
|
|
|
|
#define QLMENUBAR_H
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
|
|
|
|
#include "frontends/Menubar.h"
|
2003-10-06 15:43:21 +00:00
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
|
#include <map>
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
|
|
|
|
class LyXView;
|
|
|
|
|
class MenuBackend;
|
2004-06-09 14:10:27 +00:00
|
|
|
|
class QMenuBar;
|
2004-05-19 15:11:37 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2002-09-12 02:10:19 +00:00
|
|
|
|
class QLPopupMenu;
|
2004-05-19 15:11:37 +00:00
|
|
|
|
class QtView;
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
2003-07-25 21:34:45 +00:00
|
|
|
|
class QLMenubar : public Menubar {
|
2002-06-19 05:20:29 +00:00
|
|
|
|
public:
|
2004-08-14 18:06:10 +00:00
|
|
|
|
QLMenubar(LyXView *, MenuBackend &);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2002-07-22 01:53:26 +00:00
|
|
|
|
/// opens a top-level submenu given its name
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void openByName(std::string const &);
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
2002-08-25 18:26:45 +00:00
|
|
|
|
/// update the state of the menuitems - not needed
|
2003-05-14 09:17:22 +00:00
|
|
|
|
void update();
|
2002-06-19 05:20:29 +00:00
|
|
|
|
|
2002-08-25 18:26:45 +00:00
|
|
|
|
/// return the owning view
|
2003-05-14 09:17:22 +00:00
|
|
|
|
QtView * view();
|
2002-07-22 01:53:26 +00:00
|
|
|
|
|
2002-08-25 18:26:45 +00:00
|
|
|
|
/// return the menu controller
|
2003-05-14 09:17:22 +00:00
|
|
|
|
MenuBackend const & backend();
|
2002-08-25 18:26:45 +00:00
|
|
|
|
private:
|
2002-07-22 01:53:26 +00:00
|
|
|
|
/// owning view
|
2002-06-19 05:20:29 +00:00
|
|
|
|
QtView * owner_;
|
|
|
|
|
|
2002-07-22 01:53:26 +00:00
|
|
|
|
/// menu controller
|
2004-08-14 18:06:10 +00:00
|
|
|
|
MenuBackend & menubackend_;
|
2002-09-12 02:10:19 +00:00
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
typedef std::map<std::string, QLPopupMenu *> NameMap;
|
2002-09-12 02:10:19 +00:00
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
|
/// name to menu for openByName
|
2002-09-12 02:10:19 +00:00
|
|
|
|
NameMap name_map_;
|
2004-06-09 14:10:27 +00:00
|
|
|
|
|
|
|
|
|
/// The QMenuBar used by LyX
|
|
|
|
|
QMenuBar * menuBar() const;
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_MACX
|
|
|
|
|
boost::scoped_ptr<QMenuBar> menubar_;
|
|
|
|
|
#endif
|
2002-06-19 05:20:29 +00:00
|
|
|
|
};
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2003-07-25 21:34:45 +00:00
|
|
|
|
#endif // QLMENUBAR_H
|