/* 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 nsIDOMDOMRequest;
interface nsIDOMWindow;
interface nsIIccListener;

/**
 * XPCOM component (in the content process) that provides the ICC information.
 */
[scriptable, uuid(2fbacfc4-f52d-11e4-9667-33b72f279d14)]
interface nsIIccProvider : nsISupports
{
  /**
   * Called when a content process registers receiving unsolicited messages from
   * RadioInterfaceLayer in the chrome process. Only a content process that has
   * the 'mobileconnection' permission is allowed to register.
   */
  void registerIccMsg(in unsigned long clientId, in nsIIccListener listener);
  void unregisterIccMsg(in unsigned long clientId, in nsIIccListener listener);

  /**
   * STK interfaces.
   */
  void sendStkResponse(in unsigned long clientId,
                       in nsIDOMWindow window,
                       in jsval command,
                       in jsval response);
  void sendStkMenuSelection(in unsigned long clientId,
                            in nsIDOMWindow window,
                            in unsigned short itemIdentifier,
                            in boolean helpRequested);
  void sendStkTimerExpiration(in unsigned long clientId,
                              in nsIDOMWindow window,
                              in jsval timer);
  void sendStkEventDownload(in unsigned long clientId,
                            in nsIDOMWindow window,
                            in jsval event);

  /**
   * Phonebook interfaces.
   */
  nsIDOMDOMRequest readContacts(in unsigned long clientId,
                                in nsIDOMWindow window,
                                in unsigned long contactType);

  nsIDOMDOMRequest updateContact(in unsigned long clientId,
                                 in nsIDOMWindow window,
                                 in unsigned long contactType,
                                 in jsval contact,
                                 in DOMString pin2);
};
