Clean and order documentation in source files. Source ready to beta 2 release
[mdictionary] / src / mdictionary / gui / MenuWidget.h
1 /*******************************************************************************
2
3     This file is part of mDictionary.
4
5     mDictionary is free software: you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation, either version 3 of the License, or
8     (at your option) any later version.
9
10     mDictionary is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with mDictionary.  If not, see <http://www.gnu.org/licenses/>.
17
18     Copyright 2010 Comarch S.A.
19
20 *******************************************************************************/
21 /*! \file MenuWidget.h
22     \brief Displays custom menu with tab widget containing all submenus.
23
24     \author Mateusz Półrola <mateusz.polrola@comarch.pl>
25 */
26
27 #ifndef MENUWIDGET_H
28 #define MENUWIDGET_H
29
30 #include <QWidgetAction>
31 #include "MenuTabWidget.h"
32
33 /*! Displays custom menu with tab widget containing all submenus.
34   Each submenu is simply QWidget.
35 */
36 class MenuWidget : public QWidgetAction {
37     Q_OBJECT
38 public:
39     explicit MenuWidget(QWidget *parent = 0);
40     virtual ~MenuWidget();
41
42     /*!
43         Adds new submenu to menu. It is possible to have many submenus with the
44         same title.
45         \param title Name of new submenu which will be displayed in submenu tab.
46         \param widget Widget of the submenu.
47      */
48     void addSubMenu(QString title, QWidget* widget);
49
50     /*!
51         Removes submenu from menu. It will remove first menu with passed title.
52         /param title Name of submenu which will be removed.
53     */
54     void removeSubMenu(QString title);
55
56 Q_SIGNALS:
57     void setApplicationMenu(QWidget*);
58
59 public Q_SLOTS:
60     /*!
61       Hides menu
62       */
63     void hideMenu();
64
65     void showMenu();
66
67 protected:
68     QWidget* createWidget(QWidget *parent);
69
70 private:
71     MenuTabWidget* tabWidget;
72     QWidget* applicationMenu;
73 };
74
75 #endif // MENUWIDGET_H