|
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 public: |
|
33 |
|
34 enum DefaultTimeout |
|
35 { |
|
36 NoTimeout, |
|
37 ConfirmationNoteTimeout, |
|
38 StandardTimeout, |
|
39 ContextMenuTimeout, |
|
40 }; |
|
41 |
|
42 enum DismissPolicy |
|
43 { |
|
44 NoDismiss = 0, |
|
45 TapInside = 1, |
|
46 TapOutside = 2, |
|
47 TapAnywhere = TapInside | TapOutside |
|
48 }; |
|
49 |
|
50 /** |
|
51 * contructor |
|
52 */ |
|
53 HbDialog(QGraphicsItem *parent=0); |
|
54 |
|
55 /** |
|
56 * destructor |
|
57 */ |
|
58 ~HbDialog(); |
|
59 |
|
60 /** |
|
61 * sets mDismissPolicy |
|
62 */ |
|
63 void setDismissPolicy(HbDialog::DismissPolicy dismissPolicy); |
|
64 |
|
65 /** |
|
66 * sets mTimeout |
|
67 */ |
|
68 void setTimeout(HbDialog::DefaultTimeout timeout); |
|
69 |
|
70 /** |
|
71 * sets mHeadingWidget; |
|
72 */ |
|
73 void setHeadingWidget(QGraphicsWidget *headingWidget); |
|
74 |
|
75 /** |
|
76 * sets mContentWidget |
|
77 */ |
|
78 void setContentWidget(QGraphicsWidget *contentWidget); |
|
79 |
|
80 /** |
|
81 * sets mPrimaryAction |
|
82 */ |
|
83 void setPrimaryAction(HbAction *action); |
|
84 |
|
85 /** |
|
86 * add action into actions -list |
|
87 */ |
|
88 void addAction(HbAction *action); |
|
89 |
|
90 /** |
|
91 * gets mPrimaryAction; |
|
92 */ |
|
93 HbAction* primaryAction(); |
|
94 |
|
95 /** |
|
96 * sets mSecondaryAction |
|
97 */ |
|
98 void setSecondaryAction(HbAction *action); |
|
99 |
|
100 /** |
|
101 * gets mSecondaryAction; |
|
102 */ |
|
103 HbAction* secondaryAction(); |
|
104 |
|
105 /** |
|
106 * sets mMinSize |
|
107 */ |
|
108 void setMinimumSize(QSize size); |
|
109 |
|
110 /** |
|
111 * sets mMaxSize |
|
112 */ |
|
113 void setMaximumSize(QSize size); |
|
114 |
|
115 /** |
|
116 * returns mPrimaryAction if execReturnPrimary is true. |
|
117 */ |
|
118 HbAction* exec(); |
|
119 |
|
120 /** |
|
121 * stubbed member |
|
122 */ |
|
123 QGraphicsWidget *mHeadingWidget; |
|
124 |
|
125 /** |
|
126 * stubbed member |
|
127 */ |
|
128 QGraphicsWidget *mContentWidget; |
|
129 |
|
130 /** |
|
131 * stubbed member |
|
132 */ |
|
133 HbAction *mPrimaryAction; |
|
134 |
|
135 /** |
|
136 * stubbed member |
|
137 */ |
|
138 HbAction *mSecondaryAction; |
|
139 |
|
140 /** |
|
141 * stubbed member |
|
142 */ |
|
143 QSize mMinSize; |
|
144 |
|
145 /** |
|
146 * stubbed member |
|
147 */ |
|
148 QSize mMaxSize; |
|
149 |
|
150 /** |
|
151 * stubbed member |
|
152 */ |
|
153 HbDialog::DefaultTimeout mTimeout; |
|
154 |
|
155 /** |
|
156 * stubbed member |
|
157 */ |
|
158 HbDialog::DismissPolicy mDismissPolicy; |
|
159 |
|
160 /** |
|
161 * actions other tham primary or secondary |
|
162 */ |
|
163 QList<HbAction*> mActions; |
|
164 |
|
165 /** |
|
166 * address of current instance zeroed during destcructor |
|
167 * this is for making sure object is removed correctly |
|
168 */ |
|
169 static HbDialog *currentInstance; |
|
170 |
|
171 /** |
|
172 * if true, exec returns mPrimaryAction |
|
173 */ |
|
174 static bool execReturnPrimary; |
|
175 |
|
176 /** |
|
177 * if true, primaryAction() -method returns null |
|
178 */ |
|
179 static bool primaryReturnNull; |
|
180 |
|
181 /** |
|
182 * if true, secondaryAction() -method returns null |
|
183 */ |
|
184 static bool secondaryReturnNull; |
|
185 }; |
|
186 |
|
187 #endif |