DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (5b81998bb7ab)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
/* 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 "domstubs.idl"
#include "nsISupports.idl"
#include "nsIMobileMessageDatabaseService.idl"

[scriptable, function, uuid(92986322-8d56-11e2-8816-73a531c493c2)]
interface nsIRilMobileMessageDatabaseCallback : nsISupports
{
  /**
   * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message
   */
  void notify(in nsresult aRv, in nsISupports aDomMessage);
};

[scriptable, function, uuid(32b02bbe-60a1-45e0-a748-ad40709b09dd)]
interface nsIRilMobileMessageDatabaseRecordCallback : nsISupports
{
  /**
   * |aMessageRecord| Object: the mobile-message database record
   * |aDomMessage|: the nsIDOMMoz{Mms,Sms}Message. Noted, this value might be null.
   */
  void notify(in nsresult aRv, in jsval aMessageRecord, in nsISupports aDomMessage);
};

[scriptable, uuid(0ead3154-542d-4e2c-a624-9e3cec504758)]
interface nsIRilMobileMessageDatabaseService : nsIMobileMessageDatabaseService
{
  /**
   * |aMessage| Object: should contain the following properties for internal use:
   *   - |type| DOMString: "sms" or "mms"
   *   - |sender| DOMString: the phone number of sender
   *   - |timestamp| Number: the timestamp of received message
   *
   *   - If |type| == "sms", we also need:
   *     - |messageClass| DOMString: the message class of received message
   *
   *   - If |type| == "mms", we also need:
   *     - |delivery| DOMString: the delivery state of received message
   *     - |deliveryStatus| DOMString Array: the delivery status of received message
   *     - |receivers| DOMString Array: the phone numbers of receivers
   *     - |transactionId| DOMString: the transaction ID from MMS pdu header.
   *
   * Note: |deliveryStatus| should only contain single string to specify
   *       the delivery status of MMS message for the phone owner self.
   */
  long saveReceivedMessage(in jsval aMessage,
                [optional] in nsIRilMobileMessageDatabaseCallback aCallback);

  /**
   * |aMessage| Object: should contain the following properties for internal use:
   *   - |type| DOMString: "sms" or "mms"
   *   - |timestamp| Number: the timestamp of sending message
   *   - |deliveryStatusRequested| Bool: true when the delivery report is requested.
   *
   *   - 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
   */
  long saveSendingMessage(in jsval aMessage,
               [optional] in nsIRilMobileMessageDatabaseCallback aCallback);

  /**
   * |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).
   * |aCallback| nsIRilMobileMessageDatabaseCallback: an optional callback.
   */
  void setMessageDelivery(in long aMessageId,
                          in DOMString aReceiver,
                          in DOMString aDelivery,
                          in DOMString aDeliveryStatus,
               [optional] in nsIRilMobileMessageDatabaseCallback aCallback);

  /**
   * |aMessageId| Number: the message's DB record ID.
   * |aCallback| nsIRilMobileMessageDatabaseCallback: a callback which takes
   *   result flag, message record and domMessage as parameters.
   */
  void getMessageRecordById(in long aMessageId,
                            in nsIRilMobileMessageDatabaseRecordCallback aCallback);

  /**
   * |aTransactionId| DOMString: the transaction ID of MMS pdu.
   * |aCallback| nsIRilMobileMessageDatabaseCallback: a callback which takes
   *   result flag and message record as parameters.
   */
  void getMessageRecordByTransactionId(in DOMString aTransactionId,
                                       in nsIRilMobileMessageDatabaseRecordCallback aCallback);
};