summaryrefslogtreecommitdiff
path: root/docs/Classes/SDLAlert.html
blob: eb679e26b6fb6f0e91dceb6b4273bf5734f8edf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
<h1>SDLAlert Class Reference</h1>

<h3>Section Contents</h3>

<ul>
  <li><a href="#section--init">-init</a></li>
  <li><a href="#section--initWithDictionary:">-initWithDictionary:</a></li>
  <li><a href="#section--initWithAlertText1:alertText2:duration:">-initWithAlertText1:alertText2:duration:</a></li>
  <li><a href="#section--initWithAlertText1:alertText2:alertText3:">-initWithAlertText1:alertText2:alertText3:</a></li>
  <li><a href="#section--initWithAlertText1:alertText2:alertText3:duration:">-initWithAlertText1:alertText2:alertText3:duration:</a></li>
  <li><a href="#section--initWithAlertText1:alertText2:alertText3:duration:softButtons:">-initWithAlertText1:alertText2:alertText3:duration:softButtons:</a></li>
  <li><a href="#section--initWithTTS:playTone:">-initWithTTS:playTone:</a></li>
  <li><a href="#section--initWithTTS:alertText1:alertText2:playTone:duration:">-initWithTTS:alertText1:alertText2:playTone:duration:</a></li>
  <li><a href="#section--initWithTTS:alertText1:alertText2:alertText3:playTone:duration:">-initWithTTS:alertText1:alertText2:alertText3:playTone:duration:</a></li>
  <li><a href="#section--initWithTTSChunks:playTone:">-initWithTTSChunks:playTone:</a></li>
  <li><a href="#section--initWithTTSChunks:alertText1:alertText2:alertText3:playTone:softButtons:">-initWithTTSChunks:alertText1:alertText2:alertText3:playTone:softButtons:</a></li>
  <li><a href="#section--initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons:">-initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons:</a></li>
  <li><a href="#section-alertText1">alertText1</a></li>
  <li><a href="#section-alertText2">alertText2</a></li>
  <li><a href="#section-alertText3">alertText3</a></li>
  <li><a href="#section-ttsChunks">ttsChunks</a></li>
  <li><a href="#section-duration">duration</a></li>
  <li><a href="#section-playTone">playTone</a></li>
  <li><a href="#section-progressIndicator">progressIndicator</a></li>
  <li><a href="#section-softButtons">softButtons</a></li>
</ul>

<h3>Overview</h3>

<p>Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided.</p>

<p><ul>
 <li>The displayed portion of the SDLAlert, if any, will persist until the
 specified timeout has elapsed, or the SDLAlert is preempted</li>
 <li>An SDLAlert will preempt (abort) any SmartDeviceLink Operation that is in-progress,
 except an already-in-progress SDLAlert</li>
 <li>An SDLAlert cannot be preempted by any SmartDeviceLink Operation</li>
 <li>An SDLAlert can be preempted by a user action (button push)</li>
 <li>An SDLAlert will fail if it is issued while another SDLAlert is in progress</li>
 <li>Although each Alert parameter is optional, in fact each SDLAlert request
 must supply at least one of the following parameters:<br/>
 <ul>
 <li>alertText1</li>
 <li>alertText2</li>
 <li>alertText3</li>
 <li>ttsChunks</li>
 </ul>
 </li>
 </ul>
 <br/>
 <b>HMILevel needs to be FULL or LIMITED.</b><br/>
 <b>If the app has been granted function group Notification the SDLHMILevel can
 also be BACKGROUND</b><br/></p>

<p>@since SDL 1.0</p>


<section class="section task-group-section">
  <h3 id="section--init">
      -init
  </h3>
  
  <p>Constructs a new SDLAlert object</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">-</span> <span class="p">(</span><span class="n">instancetype</span><span class="p">)</span><span class="n">init</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="nf">init</span><span class="o">!</span><span class="p">()</span></code></pre>

  
  
  
  <h3 id="section--initWithDictionary:">
      -initWithDictionary:
  </h3>
  
  <p>Constructs a new SDLAlert object indicated by the dictionary parameter</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">-</span> <span class="p">(</span><span class="n">instancetype</span><span class="p">)</span><span class="nf">initWithDictionary</span><span class="p">:(</span><span class="n">NSMutableDictionary</span> <span class="o">*</span><span class="p">)</span><span class="nv">dict</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="nf">init</span><span class="o">!</span><span class="p">(</span><span class="n">dictionary</span> <span class="nv">dict</span><span class="p">:</span> <span class="kt">NSMutableDictionary</span><span class="o">!</span><span class="p">)</span></code></pre>

  
  
  <h4>Parameters</h4>
  <dl>
      <dt>dict</dt>
      <dd><p>The dictionary to use</p>
