WebAPI/AppDefinedTeleophony: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 19: Line 19:


== Messaging API ==
== Messaging API ==
  interface SmsManager
  interface Messaging {
{
    readonly   attribute SmsManager sms;
   SmsRequest      send(DOMString number, DOMString message);
    readonly   attribute MmsManager mms;
   SmsRequest[]     send(DOMString[] number, DOMString message);
     MessagingRequest findMessages (MessagingFilter filter, FilterOptions options);
  unsigned short  getNumberOfMessagesForText(in DOMString text);
    MessagingRequest findConversations (DOMString groupBy, MessagingFilter filter, FilterOptions options);
  SMSRequest      delete(in long id);                       // request.result == boolean
    MessagingRequest getMessage (DOMString id);
  SMSRequest      delete(in SmsMessage message);           // request.result == boolean
    MessagingRequest deleteMessage (DOMString id);
  SMSRequest      getMessage(in long id);                   // request.result == SMSMessage
    MessagingRequest deleteConversation (DOMString id);
  SMSRequest      getMessages(in SMSFilter filter, bool reverse); // request.result == SMSIterator
    MessagingRequest markMessageRead (DOMString id, boolean value);
  SMSRequest      markMessageRead(long id, boolean aValue); // request.result == boolean
    MessagingRequest markConversationRead (DOMString id, boolean value);
  SmsRequest      addArrivedMessage(SmsMessage msg);        // IM or Telephony Apps can add a new message as a new arrival.
    MessagingRequest addArrivedMessage(SmsMessage msg);        // IM or Telephony Apps can add a new message as a new arrival.
  };
  };


  interface SmsMessage
  interface Message {
{
    readonly   attribute DOMString id;
   readonly attribute long      id;
    readonly   attribute DOMString handler;  // the application that can handle the message for replying or sending.
   readonly attribute DOMString handler;  // the application that can handle the message for replying or sending.
    readonly   attribute DOMString receiver; // the account receiving the message.
   readonly attribute DOMString delivery; // could be "sent" or "received"
    readonly   attribute DOMString sender;
   readonly attribute DOMString sender;
    readonly    attribute Date      timestamp;
  readonly attribute DOMString receiver;
    readonly   attribute boolean  read;
  readonly attribute DOMString body;
   readonly attribute Date      timestamp;
   readonly attribute boolean  read;
  };
  };


addArrivedMessage() is added to SmsManager to let communication Apps add a message for a new arriving message.  |handler| is added to SmsMessage to record the application can handle replying the message.  The message app is not supposed for responding for editing messages.  It should wake up the handler of the message for editing.
addArrivedMessage() is added to Messaging to let communication Apps add a message for a new arriving message.  |handler| is added to Message to record the application can handle replying the message.  |receiver| is the account receiving the message.  It is used by the handler to distinguish the user of the service. The message app is not supposed for responding for editing messages.  It should wake up the handler of the message for editing. |type| and |serviceID| can be removed and replaced by |handler| and |receiver| while |receiver| are used to distinguish different SIM.


Should we provide a way for synchronization between the database of Messaging API and App's local storage?
Should we provide a way for synchronization between the database of Messaging API and App's local storage?
Confirmed users
398

edits

Navigation menu