1 // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Winch Gate Property Limited
6 // Copyright (C) 2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef MENU_MANAGER_H
22 #define MENU_MANAGER_H
25 #include "core_global.h"
28 #include <QtCore/QHash>
29 #include <QtCore/QObject>
30 #include <QtCore/QList>
31 #include <QtGui/QMenu>
32 #include <QtGui/QAction>
33 #include <QtGui/QMenuBar>
37 struct MenuManagerPrivate
;
40 @interface MenuManager
41 @brief The MenuManager provide the interface for registration of menus and menu item.
42 @details The MenuManager provides centralized access to menus and menu items.
43 All menus and menu items should be registered in the MenuManager.
45 class CORE_EXPORT MenuManager
: public QObject
50 MenuManager(QMenuBar
*menuBar
, QObject
*parent
= 0);
51 virtual ~MenuManager();
53 void registerMenu(QMenu
*menu
, const QString
&id
);
54 void registerAction(QAction
*action
, const QString
&id
);
56 QMenu
*menu(const QString
&id
) const;
57 QAction
*action(const QString
&id
) const;
59 void unregisterMenu(const QString
&id
);
60 void unregisterAction(const QString
&id
);
62 QMenuBar
*menuBar() const;
65 MenuManagerPrivate
*d
;
70 #endif // MENU_MANAGER_H