|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: HbMessageBox class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HBMENU_H |
|
20 #define HBMENU_H |
|
21 |
|
22 #include <hbwidget.h> |
|
23 |
|
24 class QGraphicsItem; |
|
25 class QPointF; |
|
26 class HbAction; |
|
27 |
|
28 class HbPopup |
|
29 { |
|
30 public: |
|
31 enum Placement |
|
32 { |
|
33 TopLeftCorner, |
|
34 TopRightCorner, |
|
35 BottomLeftCorner, |
|
36 BottomRightCorner, |
|
37 TopEdgeCenter, |
|
38 RightEdgeCenter, |
|
39 BottomEdgeCenter, |
|
40 LeftEdgeCenter, |
|
41 Center |
|
42 }; |
|
43 |
|
44 enum DismissPolicy |
|
45 { |
|
46 NoDismiss = 0, |
|
47 TapInside = 1, |
|
48 TapOutside = 2, |
|
49 TapAnywhere = TapInside | TapOutside |
|
50 }; |
|
51 }; |
|
52 |
|
53 class HbMenu: public HbWidget |
|
54 { |
|
55 Q_OBJECT |
|
56 |
|
57 public: |
|
58 HbMenu(QGraphicsItem *parent = 0); |
|
59 virtual ~HbMenu(); |
|
60 |
|
61 public: |
|
62 /** stubbed from HbMenu */ |
|
63 HbAction* exec(const QPointF &pos, HbAction *action = 0); |
|
64 |
|
65 /** stubbed from HbMenu */ |
|
66 HbAction* menuAction(); |
|
67 |
|
68 /** stubbed from HbMenu */ |
|
69 HbAction* activeAction(); |
|
70 |
|
71 /** stubbed from HbMenu */ |
|
72 void setActiveAction(HbAction *action); |
|
73 |
|
74 /** stubbed from HbMenu */ |
|
75 void setEnabled(bool value); |
|
76 |
|
77 /** stubbed from HbMenu */ |
|
78 HbAction* addAction(const QString &text, |
|
79 const QObject *receiver, |
|
80 const char *member); |
|
81 |
|
82 /** stubbed from HbMenu */ |
|
83 QList<HbAction*> actions(); |
|
84 |
|
85 /** stubbed from HbMenu */ |
|
86 void setPreferredPos(const QPointF& position, |
|
87 HbPopup::Placement placement = HbPopup::TopLeftCorner); |
|
88 |
|
89 /** stubbed from HbMenu */ |
|
90 void setDismissPolicy(HbPopup::DismissPolicy dismissPolicy); |
|
91 |
|
92 public: |
|
93 /** dummy actions */ |
|
94 QMap<QString, HbAction*> mActions; |
|
95 }; |
|
96 |
|
97 #endif // HBMENU_H |