@@ -471,11 +471,11 @@ <h2><a>SmsManager</a> Interface</h2>
471
471
</ dl >
472
472
</ dd >
473
473
474
- < dt > MessagingRequest send ()</ dt >
474
+ < dt > Future send ()</ dt >
475
475
< dd > This method issues a request to the messaging system to send an SMS
476
476
message with the text of the < code > text</ code > parameter to the destination
477
477
number indicated in the < code > to</ code > parameter.
478
- A < code > MessagingRequest </ code > object will be returned in order to notify
478
+ A < code > Future </ code > object will be returned in order to notify
479
479
the result of the request.
480
480
< dl class ='parameters '>
481
481
< dt > DOMString to</ dt >
@@ -494,7 +494,7 @@ <h2><a>SmsManager</a> Interface</h2>
494
494
</ dl >
495
495
</ dd >
496
496
497
- < dt > MessagingRequest clear ()</ dt >
497
+ < dt > Future clear ()</ dt >
498
498
< dd > This method makes a request to delete all the messages associated to the
499
499
messaging service passed as parameter.
500
500
< dl class ='parameters '>
@@ -554,8 +554,7 @@ <h3>Steps</h3>
554
554
< p > The < dfn > < code > send</ code > </ dfn > method when invoked MUST run the
555
555
following steps:
556
556
< ol >
557
- < li > Create a new instance of < code > SmsMessage</ code > and a new instance of
558
- < code > MessagingRequest</ code > and:
557
+ < li > Create a new instance of < code > SmsMessage</ code > :
559
558
< ol >
560
559
< li > Generate a identifier for this message that is globally unique within
561
560
the implementation, i.e. there cannot be any other message with the same
@@ -586,40 +585,33 @@ <h3>Steps</h3>
586
585
in the < code > text</ code > parameter to the number of the recipient
587
586
indicated in the < code > to</ code > parameter, using the proper service as
588
587
described above.
589
- < li > Set < code > readyState</ code > of the < code > MessagingRequest</ code >
590
- object to 'processing'.
591
- < li > Return the < code > MessagingRequest</ code > to the caller and < a > queue a
592
- task</ a > to monitor SMS sending progress.
588
+ < li > < a > Queue a task</ a > to monitor SMS sending progress.
593
589
</ ol >
594
- < li > If there is an error
590
+ < li > Let < var > future</ var > be a new < code > Future</ code > object and
591
+ < var > resolver</ var > its associated < code > resolver</ code >
592
+ < li > Return < var > future</ var > to the caller.
593
+ < li > If an < var > error</ var > occurs run these substeps and terminate these
594
+ steps
595
595
< ol >
596
- < li > Set the < code > state</ code > of the < code > SmsMessage</ code > to
597
- 'error'.
598
596
< li > If a delivery report had been requested set the
599
597
< code > deliveryStatus</ code > of the < code > SmsMessage</ code > to 'error'.
600
- < li > Invoke the < code > onerror</ code > < a class ="internalDFN "
601
- href ="#dfn-eventhandler "> event handlers</ a > of the
602
- < code > MessagingRequest</ code > object.
598
+ < li > call < var > resolver</ var > 's < code > reject(value)</ code > method with
599
+ < var > error</ var > as < code > value</ code > argument.
603
600
</ ol >
604
- < li > When the requests has been completed:
601
+ < li > When the request has been successfully completed:
605
602
< ol >
606
603
< li > Set the < code > state</ code > of the < code > SmsMessage</ code > to 'sent'.
607
604
< li > Set the < code > timestamp</ code > of the < code > SmsMessage</ code > to the
608
605
timestamp when the SMS message reached the Short Message Center, i.e. the
609
606
value of the TP-Service-Centre-Time-Stamp (TP-SCTS) parameter returned in
610
607
the SMS-SUBMIT-REPORT Protocol Data Unit.
611
- < li > Set the < code > readyState</ code > of the < code > MessagingRequest</ code >
612
- object to 'done'.
613
- < li > Set the < code > result</ code > of the < code > MessagingRequest</ code >
614
- object to the < code > SmsMessage</ code > that has been sent.
615
- < li > Invoke the < code > onsuccess</ code > < a class ="internalDFN "
616
- href ="#dfn-eventhandler "> event handlers</ a > of the
617
- < code > MessagingRequest</ code > .
608
+ < li > Call < var > resolver</ var > 's < code > accept(value)</ code > method with
609
+ the sent < code > SmsMessage</ code > as < code > value</ code > argument.
618
610
< li > < a > Queue a task</ a > to < a > fire an event</ a > named < code > sent</ code >
619
611
with the < code > message</ code > attribute set to the sent
620
- < code > MmsMessage</ code > .
621
- </ ol >
612
+ < code > SmsMessage</ code > .
622
613
</ ol >
614
+ </ ol >
623
615
624
616
< p > The < dfn > < code > getSegmentInfoForText</ code > </ dfn > method when invoked MUST
625
617
return a < code > SmsSegmentInfo</ code > object that contains the following
@@ -710,20 +702,18 @@ <h3>Steps</h3>
710
702
< li > Make a request to the system to delete all the messages associated to
711
703
the messaging service with identifier equal to the < code > serviceID</ code >
712
704
parameter.
713
- < li > Create a new < code > MessagingRequest</ code > object and set
714
- < code > readyState</ code > of the < code > MessagingRequest</ code > object to
715
- 'processing' and return the < code > MessagingRequest</ code > to the caller.
716
- < li > If there is an error invoke the < code > onerror</ code > < a > event
717
- handler</ a > of the < code > MessagingRequest</ code > object.
718
- < li > When the request has been completed:
705
+ < li > Let < var > future</ var > be a new < code > Future</ code > object and
706
+ < var > resolver</ var > its associated < code > resolver</ code >
707
+ < li > Return < var > future</ var > to the caller.
708
+ < li > If an < var > error</ var > occurs call < var > resolver</ var > 's
709
+ < code > reject(value)</ code > method with < var > error</ var > as
710
+ < code > value</ code > argument.
711
+ < li > When the request has been successfully completed:
719
712
< ol >
720
- < li > Set the < code > readyState</ code > of the
721
- < code > MessagingRequest</ code > object to 'done'.
722
- < li > Set the < code > result</ code > of the < code > MessagingRequest</ code >
723
- object to 'true'.
724
- < li > Invoke the < code > onsuccess</ code > < a class ="internalDFN "
725
- href ="#dfn-eventhandler "> event handlers</ a > of the
726
- < code > MessagingRequest</ code > .
713
+ < li > Let < var > serviceID</ var > be the < code > serviceID</ code > parameter
714
+ passed in the request
715
+ < li > Call < var > resolver</ var > 's < code > accept(value)</ code > method with
716
+ < var > serviceID</ var > as < code > value</ code > argument.
727
717
</ ol >
728
718
</ ol >
729
719
</ section >
0 commit comments