123 deviceDialogManager -> deviceDialog1 [label = "data"]; |
123 deviceDialogManager -> deviceDialog1 [label = "data"]; |
124 deviceDialogManager -> deviceDialog2 [label = "data"]; |
124 deviceDialogManager -> deviceDialog2 [label = "data"]; |
125 } |
125 } |
126 \enddot |
126 \enddot |
127 |
127 |
128 <b>Platform dependent.</b> Currently server is implemented only for Symbian platform. On other platforms, |
128 HbDeviceDialog has no dependencies to other parts of the framework. Only to Qt. |
129 device dialog are displayed on client's mainwindow. |
129 Thus it can be used also from engine components that have no user interface. |
130 |
|
131 HbDeviceDialog has no dependencies to other parts of the framework. Only to Qt. Thus it can be used |
|
132 also from engine components that have no user interface. |
|
133 |
130 |
134 \section _types Types of device dialogs |
131 \section _types Types of device dialogs |
135 |
132 |
136 There are three classes of device dialogs: |
133 There are two classes of device dialogs intended for application use: |
137 -# Generic device dialogs are displayed on top |
134 -# Generic device dialogs are displayed on top |
138 of all applications, except in the case of an incoming call. Examples of these are a "Low memory" |
135 of all applications, except in the case of an incoming call. Examples of these are a "Low memory" |
139 message box and a "Receive message via bluetooth?" query. |
136 message box and a "Receive message via bluetooth?" query. |
140 -# Device notification dialogs are |
137 -# Device notification dialogs are |
141 notifications displayed in the top left corner of the display. Examples are "New message" and |
138 notifications displayed in the top left corner of the display. Examples are "New message" and |
142 "Low battery" notifications. |
139 "Low battery" notifications. |
143 -# The Universal indicator menu shows enhanced status indicator |
140 |
144 information. |
141 Generic device dialogs interrupt the current foreground application. |
145 |
|
146 Generic device dialogs and the indicator menu interrupt the current foreground application. |
|
147 The user cannot interact with the application with a touch or keyboard until the dialog |
142 The user cannot interact with the application with a touch or keyboard until the dialog |
148 is dismissed. Device notification dialogs behave differently allowing interaction with the |
143 is dismissed. Device notification dialogs behave differently allowing interaction with the |
149 current foreground application. |
144 current foreground application. Another difference is that notification dialogs are shown |
|
145 serially instead of on top of each other. |
|
146 |
|
147 In addition, there are two device dialogs classes intended for platform use: Indicator menu and security. |
|
148 |
|
149 \section _operation Operation of device dialogs |
|
150 |
|
151 \subsection _construction Construction and identification |
150 |
152 |
151 Device dialog widgets are constructed dynamically by the device dialog service. Construction |
153 Device dialog widgets are constructed dynamically by the device dialog service. Construction |
152 takes two parameters: a type and a set of parameters appropriate to the dialog type. |
154 takes two parameters: a type and a set of parameters appropriate to the dialog type. |
153 The device dialog type is a unique string identifying the |
155 The device dialog type is a unique string identifying the dialog. A search is made to find a |
154 dialog. A search is made to find a plugin that can instantiate the requested |
156 plugin that can instantiate the requested dialog. The service loads the plugin and creates an |
155 dialog. The service loads the plugin and creates an instance of the widget. |
157 instance of the widget. |
156 |
158 |
157 The parameter set is encapsulated in QMap<QString, QVariant>. Each device dialog implementation has |
159 The parameter set is encapsulated in QMap<QString, QVariant>. Each device dialog implementation |
158 a default value for all parameters. Only parameters that differ from the default need to be |
160 has a default value for all parameters. Only parameters that differ from the default need to be |
159 given. Parameters are <name, value> pairs. How the parameters are used depends on |
161 given. Parameters are <name, value> pairs. How the parameters are used depends on |
160 the plugin implementing the dialog. Suggested usage is <name, value> used as property |
162 the plugin implementing the dialog. Suggested usage is <name, value> used as property |
161 name and value pairs of the dialog implementation. This makes it easy to set properties using |
163 name and value pairs of the dialog implementation. This makes it easy to set properties using |
162 QObject::setProperty(const char*, const QVariant&). If data types supported by QVariant are |
164 QObject::setProperty(const char*, const QVariant&). If data types supported by QVariant are |
163 not suitable for a specific device dialog, Q_DECLARE_METATYPE can be used to add data types. |
165 not suitable for a specific device dialog, Q_DECLARE_METATYPE can be used to add data types. |
164 |
166 |
165 %Data can be sent to a device dialog after it has been launched using the update() function. %Data |
167 \subsection _updating Updating and receiving data |
166 sent by the dialog is received by the dataReceived signal. A copy of the last data received |
168 |
167 is held by the class and can be fetched by a call to the receivedData() function. This allows data to be received |
169 %Data can be sent to a device dialog after it has been launched using the update() function. |
168 without having to connect to a signal by waiting for a dialog to close and then |
170 %Data sent by the dialog is received by the dataReceived signal. A copy of the last data |
169 getting the received data. |
171 received is held by the class and can be fetched by a call to the receivedData() function. |
|
172 This allows data to be received without having to connect to a signal by waiting for a dialog |
|
173 to close and then getting the received data. |
|
174 |
|
175 \subsection _showing Showing device dialogs |
170 |
176 |
171 It is possible to launch multiple device dialogs from a single HbDeviceDialog object. |
177 It is possible to launch multiple device dialogs from a single HbDeviceDialog object. |
172 However if there is a need to update a dialog or receive data from it, only the last dialog |
178 However if there is a need to update a dialog or receive data from it, only the last dialog |
173 launched supports this. In this case instantiate the HbDeviceDialog class for each device dialog |
179 launched supports this. In this case instantiate the HbDeviceDialog class for each device |
174 that needs communication (update or data receive) after a launch. |
180 dialog that needs communication (update or data receive) after a launch. |
175 |
181 |
176 HbDeviceDialog::show() method returns after the device dialog service has accepted the dialog. |
182 HbDeviceDialog::show() method returns after the device dialog service has accepted the dialog. |
177 The service decides when the dialog is actually displayed. If there is no need to receive |
183 The service decides when the dialog is actually displayed. No assumption should be made |
178 data from the dialog widget, the HbDeviceDialog object can be destroyed after the show() method returns |
184 about the timing when the dialog will display. It may get delayed depending on system state. |
179 (can be allocated in a stack). A function is provided to wait for the device dialog to be dismissed, |
185 If there is no need to receive data from the dialog widget, the HbDeviceDialog object can be |
180 making the dialog display synchronous. |
186 destroyed after the show() method returns (can be allocated in a stack). In this case, |
|
187 it is assumed that the dialog widget closes itself by a timeout. System will close dialog |
|
188 widgets left running this way without a corresponding HbDialog instance, after 10 seconds. |
181 |
189 |
182 If any signals of HbDeviceDialog are connected, then the instance needs to exist until the |
190 If any signals of HbDeviceDialog are connected, then the instance needs to exist until the |
183 dialog is dismissed. In this case the device dialog service will close all dialogs |
191 dialog widget is dismissed. In this case the device dialog service will close all dialogs |
184 launched by the instance when it is deleted making it inappropriate to allocate HbDeviceDialog |
192 launched by the HbDeviceDialog instance when it is deleted making it inappropriate to allocate |
185 into a stack. |
193 it into a stack. |
186 |
194 |
187 Several clients can share the same device dialog widget by agreeing on an unique tag. See |
195 A function is provided to wait for the device dialog to be dismissed, making the dialog |
188 HbDeviceDialogWidgetPlugin for more information. |
196 display synchronous. |
|
197 |
|
198 \subsection _misc Miscellaneous notes |
189 |
199 |
190 When the HbDeviceDialog object is created, it can reserve a communication channel to the device dialog |
200 When the HbDeviceDialog object is created, it can reserve a communication channel to the device dialog |
191 service or the channel creation may be delayed until show(). This is controlled by a constructor |
201 service or the channel creation may be delayed until show(). This is controlled by a constructor |
192 flag. The default is the delayed resource reservation. |
202 flag. The default is the delayed resource reservation. |
193 |
203 |
194 The HbDeviceDialog class is not thread safe. If cancel() needs to called across threads, a queued |
204 The HbDeviceDialog class is not thread safe. If cancel() needs to called across threads, a queued |
195 signal slot connection can be used. |
205 signal slot connection can be used. |
196 |
206 |
|
207 \section _platform_hbdevicedialog Platform-specific implementation notes for HbDeviceDialog |
|
208 |
|
209 \subsection _nonsymbian_hbdevicedialog Non-Symbian |
|
210 The server is implemented only for the Symbian platform. On other platforms device dialogs are |
|
211 displayed on client's main window. |
|
212 |
197 \section _usecases Using the HbDeviceDialog class |
213 \section _usecases Using the HbDeviceDialog class |
198 |
214 |
199 The code below launches a device dialog and continues execution |
215 The code below launches a device dialog and continues execution |
200 \code |
216 \code |
201 // Launch a device dialog and continue execution. |
217 // Launch a device dialog and continue execution. Assumes that the dialog widget closes |
|
218 // itself by a timeout. |
202 |
219 |
203 HbDeviceDialog deviceDialog; |
220 HbDeviceDialog deviceDialog; |
204 QVariantMap parameters; |
221 QVariantMap parameters; |
205 parameters.insertMulti(QString("text"), QVariant(QString("Warning text"))); |
222 parameters.insertMulti(QString("text"), QVariant(QString("Warning text"))); |
206 const char *deviceDialogType = "hb.devdlg.examplemessagebox/1.0"; |
223 const char *deviceDialogType = "hb.devdlg.examplemessagebox/1.0"; |