Bug 847744: Part 3 - IPDL change. r=vicamo,jdm, a=leo+
authorVicamo Yang <vyang@mozilla.com>
Thu, 18 Apr 2013 09:09:51 +0800
changeset 119107 898d1ece6313bf26076a5bf8d7444bafffdb48e0
parent 119106 23fdaa699d6ce33c937e249d1e43805ced90ee2e
child 119108 d10ff6cda618be03a5e1522919d512f60cb16a17
push id680
push uservyang@mozilla.com
push dateThu, 18 Apr 2013 01:11:41 +0000
reviewersvicamo, jdm, leo
bugs847744
milestone18.0
Bug 847744: Part 3 - IPDL change. r=vicamo,jdm, a=leo+
dom/mobilemessage/src/ipc/PMobileMessageCursor.ipdl
dom/mobilemessage/src/ipc/PSms.ipdl
dom/mobilemessage/src/ipc/PSmsRequest.ipdl
dom/mobilemessage/src/ipc/SmsTypes.ipdlh
--- a/dom/mobilemessage/src/ipc/PMobileMessageCursor.ipdl
+++ b/dom/mobilemessage/src/ipc/PMobileMessageCursor.ipdl
@@ -2,16 +2,17 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include "mozilla/dom/mobilemessage/Types.h";
 
 include protocol PSms;
+include protocol PBlob;
 include SmsTypes;
 
 namespace mozilla {
 namespace dom {
 namespace mobilemessage {
 
 protocol PMobileMessageCursor
 {
--- a/dom/mobilemessage/src/ipc/PSms.ipdl
+++ b/dom/mobilemessage/src/ipc/PSms.ipdl
@@ -2,28 +2,43 @@
 /* vim: set sw=2 ts=8 et ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PContent;
 include protocol PSmsRequest;
 include protocol PMobileMessageCursor;
+include protocol PBlob;
 include SmsTypes;
 
 namespace mozilla {
 namespace dom {
 namespace mobilemessage {
 
-struct SendMessageRequest
+struct SendMmsMessageRequest
+{
+  nsString[] receivers;
+  nsString subject;
+  nsString smil;
+  MmsAttachmentData[] attachments;
+};
+
+struct SendSmsMessageRequest
 {
   nsString number;
   nsString message;
 };
 
+union SendMessageRequest
+{
+  SendMmsMessageRequest;
+  SendSmsMessageRequest;
+};
+
 struct GetMessageRequest
 {
   int32_t messageId;
 };
 
 struct DeleteMessageRequest
 {
   int32_t messageId;
@@ -60,27 +75,27 @@ union IPCMobileMessageCursor
 };
 
 sync protocol PSms {
     manager PContent;
     manages PSmsRequest;
     manages PMobileMessageCursor;
 
 child:
-  NotifyReceivedMessage(SmsMessageData aMessageData);
+  NotifyReceivedMessage(MobileMessageData aMessageData);
 
-  NotifySendingMessage(SmsMessageData aMessageData);
+  NotifySendingMessage(MobileMessageData aMessageData);
 
-  NotifySentMessage(SmsMessageData aMessageData);
+  NotifySentMessage(MobileMessageData aMessageData);
 
-  NotifyFailedMessage(SmsMessageData aMessageData);
+  NotifyFailedMessage(MobileMessageData aMessageData);
 
-  NotifyDeliverySuccessMessage(SmsMessageData aMessageData);
+  NotifyDeliverySuccessMessage(MobileMessageData aMessageData);
 
-  NotifyDeliveryErrorMessage(SmsMessageData aMessageData);
+  NotifyDeliveryErrorMessage(MobileMessageData aMessageData);
 
 parent:
   /**
    * Sent when the child no longer needs to use sms.
    */
   __delete__();
 
   /**
--- a/dom/mobilemessage/src/ipc/PSmsRequest.ipdl
+++ b/dom/mobilemessage/src/ipc/PSmsRequest.ipdl
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 include "mozilla/dom/mobilemessage/Types.h";
 
 include protocol PSms;
+include protocol PBlob;
 include SmsTypes;
 
 namespace mozilla {
 namespace dom {
 namespace mobilemessage {
 
 protocol PSmsRequest
 {
@@ -22,27 +23,27 @@ child:
   /**
    * Sent when the asynchronous request has completed.
    */
   __delete__(MessageReply response);
 };
 
 struct ReplyMessageSend
 {
-  SmsMessageData messageData;
+  MobileMessageData messageData;
 };
 
 struct ReplyMessageSendFail
 {
   int32_t error;
 };
 
 struct ReplyGetMessage
 {
-  SmsMessageData messageData;
+  MobileMessageData messageData;
 };
 
 struct ReplyGetMessageFail
 {
   int32_t error;
 };
 
 struct ReplyMessageDelete
--- a/dom/mobilemessage/src/ipc/SmsTypes.ipdlh
+++ b/dom/mobilemessage/src/ipc/SmsTypes.ipdlh
@@ -1,15 +1,16 @@
 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include "mozilla/dom/mobilemessage/Types.h";
+include protocol PBlob;
 
 using DeliveryState;
 using DeliveryStatus;
 using MessageClass;
 using ReadState;
 
 namespace mozilla {
 namespace dom {
@@ -31,18 +32,43 @@ struct SmsMessageData
   nsString       sender;
   nsString       receiver;
   nsString       body;
   MessageClass   messageClass;
   uint64_t       timestamp; // ms since epoch.
   bool           read;
 };
 
-struct SmsFilterData
+struct MmsAttachmentData
+{
+  nsString id;
+  nsString location;
+  PBlob content;
+};
+
+struct MmsMessageData
 {
+  int32_t             id;
+  DeliveryState       delivery;
+  DeliveryStatus[]    deliveryStatus;
+  nsString            sender;
+  nsString[]          receivers;
+  uint64_t            timestamp;
+  bool                read;
+  nsString            subject;
+  nsString            smil;
+  MmsAttachmentData[] attachments;
+};
+
+union MobileMessageData {
+  MmsMessageData;
+  SmsMessageData;
+};
+
+struct SmsFilterData {
   uint64_t      startDate;
   uint64_t      endDate;
   nsString[]    numbers;
   DeliveryState delivery;
   ReadState     read;
 };
 
 struct ThreadData
@@ -51,15 +77,16 @@ struct ThreadData
   nsString[] participants;
   uint64_t timestamp;
   nsString body;
   uint64_t unreadCount;
 };
 
 union MobileMessageCursorData
 {
+  MmsMessageData;
   SmsMessageData;
   ThreadData;
 };
 
 }
 }
 }