|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (developer.feedback@nokia.com) |
|
6 ** |
|
7 ** This file is part of the HbCore module of the UI Extensions for Mobile. |
|
8 ** |
|
9 ** GNU Lesser General Public License Usage |
|
10 ** This file may be used under the terms of the GNU Lesser General Public |
|
11 ** License version 2.1 as published by the Free Software Foundation and |
|
12 ** appearing in the file LICENSE.LGPL included in the packaging of this file. |
|
13 ** Please review the following information to ensure the GNU Lesser General |
|
14 ** Public License version 2.1 requirements will be met: |
|
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
16 ** |
|
17 ** In addition, as a special exception, Nokia gives you certain additional |
|
18 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
20 ** |
|
21 ** If you have questions regarding the use of this file, please contact |
|
22 ** Nokia at developer.feedback@nokia.com. |
|
23 ** |
|
24 ****************************************************************************/ |
|
25 |
|
26 /*! |
|
27 \class HbDeviceDialogPlugin |
|
28 \brief HbDeviceDialogPlugin is an abstract base class for device dialog widget plugins. |
|
29 |
|
30 Device dialogs are widgets which are shown on top of all applications by a device dialog |
|
31 service. The service queues and displays device dialogs according to client requests and |
|
32 system state. The service displays widgets in it's window (HbApplication window). |
|
33 |
|
34 Device dialog widgets are created by plugins. The service loads a plugin to create and display |
|
35 a device dialog. A single plugin may implement several different dialogs or just one. |
|
36 Dialogs are identified by a string. By convention the string should follow |
|
37 inverted domain name format. For example com.nokia.hb.devicedialog.note/1.0. |
|
38 Function deviceDialogTypes() returns a list of dialog types the plugin implements. |
|
39 |
|
40 Appending version number into device dialog type string enables versioning of device dialogs. |
|
41 A plugin should handle versioning by returning device dialog type string for all versions it |
|
42 implements in deviceDialogTypes() and then in createDeviceDialog() create a device dialog |
|
43 instance compatible with the version requested. This could always be the latest version if it |
|
44 is backwards compatible with older versions. Device dialog framework is unaware of version |
|
45 numbers in type strings. It performs string comparison of the whole string when searching |
|
46 for a plugin. |
|
47 |
|
48 Device dialogs are divided into three groups: generic device dialog, device notification dialog |
|
49 and indicator groups. The group dictates how and when a dialog is shown. Each dialog |
|
50 indicates which group it belongs to. The group need not be fixed. It may change depending on |
|
51 create parameters. |
|
52 |
|
53 Device dialog groups may prioritize (queueing) device dialogs in respect to other groups. |
|
54 In addition each device dialog has an individual queueing priority that may affect how it is |
|
55 shown inside a group. Currently there is no queueing implemented for device dialogs. All |
|
56 dialogs are displayed in order requests are received. Z-order of dialogs on display is |
|
57 determined by popup framework. Last dialog created is on top. Z-order may be changed by |
|
58 dialog widget changing it's popup priority. |
|
59 |
|
60 Device dialog widgets have to be derived from HbPopup either directly or by ancestry. |
|
61 |
|
62 <div style="color:gray"> |
|
63 <b>For future needs. Not implemented.</b> |
|
64 Device dialog may be shared by several device dialog clients. Each client can update the |
|
65 device dialog and receive signals from it equally. Clients attach to a shared device dialog |
|
66 instance by agreeing on an unique tag. The tag is appended into device dialog type with a % |
|
67 separator. For example here the tag "#1" is appended into device dialog type |
|
68 "hb.devicedialog.note/1.0%#1". If a device dialog instance exists, a client is attached into it |
|
69 instead of creating a new one. To allow sharing, plugin must set |
|
70 HbDeviceDialogPlugin::SharedDeviceDialog. |
|
71 </div> |
|
72 |
|
73 On S60, platform and third party plugins are run by separate servers with different |
|
74 platform security capabilities. The capabilities are following. |
|
75 - Platform plugins |
|
76 - ProtServ, SwEvent, TrustedUI |
|
77 - Third party plugins |
|
78 - ProtServ, TrustedUI |
|
79 |
|
80 Plugins are responsible for maintaining system security for their own part. If plugin |
|
81 performs operations that may compromise security or want's to limit access to specific |
|
82 clients, it should check client security credentials in accessAllowed() function. |
|
83 Device dialog framework calls this function before creating or attaching client to a |
|
84 plugin if HbDeviceDialogPlugin::SecurityCheck is set. Access is denied if the |
|
85 function returns false. In addition, HbDeviceDialogPlugin constructor has a check which |
|
86 allows only device dialog service to load plugins derived from it. |
|
87 |
|
88 Device dialog plugins can be installed into a device by users. Tbd. This needs to be clarified. |
|
89 |
|
90 Plugin location differs depending on platform. On Symbian, device dialog plugin stubs are |
|
91 located in /resource/plugins/devicedialogs directory and executables in /sys/bin directory. |
|
92 On Windows/Linux plugin executables are searched from application's current directory and |
|
93 HB_PLUGINS_DIR/devicedialogs directory. |
|
94 |
|
95 Creating a device dialog plugin and widget involves following steps. |
|
96 - Set in .pro file TEMPLATE = lib and CONFIG += hb plugin |
|
97 - Derive a class from HbPopup or derivatives and HbDeviceDialogInterface |
|
98 \code |
|
99 class HbSampleMessageBoxWidget : public HbMessageBox, public HbDeviceDialogInterface |
|
100 { |
|
101 Q_OBJECT |
|
102 \endcode |
|
103 - Implement device dialog widget and HbDeviceDialogInterface interface. Declare and emit |
|
104 deviceDialogClosed and optionally deviceDialogData signals. |
|
105 \code |
|
106 public: |
|
107 bool setDeviceDialogParameters(const QVariantMap ¶meters); |
|
108 int deviceDialogError() const; |
|
109 void closeDeviceDialog(bool byClient); |
|
110 HbPopup *deviceDialogWidget() const; |
|
111 signals: |
|
112 void deviceDialogClosed(); |
|
113 void deviceDialogData(QVariantMap data); |
|
114 \endcode |
|
115 - Wrap the widget into a plugin derived from HbDeviceDialogPlugin |
|
116 \code |
|
117 class HbSampleMessageBoxPlugin : public HbDeviceDialogPlugin |
|
118 { |
|
119 Q_OBJECT |
|
120 \endcode |
|
121 - Implement HbDeviceDialogPlugin pure virtual functions |
|
122 \code |
|
123 bool accessAllowed(const QString &deviceDialogType, |
|
124 const QVariantMap ¶meters, const QVariantMap &securityInfo) const; |
|
125 HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType, const QVariantMap ¶meters); |
|
126 bool deviceDialogInfo(const QString &deviceDialogType, |
|
127 const QVariantMap ¶meters, DeviceDialogInfo *info) const; |
|
128 QStringList deviceDialogTypes() const; |
|
129 PluginFlags pluginFlags() const; |
|
130 int error() const; |
|
131 \endcode |
|
132 |
|
133 <b> Class diagram of the sample plugin:</b> |
|
134 \dot |
|
135 digraph G { |
|
136 rankdir=LR; |
|
137 |
|
138 subgraph cluster_class_diagram { |
|
139 style=solid; |
|
140 |
|
141 node [shape = box, style=solid, fontsize = 10]; |
|
142 HbSampleMessageBoxPlugin [label = "HbSampleMessageBoxPlugin"]; |
|
143 QObject [label = "QObject"]; |
|
144 HbDeviceDialogPluginInterface [label = "HbDeviceDialogPluginInterface"]; |
|
145 HbDeviceDialogPlugin [label = "HbDeviceDialogPlugin"]; |
|
146 edge [fontsize = 10, style = filled]; |
|
147 QObject -> HbDeviceDialogPlugin [label = "is a"]; |
|
148 HbDeviceDialogPluginInterface -> HbDeviceDialogPlugin [label = "is a"]; |
|
149 HbDeviceDialogPlugin -> HbSampleMessageBoxPlugin [label = "is a"]; |
|
150 |
|
151 HbSampleMessageBoxWidget [label = "HbSampleMessageBoxWidget"]; |
|
152 HbMessageBox [label = "HbMessageBox"]; |
|
153 HbDeviceDialogInterface [label = "HbDeviceDialogInterface"]; |
|
154 HbMessageBox -> HbSampleMessageBoxWidget [label = "is a"]; |
|
155 HbDeviceDialogInterface -> HbSampleMessageBoxWidget [label = "is a"]; |
|
156 |
|
157 edge [fontsize = 10, style = dotted]; |
|
158 HbSampleMessageBoxPlugin -> HbSampleMessageBoxWidget [label = "creates"]; |
|
159 } |
|
160 |
|
161 subgraph cluster_key { |
|
162 label = "Key"; |
|
163 style=solid; |
|
164 node [shape = box, style=solid, fontsize = 10]; |
|
165 Class1 [label = "Class"]; |
|
166 Class2 [label = "Class"]; |
|
167 Class3 [label = "Class"]; |
|
168 |
|
169 edge [fontsize = 10, style = filled]; |
|
170 Class2 -> Class1 [label = "generalization"]; |
|
171 edge [fontsize = 10, style = dotted]; |
|
172 Class3 -> Class1 [label = "dependency"]; |
|
173 } |
|
174 } |
|
175 \enddot |
|
176 |
|
177 Sample plugin implementations can be found in src/hbplugins/devicedialogs directory. |
|
178 |
|
179 \sa HbDeviceDialogPluginInterface HbDeviceDialogInterface HbDeviceDialog HbPopup |
|
180 |
|
181 \alpha |
|
182 \hbcore |
|
183 */ |
|
184 |
|
185 /*! |
|
186 \enum HbDeviceDialogPlugin::PluginFlag |
|
187 Defines flags for the plugin. |
|
188 |
|
189 \sa pluginFlags |
|
190 */ |
|
191 /*! |
|
192 \var HbDeviceDialogPlugin::PluginFlag HbDeviceDialogPlugin::NoPluginFlags |
|
193 No flags specified. |
|
194 */ |
|
195 /*! |
|
196 \var HbDeviceDialogPlugin::PluginFlag HbDeviceDialogPlugin::PreloadPlugin |
|
197 Load plugin on startup. This also implies KeepPluginLoaded flag. |
|
198 */ |
|
199 /*! |
|
200 \var HbDeviceDialogPlugin::PluginFlag HbDeviceDialogPlugin::KeepPluginLoaded |
|
201 Keep the plugin loaded in memory. Flag is ignored for third party plugins. |
|
202 */ |
|
203 |
|
204 /*! |
|
205 \enum HbDeviceDialogPlugin::DeviceDialogGroup |
|
206 Defines device dialog groups. Each of these groups have different rules for showing |
|
207 device dialogs. |
|
208 |
|
209 \sa deviceDialogInfo DeviceDialogInfo |
|
210 */ |
|
211 /*! |
|
212 \var HbDeviceDialogPlugin::DeviceDialogGroup HbDeviceDialogPlugin::GenericDeviceDialogGroup |
|
213 Common device dialogs. |
|
214 */ |
|
215 /*! |
|
216 \var HbDeviceDialogPlugin::DeviceDialogGroup HbDeviceDialogPlugin::DeviceNotificationDialogGroup |
|
217 Device notification dialogs. |
|
218 */ |
|
219 /*! |
|
220 \var HbDeviceDialogPlugin::DeviceDialogGroup HbDeviceDialogPlugin::IndicatorGroup |
|
221 Indicators. Only platform device dialogs may belong to this group. |
|
222 */ |
|
223 /*! |
|
224 \var HbDeviceDialogPlugin::DeviceDialogGroup HbDeviceDialogPlugin::SecurityGroup |
|
225 Screen saver and alarm dialogs. Only platform device dialogs may belong to this group. |
|
226 */ |
|
227 /*! |
|
228 \var HbDeviceDialogPlugin::DeviceDialogGroup HbDeviceDialogPlugin::CriticalGroup |
|
229 High priority dialogs shown on top other dialogs. Only platform device dialogs may |
|
230 belong to this group. |
|
231 */ |
|
232 |
|
233 /*! |
|
234 \enum HbDeviceDialogPlugin::DeviceDialogFlag |
|
235 Defines flags for a device dialog created by the plugin. |
|
236 |
|
237 \sa deviceDialogInfo DeviceDialogInfo |
|
238 */ |
|
239 /*! |
|
240 \var HbDeviceDialogPlugin::DeviceDialogFlag HbDeviceDialogPlugin::NoDeviceDialogFlags |
|
241 No flags specified. |
|
242 */ |
|
243 /*! |
|
244 \var HbDeviceDialogPlugin::DeviceDialogFlag HbDeviceDialogPlugin::SharedDeviceDialog |
|
245 <em>For future needs. Not used.</em> |
|
246 The device dialog may be shared. Several clients may share the same device dialog instance. |
|
247 If the flag is not set, device dialog service doesn't allow sharing of the device dialog. |
|
248 |
|
249 */ |
|
250 /*! |
|
251 \var HbDeviceDialogPlugin::DeviceDialogFlag HbDeviceDialogPlugin::SecurityCheck |
|
252 If the flag is set, device dialog service calls accessAllowed() before creating or |
|
253 attaching to a device dialog widget. |
|
254 */ |
|
255 |
|
256 /*! |
|
257 \var HbDeviceDialogPlugin::DeviceDialogFlag HbDeviceDialogPlugin::NoLocalisableData |
|
258 If the flag is set, device dialog service does not try to find and localise strings |
|
259 from the property set. If not set localisable strings are localised by the device |
|
260 dialog service. |
|
261 |
|
262 \deprecated HbDeviceDialogPlugin::NoLocalisableData. Will be removed as localization |
|
263 is always done by application. |
|
264 */ |
|
265 |
|
266 /*! |
|
267 \var HbDeviceDialogPlugin::DefaultPriority |
|
268 Default priority value to return in DeviceDialogInfo. |
|
269 */ |
|
270 |
|
271 /*! |
|
272 \struct HbDeviceDialogPlugin::DeviceDialogInfo |
|
273 \brief Structure containing device dialog widget information. |
|
274 |
|
275 Passed as a parameter to HbDeviceDialogPlugin::deviceDialogInfo(). |
|
276 |
|
277 \sa HbDeviceDialogPlugin |
|
278 */ |
|
279 /*! |
|
280 \var HbDeviceDialogPlugin::DeviceDialogInfo::group |
|
281 Group the device dialog widget belongs to. HbDeviceDialogPlugin::DeviceDialogGroup. |
|
282 */ |
|
283 /*! |
|
284 \var HbDeviceDialogPlugin::DeviceDialogInfo::flags |
|
285 Device dialog flags. HbDeviceDialogPlugin::DeviceDialogFlag. |
|
286 */ |
|
287 /*! |
|
288 \var HbDeviceDialogPlugin::DeviceDialogInfo::priority |
|
289 <em>For future needs. Not used</em>. |
|
290 Device dialog display priority. Determines queuing order of dialogs. Fill with |
|
291 HbDeviceDialogPlugin::DefaultPriority. |
|
292 */ |
|
293 /*! |
|
294 \var HbDeviceDialogPlugin::DeviceDialogInfo::spare |
|
295 Spare space for future needs. |
|
296 */ |
|
297 |
|
298 /*! |
|
299 \fn virtual bool HbDeviceDialogPlugin::accessAllowed(const QString &deviceDialogType, |
|
300 const QVariantMap ¶meters, const QVariantMap &securityInfo) const = 0 |
|
301 |
|
302 Checks if client is allowed use the device dialog that the plugin creates. Device dialog service |
|
303 calls this function before creating a device dialog or attaching into an existing one if flag |
|
304 HbDeviceDialogPlugin::SecurityCheck is set. The implementation is operating system dependent. |
|
305 On Symbian this may involve checking client's platform security capabilities or secure ID for |
|
306 example. Returns true if client is allowed to use the device dialog. |
|
307 |
|
308 \param deviceDialogType Device dialog type. |
|
309 \param parameters Device dialog parameters. |
|
310 \param securityInfo Information for security check. Content is operating system dependent. |
|
311 The format is <key, value> pairs. |
|
312 Currently only Symbian is defined. |
|
313 <table> |
|
314 <caption> Symbian security information </caption> |
|
315 <tr> |
|
316 <th>Key</th> |
|
317 <th>Value type</th> |
|
318 <th>Description</th> |
|
319 </tr> |
|
320 <tr> |
|
321 <td>"sym-secureId"</td> |
|
322 <td>quint32</td> |
|
323 <td>Client's secure ID</td> |
|
324 </tr> |
|
325 <tr> |
|
326 <td>"sym-vendorId"</td> |
|
327 <td>quint32</td> |
|
328 <td>Client's vendor ID</td> |
|
329 </tr> |
|
330 <tr> |
|
331 <td>"sym-caps"</td> |
|
332 <td>quint32</td> |
|
333 <td>Client's capability set as a bitmap</td> |
|
334 </tr> |
|
335 </table> |
|
336 */ |
|
337 |
|
338 /*! |
|
339 \fn virtual bool HbDeviceDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, |
|
340 const QVariantMap ¶meters, DeviceDialogInfo *info) const = 0 |
|
341 |
|
342 Gets information of the device dialog created by the plugin. Device dialog manager calls this |
|
343 function before creating the device dialog widget to check |
|
344 HbDeviceDialogPlugin::DeviceDialogGroup, HbDeviceDialogPlugin::DeviceDialogFlag and priority. |
|
345 Returns true if device dialog information returned is valid. |
|
346 |
|
347 \param deviceDialogType Device dialog type. |
|
348 \param parameters Device dialog parameters. |
|
349 \param info Structure the plugin fills with an information of the device dialog it |
|
350 creates with the deviceDialogType and parameters. |
|
351 */ |
|
352 |
|
353 /*! |
|
354 \fn virtual QStringList HbDeviceDialogPlugin::deviceDialogTypes() const = 0 |
|
355 |
|
356 Returns a list of device dialog types the plugin implements. A plugin may implement several |
|
357 device dialog types. By convention device dialog type strings should follow inverted domain |
|
358 name format. For example com.nokia.hb.devicedialog.note/1.0 |
|
359 */ |
|
360 |
|
361 /*! |
|
362 \fn virtual HbDeviceDialogPlugin::Flags HbDeviceDialogPlugin::pluginFlags() const = 0 |
|
363 |
|
364 Returns plugin flags. |
|
365 */ |
|
366 |
|
367 /*! |
|
368 \fn virtual int HbDeviceDialogPlugin::error() const = 0 |
|
369 |
|
370 Returns an error last occurred. Error code ranges are defined in HbDeviceDialog. The code is |
|
371 passed to a client by device dialog framework. |
|
372 */ |
|
373 |
|
374 /*************************************************************************************************/ |
|
375 |
|
376 /*! |
|
377 \class HbDeviceDialogInterface |
|
378 \brief HbDeviceDialogInterface is an abstract interface class for a device dialog widget. |
|
379 |
|
380 Device dialogs are widgets which are shown on top of all applications by a device dialog service. |
|
381 Widgets are created by plugins. Device dialog service uses this interface to update widget |
|
382 parameters and close widget. |
|
383 |
|
384 The widget implementation must implement this interface. In addition it must provide a |
|
385 deviceDialogClosed() signal and optionally deviceDialogData() signal if data needs to be |
|
386 passed to a client. |
|
387 |
|
388 Device dialog widgets must be derived from HbPopup or derivatives as described in |
|
389 HbDeviceDialogPlugin. |
|
390 |
|
391 Following popup convention, the widget is not visible immediately after is created. |
|
392 Device dialog framework calls HbPopup::show() to display the widget. The service may change |
|
393 The service may change visibility of the widget by HbPopup::setVisible function. |
|
394 |
|
395 The widget should close itself by either a timeout or user interaction. It may also be closed |
|
396 gracefully either by system or the client by a closeDeviceDialog() function. It is assumed that |
|
397 the widget object can be ungracefully destroyed (delete) at any time. |
|
398 |
|
399 \b Signals: |
|
400 |
|
401 \b void \b deviceDialogClosed() |
|
402 |
|
403 Device dialog widget must implement this signal. The widget should emit this signal |
|
404 when it has disappeared from a display and can be deleted. It is important this signal is |
|
405 emitted as device dialog service relies on it to detect the widget closing. |
|
406 |
|
407 \b void \b deviceDialogData(QVariantMap data) |
|
408 |
|
409 This signal is emitted by a device dialog widget to send data to a client. The signal |
|
410 is optional. If the widget does not provide any data, the signal is not needed. \a data |
|
411 contains data from the widget. The data is passed unmodified to the client. The structure |
|
412 and meaning of the data is a contract between the widget and a client. |
|
413 \endcode |
|
414 |
|
415 \sa HbDeviceDialogPlugin HbDeviceDialog |
|
416 |
|
417 \alpha |
|
418 \hbcore |
|
419 */ |
|
420 |
|
421 /*! |
|
422 \fn virtual bool HbDeviceDialogInterface::setDeviceDialogParameters( |
|
423 const QVariantMap ¶meters) = 0 |
|
424 |
|
425 Set device dialog widget parameters. This function may be called after the widget is created |
|
426 to update widget parameters. \a parameters contains widget parameters. The structure and |
|
427 meaning of parameters is a contract between the plugin and a client. Returns true on success |
|
428 or false on failure. |
|
429 */ |
|
430 |
|
431 /*! |
|
432 \fn virtual int HbDeviceDialogInterface::deviceDialogError() const = 0 |
|
433 |
|
434 Returns an error last occurred. Error code ranges are defined in HbDeviceDialog. The code is |
|
435 passed to a client by device dialog framework. |
|
436 |
|
437 \sa HbDeviceDialog::DeviceDialogError |
|
438 */ |
|
439 |
|
440 /*! |
|
441 \fn virtual void HbDeviceDialogInterface::closeDeviceDialog(bool byClient) = 0 |
|
442 |
|
443 Closes a device dialog widget gracefully. This function may called due to device dialog |
|
444 client calling HbDeviceDialog::cancel() or by device dialog service if it decides |
|
445 that a dialog needs to be closed. Device dialog widget may also close itself without |
|
446 this function being called. \a byClient is true if client initiated the closing. |
|
447 Otherwise the closing was initiated by the device dialog framework. The widget may also be |
|
448 deleted at any time ungracefully without closeDeviceDialog() being called. |
|
449 |
|
450 \sa deviceDialogClosed() |
|
451 */ |
|
452 |
|
453 /*! |
|
454 \fn virtual HbPopup *HbDeviceDialogInterface::deviceDialogWidget() const = 0 |
|
455 |
|
456 Returns a pointer to a widget that implements the user interface of the device dialog. The |
|
457 widget must be derived from a HbPopup or it's derivatives. |
|
458 |
|
459 \sa HbDeviceDialogPlugin |
|
460 */ |
|
461 |
|
462 /*! |
|
463 \fn virtual QObject *HbDeviceDialogInterface::signalSender() const |
|
464 |
|
465 Returns a pointer to an object that is a sender of deviceDialogClosed() and deviceDialogData() |
|
466 signals. There is a default implementation which returns null. In this case it is assumed that |
|
467 the device dialog widget is the signal source. This function may be overriden for example in |
|
468 a case where the dialog widget is encapsulated by a container class which sends the required |
|
469 signals. Note that there has to be one to one relationship between the widget and the sender. |
|
470 I.e. there is a one sender object per widget. |
|
471 |
|
472 \sa deviceDialogWidget deviceDialogClosed() deviceDialogData() |
|
473 */ |
|
474 |
|
475 /*************************************************************************************************/ |
|
476 |
|
477 /*! |
|
478 \class HbDeviceDialogPluginInterface |
|
479 \brief HbDeviceDialogPluginInterface is an abstract interface that identifies a device dialog plugin. |
|
480 |
|
481 This class is not intended for direct derivation. Instead a device dialog plugin should be derived |
|
482 from HbDeviceDialogPlugin. This class declares createDeviceDialog() function which the plugin must |
|
483 implement. |
|
484 |
|
485 \alpha |
|
486 \hbcore |
|
487 */ |
|
488 |
|
489 /*! |
|
490 \fn virtual HbDeviceDialogPluginInterface *HbDeviceDialogPluginInterface::createDeviceDialog( |
|
491 const QString &deviceDialogType, const QVariantMap ¶meters) = 0 |
|
492 |
|
493 Creates a device dialog widget. The widget becomes visible immediately. Returns a pointer to |
|
494 the device dialog widget interface or null if widget cannot be created. |
|
495 |
|
496 \param deviceDialogType Device dialog type to create. |
|
497 \param parameters Device dialog parameters. The structure and meaning of parameters is a |
|
498 contract between the plugin and a client. |
|
499 |
|
500 \sa HbDeviceDialogPlugin |
|
501 */ |
|
502 |
|
503 /*************************************************************************************************/ |
|
504 |
|
505 #include <hbdevicedialogplugin.h> |
|
506 #include <hbdevicedialoginterface.h> |
|
507 #ifdef Q_OS_SYMBIAN |
|
508 #include <e32base.h> |
|
509 #endif // Q_OS_SYMBIAN |
|
510 |
|
511 // Constructor |
|
512 HbDeviceDialogPlugin::HbDeviceDialogPlugin() |
|
513 { |
|
514 #ifdef Q_OS_SYMBIAN |
|
515 // Check loading process secure ID. Panic if not device dialog server. |
|
516 const TUint32 sid = 0x20022FC5; |
|
517 RProcess process; |
|
518 if (process.SecureId().iId != sid) { |
|
519 _LIT(KCategory, "HbDeviceDialogPlugin"); |
|
520 User::Panic(KCategory, 1); |
|
521 } |
|
522 #endif // Q_OS_SYMBIAN |
|
523 } |
|
524 |
|
525 // Destructor |
|
526 HbDeviceDialogPlugin::~HbDeviceDialogPlugin() |
|
527 { |
|
528 } |
|
529 |
|
530 HbDeviceDialogInterface::~HbDeviceDialogInterface() |
|
531 { |
|
532 } |
|
533 |
|
534 QObject *HbDeviceDialogInterface::signalSender() const |
|
535 { |
|
536 return 0; |
|
537 } |