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
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* 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
|
|
|
|
|
|
|
|
|
|
|
#include <qpopupmenu.h>
|
2002-08-25 18:26:45 +00:00
|
|
|
|
2003-09-05 17:23:11 +00:00
|
|
|
#include "support/std_string.h"
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2003-09-08 16:23:31 +00:00
|
|
|
#include <utility>
|
2003-07-29 09:55:48 +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;
|
2003-07-25 21:34:45 +00:00
|
|
|
class QLMenubar;
|
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,
|
2003-07-25 21:34:45 +00:00
|
|
|
QLMenubar * 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:
|
2003-07-25 21:34:45 +00:00
|
|
|
QLPopupMenu(QLMenubar * owner,
|
2002-10-20 01:48:28 +00:00
|
|
|
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
|
2003-07-25 21:34:45 +00:00
|
|
|
QLMenubar * owner_;
|
2002-08-25 18:26:45 +00:00
|
|
|
|
|
|
|
/// the name of this menu
|
|
|
|
string name_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QLPOPUPMENU_H
|