1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/mobilemessage/interfaces/nsIRilMobileMessageDatabaseService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,146 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "domstubs.idl" 1.9 +#include "nsISupports.idl" 1.10 +#include "nsIMobileMessageDatabaseService.idl" 1.11 + 1.12 +[scriptable, function, uuid(92986322-8d56-11e2-8816-73a531c493c2)] 1.13 +interface nsIRilMobileMessageDatabaseCallback : nsISupports 1.14 +{ 1.15 + /** 1.16 + * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message 1.17 + */ 1.18 + void notify(in nsresult aRv, in nsISupports aDomMessage); 1.19 +}; 1.20 + 1.21 +[scriptable, function, uuid(32b02bbe-60a1-45e0-a748-ad40709b09dd)] 1.22 +interface nsIRilMobileMessageDatabaseRecordCallback : nsISupports 1.23 +{ 1.24 + /** 1.25 + * |aMessageRecord| Object: the mobile-message database record 1.26 + * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message. Noted, this value might be null. 1.27 + */ 1.28 + void notify(in nsresult aRv, in jsval aMessageRecord, in nsISupports aDomMessage); 1.29 +}; 1.30 + 1.31 +[scriptable, function, uuid(1b0ff03c-a2bc-11e3-a443-838d034c9805)] 1.32 +interface nsIRilMobileMessageDatabaseConcatenationCallback : nsISupports 1.33 +{ 1.34 + /** 1.35 + * |aCompleteMessage|: jsval: the completely concatenated message. Noted, this value might be null. 1.36 + */ 1.37 + void notify(in nsresult aRv, in jsval aCompleteMessage); 1.38 +}; 1.39 + 1.40 +[scriptable, uuid(0b437a5c-a2bc-11e3-bd1b-dbb173eb35f8)] 1.41 +interface nsIRilMobileMessageDatabaseService : nsIMobileMessageDatabaseService 1.42 +{ 1.43 + /** 1.44 + * |aMessage| Object: should contain the following properties for internal use: 1.45 + * - |type| DOMString: "sms" or "mms" 1.46 + * - |timestamp| Number: the timestamp of received message 1.47 + * - |iccId| DOMString: [optional] the ICC ID of the SIM for receiving 1.48 + * message if available. 1.49 + * 1.50 + * - If |type| == "sms", we also need: 1.51 + * - |messageClass| DOMString: the message class of received message 1.52 + * - |receiver| DOMString: the phone number of receiver 1.53 + * - |pid| Number: the TP-PID field of the SMS TPDU, default 0. 1.54 + * - |sender| DOMString: the phone number of sender 1.55 + * 1.56 + * - If |type| == "mms", we also need: 1.57 + * - |delivery| DOMString: the delivery state of received message 1.58 + * - |deliveryStatus| DOMString: the delivery status of received message 1.59 + * - |receivers| DOMString Array: the phone numbers of receivers 1.60 + * - |phoneNumber| DOMString: [optional] my own phone number. 1.61 + */ 1.62 + void saveReceivedMessage(in jsval aMessage, 1.63 + [optional] in nsIRilMobileMessageDatabaseCallback aCallback); 1.64 + 1.65 + /** 1.66 + * |aMessage| Object: should contain the following properties for internal use: 1.67 + * - |type| DOMString: "sms" or "mms" 1.68 + * - |sender| DOMString: the phone number of sender 1.69 + * - |timestamp| Number: the timestamp of sending message 1.70 + * - |deliveryStatusRequested| Bool: true when the delivery report is requested. 1.71 + * - |iccId| DOMString: the ICC ID of the SIM for sending message 1.72 + * 1.73 + * - If |type| == "sms", we also need: 1.74 + * - |receiver| DOMString: the phone number of receiver 1.75 + * 1.76 + * - If |type| == "mms", we also need: 1.77 + * - |receivers| DOMString Array: the phone numbers of receivers 1.78 + */ 1.79 + void saveSendingMessage(in jsval aMessage, 1.80 + [optional] in nsIRilMobileMessageDatabaseCallback aCallback); 1.81 + 1.82 + /** 1.83 + * |aMessageId| Number: the message's DB record ID. 1.84 + * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null). 1.85 + * |aDelivery| DOMString: the new delivery value to update (can be null). 1.86 + * |aDeliveryStatus| DOMString: the new delivery status to update (can be null). 1.87 + * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers. 1.88 + * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback. 1.89 + */ 1.90 + void setMessageDeliveryByMessageId(in long aMessageId, 1.91 + in DOMString aReceiver, 1.92 + in DOMString aDelivery, 1.93 + in DOMString aDeliveryStatus, 1.94 + in DOMString aEnvelopeId, 1.95 + [optional] in nsIRilMobileMessageDatabaseCallback aCallback); 1.96 + 1.97 + /** 1.98 + * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers. 1.99 + * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null). 1.100 + * |aDeliveryStatus| DOMString: the new delivery status to be updated (can be null). 1.101 + * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback. 1.102 + */ 1.103 + void setMessageDeliveryStatusByEnvelopeId(in DOMString aEnvelopeId, 1.104 + in DOMString aReceiver, 1.105 + in DOMString aDeliveryStatus, 1.106 + [optional] in nsIRilMobileMessageDatabaseCallback aCallback); 1.107 + 1.108 + /** 1.109 + * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers. 1.110 + * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null). 1.111 + * |aReadStatus| DOMString: the new read status to be updated. 1.112 + * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback. 1.113 + */ 1.114 + void setMessageReadStatusByEnvelopeId(in DOMString aEnvelopeId, 1.115 + in DOMString aReceiver, 1.116 + in DOMString aReadStatus, 1.117 + [optional] in nsIRilMobileMessageDatabaseCallback aCallback); 1.118 + 1.119 + /** 1.120 + * |aMessageId| Number: the message's DB record ID. 1.121 + * |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which 1.122 + * takes result flag, message record and domMessage as parameters. 1.123 + */ 1.124 + void getMessageRecordById(in long aMessageId, 1.125 + in nsIRilMobileMessageDatabaseRecordCallback aCallback); 1.126 + 1.127 + /** 1.128 + * |aTransactionId| DOMString: the transaction ID of MMS PDU. 1.129 + * |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which 1.130 + * takes result flag and message record as parameters. 1.131 + */ 1.132 + void getMessageRecordByTransactionId(in DOMString aTransactionId, 1.133 + in nsIRilMobileMessageDatabaseRecordCallback aCallback); 1.134 + 1.135 + /** 1.136 + * |aCrError| nsresult: the NS_ERROR defined in Components.results. 1.137 + * 1.138 + * @returns the error code defined in nsIMobileMessageCallback 1.139 + */ 1.140 + jsval translateCrErrorToMessageCallbackError(in nsresult aCrError); 1.141 + 1.142 + /** 1.143 + * |aSmsSegment| jsval: Decoded Single SMS PDU. 1.144 + * |aCallback| nsIRilMobileMessageDatabaseConcatenationCallback: a callback which 1.145 + * takes result flag, and complete mesage as parameters. 1.146 + */ 1.147 + void saveSmsSegment(in jsval aSmsSegment, 1.148 + in nsIRilMobileMessageDatabaseConcatenationCallback aCallback); 1.149 +};