michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "domstubs.idl" michael@0: #include "nsISupports.idl" michael@0: #include "nsIMobileMessageDatabaseService.idl" michael@0: michael@0: [scriptable, function, uuid(92986322-8d56-11e2-8816-73a531c493c2)] michael@0: interface nsIRilMobileMessageDatabaseCallback : nsISupports michael@0: { michael@0: /** michael@0: * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message michael@0: */ michael@0: void notify(in nsresult aRv, in nsISupports aDomMessage); michael@0: }; michael@0: michael@0: [scriptable, function, uuid(32b02bbe-60a1-45e0-a748-ad40709b09dd)] michael@0: interface nsIRilMobileMessageDatabaseRecordCallback : nsISupports michael@0: { michael@0: /** michael@0: * |aMessageRecord| Object: the mobile-message database record michael@0: * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message. Noted, this value might be null. michael@0: */ michael@0: void notify(in nsresult aRv, in jsval aMessageRecord, in nsISupports aDomMessage); michael@0: }; michael@0: michael@0: [scriptable, function, uuid(1b0ff03c-a2bc-11e3-a443-838d034c9805)] michael@0: interface nsIRilMobileMessageDatabaseConcatenationCallback : nsISupports michael@0: { michael@0: /** michael@0: * |aCompleteMessage|: jsval: the completely concatenated message. Noted, this value might be null. michael@0: */ michael@0: void notify(in nsresult aRv, in jsval aCompleteMessage); michael@0: }; michael@0: michael@0: [scriptable, uuid(0b437a5c-a2bc-11e3-bd1b-dbb173eb35f8)] michael@0: interface nsIRilMobileMessageDatabaseService : nsIMobileMessageDatabaseService michael@0: { michael@0: /** michael@0: * |aMessage| Object: should contain the following properties for internal use: michael@0: * - |type| DOMString: "sms" or "mms" michael@0: * - |timestamp| Number: the timestamp of received message michael@0: * - |iccId| DOMString: [optional] the ICC ID of the SIM for receiving michael@0: * message if available. michael@0: * michael@0: * - If |type| == "sms", we also need: michael@0: * - |messageClass| DOMString: the message class of received message michael@0: * - |receiver| DOMString: the phone number of receiver michael@0: * - |pid| Number: the TP-PID field of the SMS TPDU, default 0. michael@0: * - |sender| DOMString: the phone number of sender michael@0: * michael@0: * - If |type| == "mms", we also need: michael@0: * - |delivery| DOMString: the delivery state of received message michael@0: * - |deliveryStatus| DOMString: the delivery status of received message michael@0: * - |receivers| DOMString Array: the phone numbers of receivers michael@0: * - |phoneNumber| DOMString: [optional] my own phone number. michael@0: */ michael@0: void saveReceivedMessage(in jsval aMessage, michael@0: [optional] in nsIRilMobileMessageDatabaseCallback aCallback); michael@0: michael@0: /** michael@0: * |aMessage| Object: should contain the following properties for internal use: michael@0: * - |type| DOMString: "sms" or "mms" michael@0: * - |sender| DOMString: the phone number of sender michael@0: * - |timestamp| Number: the timestamp of sending message michael@0: * - |deliveryStatusRequested| Bool: true when the delivery report is requested. michael@0: * - |iccId| DOMString: the ICC ID of the SIM for sending message michael@0: * michael@0: * - If |type| == "sms", we also need: michael@0: * - |receiver| DOMString: the phone number of receiver michael@0: * michael@0: * - If |type| == "mms", we also need: michael@0: * - |receivers| DOMString Array: the phone numbers of receivers michael@0: */ michael@0: void saveSendingMessage(in jsval aMessage, michael@0: [optional] in nsIRilMobileMessageDatabaseCallback aCallback); michael@0: michael@0: /** michael@0: * |aMessageId| Number: the message's DB record ID. michael@0: * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null). michael@0: * |aDelivery| DOMString: the new delivery value to update (can be null). michael@0: * |aDeliveryStatus| DOMString: the new delivery status to update (can be null). michael@0: * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers. michael@0: * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback. michael@0: */ michael@0: void setMessageDeliveryByMessageId(in long aMessageId, michael@0: in DOMString aReceiver, michael@0: in DOMString aDelivery, michael@0: in DOMString aDeliveryStatus, michael@0: in DOMString aEnvelopeId, michael@0: [optional] in nsIRilMobileMessageDatabaseCallback aCallback); michael@0: michael@0: /** michael@0: * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers. michael@0: * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null). michael@0: * |aDeliveryStatus| DOMString: the new delivery status to be updated (can be null). michael@0: * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback. michael@0: */ michael@0: void setMessageDeliveryStatusByEnvelopeId(in DOMString aEnvelopeId, michael@0: in DOMString aReceiver, michael@0: in DOMString aDeliveryStatus, michael@0: [optional] in nsIRilMobileMessageDatabaseCallback aCallback); michael@0: michael@0: /** michael@0: * |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers. michael@0: * |aReceiver| DOMString: the phone number of receiver (for MMS; can be null). michael@0: * |aReadStatus| DOMString: the new read status to be updated. michael@0: * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback. michael@0: */ michael@0: void setMessageReadStatusByEnvelopeId(in DOMString aEnvelopeId, michael@0: in DOMString aReceiver, michael@0: in DOMString aReadStatus, michael@0: [optional] in nsIRilMobileMessageDatabaseCallback aCallback); michael@0: michael@0: /** michael@0: * |aMessageId| Number: the message's DB record ID. michael@0: * |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which michael@0: * takes result flag, message record and domMessage as parameters. michael@0: */ michael@0: void getMessageRecordById(in long aMessageId, michael@0: in nsIRilMobileMessageDatabaseRecordCallback aCallback); michael@0: michael@0: /** michael@0: * |aTransactionId| DOMString: the transaction ID of MMS PDU. michael@0: * |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which michael@0: * takes result flag and message record as parameters. michael@0: */ michael@0: void getMessageRecordByTransactionId(in DOMString aTransactionId, michael@0: in nsIRilMobileMessageDatabaseRecordCallback aCallback); michael@0: michael@0: /** michael@0: * |aCrError| nsresult: the NS_ERROR defined in Components.results. michael@0: * michael@0: * @returns the error code defined in nsIMobileMessageCallback michael@0: */ michael@0: jsval translateCrErrorToMessageCallbackError(in nsresult aCrError); michael@0: michael@0: /** michael@0: * |aSmsSegment| jsval: Decoded Single SMS PDU. michael@0: * |aCallback| nsIRilMobileMessageDatabaseConcatenationCallback: a callback which michael@0: * takes result flag, and complete mesage as parameters. michael@0: */ michael@0: void saveSmsSegment(in jsval aSmsSegment, michael@0: in nsIRilMobileMessageDatabaseConcatenationCallback aCallback); michael@0: };