dom/mobilemessage/interfaces/nsISmsRequest.idl
author Gene Lian <clian@mozilla.com>
Fri, 01 Mar 2013 16:38:47 +0800
changeset 133869 af40e0f0ce26b2e4869d34e9d7412c8e138eaeaf
parent 121205 dom/sms/interfaces/nsISmsRequest.idl@508ecb4a6cb3e37deb403947aa6b31467533fb9b
permissions -rw-r--r--
Bug 844429 - B2G SMS & MMS: move SMS codes into dom/mobilemessage to make it generic for MMS. r=vicamo

/* 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 "nsISupports.idl"

interface nsIDOMMozSmsMessage;

dictionary SmsThreadListItem
{
  DOMString senderOrReceiver;
  unsigned long long timestamp;
  DOMString body;
  unsigned long long unreadCount;
};

[scriptable, builtinclass, uuid(82a6d16d-cf33-4745-8662-8b5d441f512f)]
interface nsISmsRequest : nsISupports
{
  /**
   * All SMS related errors that could apply to SmsRequest objects.
   * Make sure to keep this list in sync with the list in:
   * embedding/android/GeckoSmsManager.java
   */
  const unsigned short SUCCESS_NO_ERROR = 0;
  const unsigned short NO_SIGNAL_ERROR  = 1;
  const unsigned short NOT_FOUND_ERROR  = 2;
  const unsigned short UNKNOWN_ERROR    = 3;
  const unsigned short INTERNAL_ERROR   = 4;

  void notifyMessageSent(in nsIDOMMozSmsMessage message);
  void notifySendMessageFailed(in long error);

  void notifyMessageGot(in nsIDOMMozSmsMessage message);
  void notifyGetMessageFailed(in long error);

  void notifyMessageDeleted(in boolean deleted);
  void notifyDeleteMessageFailed(in long error);

  void notifyMessageListCreated(in long listId,
                                in nsIDOMMozSmsMessage message);
  void notifyReadMessageListFailed(in long error);
  void notifyNextMessageInListGot(in nsIDOMMozSmsMessage message);
  void notifyNoMessageInList();

  void notifyMessageMarkedRead(in boolean read);
  void notifyMarkMessageReadFailed(in long error);

  [implicit_jscontext]
  void notifyThreadList(in jsval threadList);
  void notifyThreadListFailed(in long error);
};