|
1 /* |
|
2 * Copyright (c) 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: stub hbdialog |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HBDIALOG_H |
|
19 #define HBDIALOG_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <qsize.h> |
|
23 #include "hbwidget.h" |
|
24 class QGraphicsItem; |
|
25 class QGraphicsWidget; |
|
26 class HbAction; |
|
27 |
|
28 class HbDialog : public HbWidget |
|
29 { |
|
30 Q_OBJECT |
|
31 |
|
32 signals: |
|
33 |
|
34 /** |
|
35 * emitted from open -method |
|
36 */ |
|
37 void finished(HbAction*); |
|
38 |
|
39 public: |
|
40 |
|
41 enum DefaultTimeout |
|
42 { |
|
43 NoTimeout, |
|
44 ConfirmationNoteTimeout, |
|
45 StandardTimeout, |
|
46 ContextMenuTimeout, |
|
47 }; |
|
48 |
|
49 enum DismissPolicy |
|
50 { |
|
51 NoDismiss = 0, |
|
52 TapInside = 1, |
|
53 TapOutside = 2, |
|
54 TapAnywhere = TapInside | TapOutside |
|
55 }; |
|
56 |
|
57 /** |
|
58 * contructor |
|
59 */ |
|
60 HbDialog(QGraphicsItem *parent=0); |
|
61 |
|
62 /** |
|
63 * destructor |
|
64 */ |
|
65 ~HbDialog(); |
|
66 |
|
67 public slots: |
|
68 |
|
69 /** |
|
70 * emits finished -signal with first action in actions if execReturnPrimary is true, |
|
71 * else second action is returned. |
|
72 */ |
|
73 void open( QObject* receiver = 0, const char* member = 0 ); |
|
74 |
|
75 public: |
|
76 |
|
77 /** |
|
78 * sets mDismissPolicy |
|
79 */ |
|
80 void setDismissPolicy(HbDialog::DismissPolicy dismissPolicy); |
|
81 |
|
82 /** |
|
83 * sets mTimeout |
|
84 */ |
|
85 void setTimeout(HbDialog::DefaultTimeout timeout); |
|
86 |
|
87 /** |
|
88 * sets mHeadingWidget; |
|
89 */ |
|
90 void setHeadingWidget(QGraphicsWidget *headingWidget); |
|
91 |
|
92 /** |
|
93 * sets mContentWidget |
|
94 */ |
|
95 void setContentWidget(QGraphicsWidget *contentWidget); |
|
96 |
|
97 /** |
|
98 * add action into actions -list |
|
99 */ |
|
100 void addAction(HbAction *action); |
|
101 |
|
102 /** |
|
103 * sets mMinSize |
|
104 */ |
|
105 void setMinimumSize(QSize size); |
|
106 |
|
107 /** |
|
108 * sets mMaxSize |
|
109 */ |
|
110 void setMaximumSize(QSize size); |
|
111 |
|
112 /** |
|
113 * stubbed member |
|
114 */ |
|
115 QGraphicsWidget *mHeadingWidget; |
|
116 |
|
117 /** |
|
118 * stubbed member |
|
119 */ |
|
120 QGraphicsWidget *mContentWidget; |
|
121 |
|
122 /** |
|
123 * stubbed member |
|
124 */ |
|
125 HbAction *mPrimaryAction; |
|
126 |
|
127 /** |
|
128 * stubbed member |
|
129 */ |
|
130 HbAction *mSecondaryAction; |
|
131 |
|
132 /** |
|
133 * stubbed member |
|
134 */ |
|
135 QSize mMinSize; |
|
136 |
|
137 /** |
|
138 * stubbed member |
|
139 */ |
|
140 QSize mMaxSize; |
|
141 |
|
142 /** |
|
143 * stubbed member |
|
144 */ |
|
145 HbDialog::DefaultTimeout mTimeout; |
|
146 |
|
147 /** |
|
148 * stubbed member |
|
149 */ |
|
150 HbDialog::DismissPolicy mDismissPolicy; |
|
151 |
|
152 /** |
|
153 * actions other tham primary or secondary |
|
154 */ |
|
155 QList<HbAction*> mActions; |
|
156 |
|
157 /** |
|
158 * address of current instance zeroed during destcructor |
|
159 * this is for making sure object is removed correctly |
|
160 */ |
|
161 static HbDialog *currentInstance; |
|
162 |
|
163 /** |
|
164 * if true, exec returns mPrimaryAction |
|
165 */ |
|
166 static bool execReturnPrimary; |
|
167 |
|
168 /** |
|
169 * if true, primaryAction() -method returns null |
|
170 */ |
|
171 static bool primaryReturnNull; |
|
172 |
|
173 /** |
|
174 * if true, secondaryAction() -method returns null |
|
175 */ |
|
176 static bool secondaryReturnNull; |
|
177 |
|
178 /** |
|
179 * the amount how many times the open has been called. |
|
180 */ |
|
181 static int openAmount; |
|
182 |
|
183 }; |
|
184 |
|
185 #endif |