DXR will be turned off on Tuesday, December 29th. It will redirect to Searchfox.
See the announcement on Discourse.

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.

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 96 97
/* 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"

[scriptable, uuid(56f66190-44a0-11e4-aa32-636783cc014a)]
interface nsICellBroadcastListener : nsISupports
{
  /**
   * Called when a Cell Broadcast message has been received by the network.
   */
  void notifyMessageReceived(in unsigned long aServiceId,
                             in unsigned long aGsmGeographicalScope,
                             in unsigned short aMessageCode,
                             in unsigned short aMessageId,
                             in DOMString aLanguage,
                             in DOMString aBody,
                             in unsigned long aMessageClass,
                             in DOMTimeStamp aTimestamp,
                             in unsigned long aCdmaServiceCategory,
                             in boolean aHasEtwsInfo,
                             in unsigned long aEtwsWarningType,
                             in boolean aEtwsEmergencyUserAlert,
                             in boolean aEtwsPopup);
};

%{C++
#define CELLBROADCAST_SERVICE_CID \
  { 0xc870bdca, 0x277c, 0x11e4, { 0xac, 0xa3, 0x33, 0x73, 0xa1, 0xef, 0x48, 0xf8 } }
#define CELLBROADCAST_SERVICE_CONTRACTID \
  "@mozilla.org/cellbroadcast/cellbroadcastservice;1"
%}

/**
 * XPCOM component that provides the cell broadcast information.
 */
[scriptable, uuid(906cda5a-6b18-11e4-973b-5ff3fc075b6b)]
interface nsICellBroadcastService : nsISupports
{
  /**
   * Constant definitions of predefined GSM Geographic Scope
   * See 3GPP TS 23.041 clause 9.4.1.2.1 Serial Number
   */
  const unsigned short GSM_GEOGRAPHICAL_SCOPE_CELL_IMMEDIATE = 0;
  const unsigned short GSM_GEOGRAPHICAL_SCOPE_PLMN           = 1;
  const unsigned short GSM_GEOGRAPHICAL_SCOPE_LOCATION_AREA  = 2;
  const unsigned short GSM_GEOGRAPHICAL_SCOPE_CELL           = 3;
  const unsigned short GSM_GEOGRAPHICAL_SCOPE_INVALID        = 0xFFFF;

  /**
   * Constant definitions of predefined GSM Message Class
   * See 3GPP TS 23.038 clause 5 CBS Data Coding Scheme
   *
   * Set to GSM_MESSAGE_CLASS_NORMAL if no message class is specified.
   */
  const unsigned short GSM_MESSAGE_CLASS_0       = 0;
  const unsigned short GSM_MESSAGE_CLASS_1       = 1;
  const unsigned short GSM_MESSAGE_CLASS_2       = 2;
  const unsigned short GSM_MESSAGE_CLASS_3       = 3;
  const unsigned short GSM_MESSAGE_CLASS_USER_1  = 4;
  const unsigned short GSM_MESSAGE_CLASS_USER_2  = 5;
  const unsigned short GSM_MESSAGE_CLASS_NORMAL  = 6;

  /**
   * Constant definitions of predefined GSM ETWS Warning Types
   * see 3GPP TS 23.041 clause 9.3.24 Warning-Type
   */
  const unsigned short GSM_ETWS_WARNING_EARTHQUAKE         = 0;
  const unsigned short GSM_ETWS_WARNING_TSUNAMI            = 1;
  const unsigned short GSM_ETWS_WARNING_EARTHQUAKE_TSUNAMI = 2;
  const unsigned short GSM_ETWS_WARNING_TEST               = 3;
  const unsigned short GSM_ETWS_WARNING_OTHER              = 4;
  const unsigned short GSM_ETWS_WARNING_INVALID            = 0xFFFF;

  /**
   * Attribute CdmaServiceCategory is only valid in CDMA network.
   * Set to CDMA_SERVICE_CATEGORY_INVALID if received from GSM/UMTS network.
   */
  const unsigned long CDMA_SERVICE_CATEGORY_INVALID = 0xFFFFFFFF;

  /**
   * Called to register receiving cellbroadcast messages.
   *
   * 'cellbroadcast' permission is required for registration/unregistration.
   */
  void registerListener(in nsICellBroadcastListener listener);
  void unregisterListener(in nsICellBroadcastListener listener);
};

%{C++
template<typename T> struct already_AddRefed;

already_AddRefed<nsICellBroadcastService>
NS_CreateCellBroadcastService();
%}