2002-09-24 13:57:09 +00:00
|
|
|
// -*- C++ -*-
|
2002-08-25 18:26:45 +00:00
|
|
|
/**
|
|
|
|
* \file QLPopupMenu.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-08-25 18:26:45 +00:00
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-08-25 18:26:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QLPOPUPMENU_H
|
|
|
|
#define QLPOPUPMENU_H
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
|
|
|
2002-08-25 18:26:45 +00:00
|
|
|
#include "Menubar_pimpl.h"
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
|
|
#include <qpopupmenu.h>
|
2002-08-25 18:26:45 +00:00
|
|
|
|
|
|
|
#include "LString.h"
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-08-25 18:26:45 +00:00
|
|
|
class MenuBackend;
|
|
|
|
class MenuItem;
|
2002-09-10 19:23:38 +00:00
|
|
|
class Menu;
|
2002-08-25 18:26:45 +00:00
|
|
|
class QMenuData;
|
2002-09-10 19:23:38 +00:00
|
|
|
class QLPopupMenu;
|
2002-08-25 18:26:45 +00:00
|
|
|
|
|
|
|
/// create a sub-menu
|
2002-09-10 19:23:38 +00:00
|
|
|
std::pair<int, QLPopupMenu *>
|
2002-10-20 01:48:28 +00:00
|
|
|
createMenu(QMenuData * parent, MenuItem const * item,
|
|
|
|
Menubar::Pimpl * owner, bool is_toplevel = false);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-08-25 18:26:45 +00:00
|
|
|
/// a submenu
|
|
|
|
class QLPopupMenu : public QPopupMenu {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2002-10-20 01:48:28 +00:00
|
|
|
QLPopupMenu(Menubar::Pimpl * owner,
|
|
|
|
string const & name, bool toplevel);
|
2002-09-10 19:23:38 +00:00
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
/// populate the menu
|
2002-09-10 19:23:38 +00:00
|
|
|
void populate(Menu * menu);
|
2002-08-25 18:26:45 +00:00
|
|
|
public slots:
|
2002-09-10 19:23:38 +00:00
|
|
|
/// populate the toplevel menu and all children
|
2002-08-25 18:26:45 +00:00
|
|
|
void showing();
|
|
|
|
private:
|
|
|
|
/// our owning menubar
|
|
|
|
Menubar::Pimpl * owner_;
|
|
|
|
|
|
|
|
/// the name of this menu
|
|
|
|
string name_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QLPOPUPMENU_H
|