</dd>
  </dl>
  
  <h3 id="section--initWithAlertText1:alertText2:duration:">
      -initWithAlertText1:alertText2:duration:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithAlertText1:alertText2:alertText3:">
      -initWithAlertText1:alertText2:alertText3:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithAlertText1:alertText2:alertText3:duration:">
      -initWithAlertText1:alertText2:alertText3:duration:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithAlertText1:alertText2:alertText3:duration:softButtons:">
      -initWithAlertText1:alertText2:alertText3:duration:softButtons:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithTTS:playTone:">
      -initWithTTS:playTone:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithTTS:alertText1:alertText2:playTone:duration:">
      -initWithTTS:alertText1:alertText2:playTone:duration:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithTTS:alertText1:alertText2:alertText3:playTone:duration:">
      -initWithTTS:alertText1:alertText2:alertText3:playTone:duration:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithTTSChunks:playTone:">
      -initWithTTSChunks:playTone:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithTTSChunks:alertText1:alertText2:alertText3:playTone:softButtons:">
      -initWithTTSChunks:alertText1:alertText2:alertText3:playTone:softButtons:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section--initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons:">
      -initWithTTSChunks:alertText1:alertText2:alertText3:playTone:duration:softButtons:
  </h3>
  
  <p>Undocumented</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@interface</span> <span class="nc">SDLAlert</span> <span class="p">:</span> <span class="nc">SDLRPCRequest</span></code></pre>

  
  
  
  
  <h3 id="section-alertText1">
      alertText1
  </h3>
  
  <p>@abstract The String to be displayed in the first field of the display during the Alert</p>

<p>@discussion Length is limited to what is indicated in <em>SDLRegisterAppInterface</em> response</p>

<p>If omitted, top display line will be cleared</p>

<p>Text is always centered</p>

<p>Optional, Max length 500 chars</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">alertText1</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">alertText1</span><span class="p">:</span> <span class="kt">String</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-alertText2">
      alertText2
  </h3>
  
  <p>@abstract The String to be displayed in the second field of the display during the Alert</p>

<p>@discussion Only permitted if HMI supports a second display line</p>

<p>Length is limited to what is indicated in <em>SDLRegisterAppInterface</em> response</p>

<p>If omitted, second display line will be cleared</p>

<p>Text is always centered</p>

<p>Optional, Max length 500 chars</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">alertText2</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">alertText2</span><span class="p">:</span> <span class="kt">String</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-alertText3">
      alertText3
  </h3>
  
  <p>@abstract the String to be displayed in the third field of the display during the Alert
 @discussion Only permitted if HMI supports a third display line</p>

<p>Length is limited to what is indicated in <em>SDLRegisterAppInterface</em> response</p>

<p>If omitted, third display line will be cleared</p>

<p>Text is always centered</p>

<p>Optional, Max length 500 chars</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSString</span> <span class="o">*</span><span class="n">alertText3</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">alertText3</span><span class="p">:</span> <span class="kt">String</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-ttsChunks">
      ttsChunks
  </h3>
  
  <p>@abstract An array which, taken together, specify what is to be spoken to the user</p>

<p>Optional, Array of SDLTTSChunk, Array length 1 - 100</p>

<div class="aside aside-see">
    <p class="aside-title">See</p>
    SDLTTSChunk

</div>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSMutableArray</span> <span class="o">*</span><span class="n">ttsChunks</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">ttsChunks</span><span class="p">:</span> <span class="kt">NSMutableArray</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-duration">
      duration
  </h3>
  
  <p>@abstract The duration of the displayed portion of the alert, in milliseconds.</p>

<p>@discussion After this amount of time has passed, the display fields alertText1 and alertText2 will revert to what was displayed in those fields before the alert began.</p>

<p>Typical timeouts are 3 - 5 seconds</p>

<p>If omitted, the timeout is set to 5 seconds</p>

<p>Optional, Integer, 3000 - 10000</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSNumber</span> <span class="o">*</span><span class="n">duration</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">duration</span><span class="p">:</span> <span class="kt">NSNumber</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-playTone">
      playTone
  </h3>
  
  <p>@abstract Whether the alert tone should be played before the TTS (if any) is spoken.</p>

<p>@discussion If ommitted, no tone is played</p>

<p>Optional, Boolean</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSNumber</span> <span class="o">*</span><span class="n">playTone</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">playTone</span><span class="p">:</span> <span class="kt">NSNumber</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-progressIndicator">
      progressIndicator
  </h3>
  
  <p>@abstract If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing.  e.g. a spinning wheel or hourglass, etc.</p>

<p>Optional, Boolean</p>

<p>@since SmartDeviceLink 2.0</p>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSNumber</span> <span class="o">*</span><span class="n">progressIndicator</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">progressIndicator</span><span class="p">:</span> <span class="kt">NSNumber</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
  <h3 id="section-softButtons">
      softButtons
  </h3>
  
  <p>@abstract App defined SoftButtons.</p>

<p>@discussion If omitted on supported displays, the displayed alert shall not have any SoftButtons</p>

<p>Optional, Array of SDLSoftButton, Array size 0 - 4</p>

<div class="aside aside-see">
    <p class="aside-title">See</p>
    SDLSoftButton

</div>

  
  
  <h4>Objective-C</h4>
  <pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readwrite</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">atomic</span><span class="p">)</span> <span class="n">NSMutableArray</span> <span class="o">*</span><span class="n">softButtons</span><span class="p">;</span></code></pre>

  
  <h4>Swift</h4>
  <pre class="highlight"><code><span class="k">var</span> <span class="nv">softButtons</span><span class="p">:</span> <span class="kt">NSMutableArray</span><span class="o">!</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

  
  
  
</section>