skin: find event of menu button from list of context menu
[sdk/emulator/qemu.git] / tizen / src / ui / menu / menuitem.h
1 /*
2  * Qt UI
3  *
4  * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  * GiWoong Kim <giwoong.kim@samsung.com>
8  * Sangho Park <sangho1206.park@samsung.com>
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23  * MA 02110-1301, USA.
24  *
25  * Contributors:
26  * - S-Core Co., Ltd
27  *
28  */
29
30 #ifndef MENUITEM_H
31 #define MENUITEM_H
32
33 #include <QString>
34 #include <QShortcut>
35 #include <QMap>
36
37 namespace MenuItemType
38 {
39     enum {
40         separator,
41         advancedItem,
42         infoItem,
43         onTopItem,
44         moveItem,
45         switchItem,
46         scaleItem,
47         controllerItem,
48         hostKeyboardItem,
49         shellItem,
50         controlPanelItem,
51         screenShotItem,
52         aboutItem,
53         systemResetItem,
54         forceCloseItem,
55         closeItem,
56     };
57 }
58
59 class MenuItem
60 {
61 public:
62     MenuItem(int type, const QString &name);
63     virtual ~MenuItem();
64
65     int getType();
66     QString getName();
67     QMap<QString, QKeySequence> &getShortcuts();
68     void setAction(QAction *action);
69     QAction *getAction();
70     const char *getSlot();
71     void setSlot(const char *slot);
72
73 private:
74     int type;
75     QString name;
76     QMap<QString, QKeySequence> shortcuts;
77     QAction *action;
78
79     const char *slot;
80 };
81
82 #endif // MENUITEM_H