2012-12-11 01:09:46 -08:00
|
|
|
/* 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/. */
|
|
|
|
|
2013-02-08 02:45:04 -08:00
|
|
|
#include "domstubs.idl"
|
2013-01-23 01:40:45 -08:00
|
|
|
#include "nsISupports.idl"
|
2013-02-05 03:39:44 -08:00
|
|
|
#include "nsIMobileMessageDatabaseService.idl"
|
2012-12-11 01:09:46 -08:00
|
|
|
|
2013-03-07 19:46:16 -08:00
|
|
|
[scriptable, function, uuid(92986322-8d56-11e2-8816-73a531c493c2)]
|
2013-02-05 03:10:39 -08:00
|
|
|
interface nsIRilMobileMessageDatabaseCallback : nsISupports
|
2013-01-23 01:40:45 -08:00
|
|
|
{
|
2013-02-08 02:45:04 -08:00
|
|
|
/**
|
2013-03-07 19:46:16 -08:00
|
|
|
* |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message
|
2013-02-08 02:45:04 -08:00
|
|
|
*/
|
2013-03-07 19:46:16 -08:00
|
|
|
void notify(in nsresult aRv, in nsISupports aDomMessage);
|
2013-01-23 01:40:45 -08:00
|
|
|
};
|
|
|
|
|
2013-05-09 18:53:39 -07:00
|
|
|
[scriptable, function, uuid(32b02bbe-60a1-45e0-a748-ad40709b09dd)]
|
2013-03-21 02:57:41 -07:00
|
|
|
interface nsIRilMobileMessageDatabaseRecordCallback : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* |aMessageRecord| Object: the mobile-message database record
|
2013-05-09 18:53:39 -07:00
|
|
|
* |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message. Noted, this value might be null.
|
2013-03-21 02:57:41 -07:00
|
|
|
*/
|
2013-05-09 18:53:39 -07:00
|
|
|
void notify(in nsresult aRv, in jsval aMessageRecord, in nsISupports aDomMessage);
|
2013-03-21 02:57:41 -07:00
|
|
|
};
|
|
|
|
|
2014-02-19 20:21:11 -08:00
|
|
|
[scriptable, uuid(596ef782-9f7a-11e3-8508-ff3a7d599531)]
|
2013-02-05 03:10:39 -08:00
|
|
|
interface nsIRilMobileMessageDatabaseService : nsIMobileMessageDatabaseService
|
2012-12-11 01:09:46 -08:00
|
|
|
{
|
2013-02-08 02:45:04 -08:00
|
|
|
/**
|
|
|
|
* |aMessage| Object: should contain the following properties for internal use:
|
|
|
|
* - |type| DOMString: "sms" or "mms"
|
|
|
|
* - |timestamp| Number: the timestamp of received message
|
2013-11-25 02:55:00 -08:00
|
|
|
* - |iccId| DOMString: [optional] the ICC ID of the SIM for receiving
|
|
|
|
* message if available.
|
2013-03-22 04:29:25 -07:00
|
|
|
*
|
|
|
|
* - If |type| == "sms", we also need:
|
|
|
|
* - |messageClass| DOMString: the message class of received message
|
2013-07-02 02:36:33 -07:00
|
|
|
* - |receiver| DOMString: the phone number of receiver
|
2013-11-19 11:46:15 -08:00
|
|
|
* - |pid| Number: the TP-PID field of the SMS TPDU, default 0.
|
2013-11-25 02:55:01 -08:00
|
|
|
* - |sender| DOMString: the phone number of sender
|
2013-03-22 04:29:25 -07:00
|
|
|
*
|
|
|
|
* - If |type| == "mms", we also need:
|
|
|
|
* - |delivery| DOMString: the delivery state of received message
|
2013-11-25 02:55:03 -08:00
|
|
|
* - |deliveryStatus| DOMString: the delivery status of received message
|
2013-03-22 04:29:25 -07:00
|
|
|
* - |receivers| DOMString Array: the phone numbers of receivers
|
2013-10-14 19:42:49 -07:00
|
|
|
* - |phoneNumber| DOMString: [optional] my own phone number.
|
2013-02-08 02:45:04 -08:00
|
|
|
*/
|
2013-11-19 11:46:12 -08:00
|
|
|
void saveReceivedMessage(in jsval aMessage,
|
2013-02-05 03:10:39 -08:00
|
|
|
[optional] in nsIRilMobileMessageDatabaseCallback aCallback);
|
2013-02-08 02:45:04 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* |aMessage| Object: should contain the following properties for internal use:
|
|
|
|
* - |type| DOMString: "sms" or "mms"
|
2013-07-02 02:36:33 -07:00
|
|
|
* - |sender| DOMString: the phone number of sender
|
2013-02-08 02:45:04 -08:00
|
|
|
* - |timestamp| Number: the timestamp of sending message
|
2013-03-08 23:22:17 -08:00
|
|
|
* - |deliveryStatusRequested| Bool: true when the delivery report is requested.
|
2013-11-02 03:17:25 -07:00
|
|
|
* - |iccId| DOMString: the ICC ID of the SIM for sending message
|
2013-03-22 04:29:25 -07:00
|
|
|
*
|
|
|
|
* - If |type| == "sms", we also need:
|
|
|
|
* - |receiver| DOMString: the phone number of receiver
|
|
|
|
*
|
|
|
|
* - If |type| == "mms", we also need:
|
|
|
|
* - |receivers| DOMString Array: the phone numbers of receivers
|
2013-02-08 02:45:04 -08:00
|
|
|
*/
|
2013-11-19 11:46:12 -08:00
|
|
|
void saveSendingMessage(in jsval aMessage,
|
2013-02-05 03:10:39 -08:00
|
|
|
[optional] in nsIRilMobileMessageDatabaseCallback aCallback);
|
2013-02-08 02:45:04 -08:00
|
|
|
|
2013-03-08 23:22:17 -08:00
|
|
|
/**
|
|
|
|
* |aMessageId| Number: the message's DB record ID.
|
|
|
|
* |aReceiver| DOMString: the phone number of receiver (for MMS; can be null).
|
|
|
|
* |aDelivery| DOMString: the new delivery value to update (can be null).
|
|
|
|
* |aDeliveryStatus| DOMString: the new delivery status to update (can be null).
|
2013-07-31 00:23:37 -07:00
|
|
|
* |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers.
|
2013-03-08 23:22:17 -08:00
|
|
|
* |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback.
|
|
|
|
*/
|
2013-07-31 00:23:37 -07:00
|
|
|
void setMessageDeliveryByMessageId(in long aMessageId,
|
|
|
|
in DOMString aReceiver,
|
|
|
|
in DOMString aDelivery,
|
|
|
|
in DOMString aDeliveryStatus,
|
|
|
|
in DOMString aEnvelopeId,
|
|
|
|
[optional] in nsIRilMobileMessageDatabaseCallback aCallback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers.
|
|
|
|
* |aReceiver| DOMString: the phone number of receiver (for MMS; can be null).
|
2013-11-25 02:54:58 -08:00
|
|
|
* |aDeliveryStatus| DOMString: the new delivery status to be updated (can be null).
|
|
|
|
* |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback.
|
|
|
|
*/
|
|
|
|
void setMessageDeliveryStatusByEnvelopeId(in DOMString aEnvelopeId,
|
|
|
|
in DOMString aReceiver,
|
|
|
|
in DOMString aDeliveryStatus,
|
|
|
|
[optional] in nsIRilMobileMessageDatabaseCallback aCallback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* |aEnvelopeId| DOMString: the "message-id" specified in the MMS PDU headers.
|
|
|
|
* |aReceiver| DOMString: the phone number of receiver (for MMS; can be null).
|
|
|
|
* |aReadStatus| DOMString: the new read status to be updated.
|
2013-07-31 00:23:37 -07:00
|
|
|
* |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback.
|
|
|
|
*/
|
2013-11-25 02:54:58 -08:00
|
|
|
void setMessageReadStatusByEnvelopeId(in DOMString aEnvelopeId,
|
|
|
|
in DOMString aReceiver,
|
|
|
|
in DOMString aReadStatus,
|
|
|
|
[optional] in nsIRilMobileMessageDatabaseCallback aCallback);
|
2013-03-21 02:57:41 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* |aMessageId| Number: the message's DB record ID.
|
2013-07-31 00:23:37 -07:00
|
|
|
* |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which
|
|
|
|
* takes result flag, message record and domMessage as parameters.
|
2013-03-21 02:57:41 -07:00
|
|
|
*/
|
|
|
|
void getMessageRecordById(in long aMessageId,
|
|
|
|
in nsIRilMobileMessageDatabaseRecordCallback aCallback);
|
2013-03-22 04:04:02 -07:00
|
|
|
|
|
|
|
/**
|
2013-07-31 00:23:37 -07:00
|
|
|
* |aTransactionId| DOMString: the transaction ID of MMS PDU.
|
|
|
|
* |aCallback| nsIRilMobileMessageDatabaseRecordCallback: a callback which
|
|
|
|
* takes result flag and message record as parameters.
|
2013-03-22 04:04:02 -07:00
|
|
|
*/
|
|
|
|
void getMessageRecordByTransactionId(in DOMString aTransactionId,
|
|
|
|
in nsIRilMobileMessageDatabaseRecordCallback aCallback);
|
2014-02-19 20:21:11 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* |aCrError| nsresult: the NS_ERROR defined in Components.results.
|
|
|
|
*
|
|
|
|
* @returns the error code defined in nsIMobileMessageCallback
|
|
|
|
*/
|
|
|
|
jsval translateCrErrorToMessageCallbackError(in nsresult aCrError);
|
2012-12-11 01:09:46 -08:00
|
|
|
};
|