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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
/* 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 "nsIDOMEventTarget.idl"

interface nsIDOMEventListener;
interface nsIDOMDOMRequest;
interface nsIDOMMozMobileICCInfo;
interface nsIDOMMozMobileConnectionInfo;
interface nsIDOMMozMobileNetworkInfo;
interface nsIDOMMozMobileCellInfo;
interface nsIDOMMozIccManager;
interface nsIDOMMozMobileCFInfo;

[scriptable, builtinclass, uuid(cc4947eb-aa39-4c25-878d-618dc4d4d2bc)]
interface nsIDOMMozMobileConnection : nsIDOMEventTarget
{
  const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
  const long ICC_SERVICE_CLASS_DATA = (1 << 1);
  const long ICC_SERVICE_CLASS_FAX = (1 << 2);
  const long ICC_SERVICE_CLASS_SMS = (1 << 3);
  const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
  const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
  const long ICC_SERVICE_CLASS_PACKET = (1 << 6);
  const long ICC_SERVICE_CLASS_PAD = (1 << 7);

  /**
   * Indicates the state of the device's ICC card.
   *
   * Possible values: null, 'absent', 'pinRequired', 'pukRequired',
   * 'networkLocked', 'ready'.
   */
  readonly attribute DOMString cardState;

  /**
   * Information stored in the device's ICC card.
   */
  readonly attribute nsIDOMMozMobileICCInfo iccInfo;

  /**
   * Information about the voice connection.
   */
  readonly attribute nsIDOMMozMobileConnectionInfo voice;

  /**
   * Information about the data connection.
   */
  readonly attribute nsIDOMMozMobileConnectionInfo data;

  /**
   * The selection mode of the voice and data networks.
   *
   * Possible values: null (unknown), 'automatic', 'manual'
   */
  readonly attribute DOMString networkSelectionMode;

  /**
   * IccManager provides access to ICC related funcionality.
   */
  readonly attribute nsIDOMMozIccManager icc;

  /**
   * Search for available networks.
   *
   * If successful, the request's onsuccess will be called, and the request's
   * result will be an array of nsIDOMMozMobileNetworkInfo.
   *
   * Otherwise, the request's onerror will be called, and the request's error
   * will be either 'RadioNotAvailable', 'RequestNotSupported',
   * or 'GenericFailure'.
   */
  nsIDOMDOMRequest getNetworks();

  /**
   * Manually selects the passed in network, overriding the radio's current
   * selection.
   *
   * If successful, the request's onsuccess will be called.
   * Note: If the network was actually changed by this request,
   * the 'voicechange' and 'datachange' events will also be fired.
   *
   * Otherwise, the request's onerror will be called, and the request's error
   * will be either 'RadioNotAvailable', 'RequestNotSupported',
   * 'IllegalSIMorME', or 'GenericFailure'
   */
  nsIDOMDOMRequest selectNetwork(in nsIDOMMozMobileNetworkInfo network);

  /**
   * Tell the radio to automatically select a network.
   *
   * If successful, the request's onsuccess will be called.
   * Note: If the network was actually changed by this request, the
   * 'voicechange' and 'datachange' events will also be fired.
   *
   * Otherwise, the request's onerror will be called, and the request's error
   * will be either 'RadioNotAvailable', 'RequestNotSupported',
   * 'IllegalSIMorME', or 'GenericFailure'
   */
  nsIDOMDOMRequest selectNetworkAutomatically();

  /**
   * Find out about the status of an ICC lock (e.g. the PIN lock).
   *
   * @param lockType
   *        Identifies the lock type, e.g. "pin" for the PIN lock.
   *
   * @return a DOM Request.
   *         The request's result will be an object containing
   *         information about the specified lock's status,
   *         e.g. {lockType: "pin", enabled: true}.
   */
  nsIDOMDOMRequest getCardLock(in DOMString lockType);

  /**
   * Unlock a card lock.
   *
   * @param info
   *        An object containing the information necessary to unlock
   *        the given lock. At a minimum, this object must have a
   *        "lockType" attribute which specifies the type of lock, e.g.
   *        "pin" for the PIN lock. Other attributes are dependent on
   *        the lock type.
   *
   * Examples:
   *
   * (1) Unlocking the PIN:
   *
   *   unlockCardLock({lockType: "pin",
   *                   pin: "..."});
   *
   * (2) Network depersonalization. Unlocking the network control key (NCK).
   *
   *   unlockCardLock({lockType: "nck",
   *                   pin: "..."});
   *
   * (3) Unlocking the PUK and supplying a new PIN:
   *
   *   unlockCardLock({lockType: "puk",
   *                   puk: "...",
   *                   newPin: "..."});
   *
   * @return a nsIDOMDOMRequest.
   *         The request's result will be an object containing
   *         information about the unlock operation.
   *
   * Examples:
   *
   * (1) Unlocking failed:
   *
   *     {
   *       lockType:   "pin",
   *       result:     false,
   *       retryCount: 2
   *     }
   *
   * (2) Unlocking succeeded:
   *
   *     {
   *       lockType:  "pin",
   *       result:    true
   *     }
   */
  nsIDOMDOMRequest unlockCardLock(in jsval info);

  /**
   * Modify the state of a card lock.
   *
   * @param info
   *        An object containing information about the lock and
   *        how to modify its state. At a minimum, this object
   *        must have a "lockType" attribute which specifies the
   *        type of lock, e.g. "pin" for the PIN lock. Other
   *        attributes are dependent on the lock type.
   *
   * Examples:
   *
   * (1) Disabling the PIN lock:
   *
   *   setCardLock({lockType: "pin",
   *                pin: "...",
   *                enabled: false});
   *
   * (2) Changing the PIN:
   *
   *   setCardLock({lockType: "pin",
   *                pin: "...",
   *                newPin: "..."});
   *
   * @return a nsIDOMDOMRequest.
   *         The request's result will be an object containing
   *         information about the operation.
   *
   * Examples:
   *
   * (1) Enabling/Disabling card lock failed or change card lock failed.
   *
   *     {
   *       lockType: "pin",
   *       result: false,
   *       retryCount: 2
   *     }
   *
   * (2) Enabling/Disabling card lock succeed or change card lock succeed.
   *
   *     {
   *       lockType: "pin",
   *       result: true
   *     }
   */
  nsIDOMDOMRequest setCardLock(in jsval info);

  /**
   * Send a MMI message.
   *
   * @param mmi
   *        DOMString containing an MMI string that can be associated to a
   *        USSD request or other RIL functionality.
   *
   * @return a nsIDOMDOMRequest
   *         The request's result will be an object containing information
   *         about the operation.
   *
   * In case that the MMI code requires sending an USSD request, the DOMrequest
   * 'success' event means that the RIL has successfully processed and sent the
   * USSD request to the network. The network reply will be reported via
   * 'onussdreceived' event. If the MMI code is not associated to a USSD but to
   * other RIL request its result, if one is needed, will be notified via the
   * returned DOMRequest 'success' or 'error' event.
   */
  nsIDOMDOMRequest sendMMI(in DOMString mmi);

  /**
   * Cancel the current MMI request if one exists.
   */
  nsIDOMDOMRequest cancelMMI();

   /**
   * Configures call forward options.
   *
   * @param CFInfo
   *        An object containing the call forward rule to set.
   *
   * If successful, the request's onsuccess will be called.
   *
   * Otherwise, the request's onerror will be called, and the request's error
   * will be either 'RadioNotAvailable', 'RequestNotSupported',
   * 'IllegalSIMorME', or 'GenericFailure'
   */
  nsIDOMDOMRequest setCallForwardingOption(in nsIDOMMozMobileCFInfo CFInfo);

  /**
   * Queries current call forward options.
   *
   * @param reason
   *        Indicates the reason the call is being forwarded. It will be either
   *        unconditional (0), mobile busy (1), no reply (2), not reachable (3),
   *        all call forwarding (4), or all conditional call forwarding (5).
   *
   * If successful, the request's onsuccess will be called, and the request's
   * result will be an array of nsIDOMMozMobileCFInfo.
   *
   * Otherwise, the request's onerror will be called, and the request's error
   * will be either 'RadioNotAvailable', 'RequestNotSupported',
   * or 'GenericFailure'.
   */
  nsIDOMDOMRequest getCallForwardingOption(in unsigned short reason);

  /**
   * The 'cardstatechange' event is notified when the 'cardState' attribute
   * changes value.
   */
  [implicit_jscontext] attribute jsval oncardstatechange;

   /**
   * The 'iccinfochange' event is notified whenever the icc info object
   * changes.
   */
  [implicit_jscontext] attribute jsval oniccinfochange;

  /**
   * The 'voicechange' event is notified whenever the voice connection object
   * changes.
   */
  [implicit_jscontext] attribute jsval onvoicechange;

  /**
   * The 'datachange' event is notified whenever the data connection object
   * changes values.
   */
  [implicit_jscontext] attribute jsval ondatachange;

  /**
   * The 'ussdreceived' event is notified whenever a new USSD message is
   * received.
   */
  [implicit_jscontext] attribute jsval onussdreceived;

  /**
   * The 'dataerror' event is notified whenever the data connection object
   * receives an error from the RIL
   */
  [implicit_jscontext] attribute jsval ondataerror;

  /**
   * The 'icccardlockerror' event is notified whenever 'unlockCardLock' or
   * 'setCardLock' fails.
   */
  [implicit_jscontext] attribute jsval onicccardlockerror;
};

[scriptable, uuid(5ea0e4a9-4684-40da-9930-8ebb61d187f3)]
interface nsIDOMMozMobileConnectionInfo : nsISupports
{
  /**
   * State of the connection.
   *
   * Possible values: 'notSearching', 'searching', 'denied', 'registered'.
   * null if the state is unknown.
   */
  readonly attribute DOMString state;

  /**
   * Indicates whether the connection is ready. This may be different 
   */
  readonly attribute bool connected;

  /**
   * Indicates whether only emergency calls are possible.
   *
   * This flag is only relevant to voice connections and when 'connected' is
   * false.
   */
  readonly attribute bool emergencyCallsOnly;

  /**
   * Indicates whether the connection is going through a foreign operator
   * (roaming) or not.
   */
  readonly attribute bool roaming;

  /**
   * Network operator
   */
  readonly attribute nsIDOMMozMobileNetworkInfo network;

  /**
   * Type of connection.
   *
   * Possible values: 'gsm', 'cdma', gprs', 'edge', 'umts', 'hsdpa', 'evdo0',
   * 'evdoa', 'evdob', etc.
   */
  readonly attribute DOMString type;

  /**
   * Signal strength in dBm, or null if no service is available.
   */
  readonly attribute jsval signalStrength;

  /**
   * Signal strength, represented linearly as a number between 0 (weakest
   * signal) and 100 (full signal).
   */
  readonly attribute jsval relSignalStrength;

  /**
   * Cell location.
   */
  readonly attribute nsIDOMMozMobileCellInfo cell;

};

[scriptable, uuid(3bd866c7-98a5-4ef4-a464-c22d8cc6b992)]
interface nsIDOMMozMobileNetworkInfo: nsISupports
{
  /**
   * Short name of the network operator
   */
  readonly attribute DOMString shortName;

  /**
   * Long name of the network operator
   */
  readonly attribute DOMString longName;

  /**
   * Mobile Country Code (MCC) of the network operator
   */
  readonly attribute unsigned short mcc;

  /**
   * Mobile Network Code (MNC) of the network operator
   */
  readonly attribute unsigned short mnc;

  /**
   * State of this network operator.
   *
   * Possible values: 'available', 'connected', 'forbidden', or null (unknown)
   */
  readonly attribute DOMString state;
};

[scriptable, uuid(aa546788-4f34-488b-8c3e-2786e02ab992)]
interface nsIDOMMozMobileCellInfo: nsISupports
{
  /**
   * Mobile Location Area Code (LAC) for GSM/WCDMA networks.
   */
  readonly attribute unsigned short gsmLocationAreaCode;

  /**
   * Mobile Cell ID for GSM/WCDMA networks.
   */
  readonly attribute unsigned long gsmCellId;
};

[scriptable, uuid(a71c66ed-dfb0-4c33-9942-049e6f03dbed)]
interface nsIDOMMozMobileICCInfo : nsISupports
{
   /**
   * Integrated Circuit Card Identifier.
   */
  readonly attribute DOMString iccid;

  /**
   * Mobile Country Code (MCC) of the subscriber's home network.
   */
  readonly attribute unsigned short mcc;

  /**
   * Mobile Network Code (MNC) of the subscriber's home network.
   */
  readonly attribute unsigned short mnc;

  /**
   * Service Provider Name (SPN) of the subscriber's home network.
   */
  readonly attribute DOMString spn;

  /**
   * Mobile Station ISDN Number (MSISDN) of the subscriber's, aka
   * his phone number.
   */
  readonly attribute DOMString msisdn;
};

[scriptable, uuid(2e40982a-ddf6-4d92-a3e8-4d69ce5a3a2e)]
interface nsIDOMMozMobileCFInfo : nsISupports
{
  /**
   * Call forwarding rule status.
   *
   * It will be either not active (false), or active (true).
   *
   * Note: Unused for setting call forwarding options. It reports
   *       the status of the rule when getting how the rule is
   *       configured.
   *
   * @see 3GPP TS 27.007 7.11 "status".
   */
  readonly attribute bool active;

  const long CALL_FORWARD_ACTION_DISABLE = 0;
  const long CALL_FORWARD_ACTION_ENABLE = 1;
  const long CALL_FORWARD_ACTION_QUERY_STATUS = 2;
  const long CALL_FORWARD_ACTION_REGISTRATION = 3;
  const long CALL_FORWARD_ACTION_ERASURE = 4;

  /**
   * Indicates what to do with the rule.
   *
   * One of the CALL_FORWARD_ACTION_* constants. It will be either disable (0),
   * enable (1), query status (2), registration (3), or erasure (4).
   *
   * @see 3GPP TS 27.007 7.11 "mode".
   */
  readonly attribute unsigned short action;

  const long CALL_FORWARD_REASON_UNCONDITIONAL = 0;
  const long CALL_FORWARD_REASON_MOBILE_BUSY = 1;
  const long CALL_FORWARD_REASON_NO_REPLY = 2;
  const long CALL_FORWARD_REASON_NOT_REACHABLE = 3;
  const long CALL_FORWARD_REASON_ALL_CALL_FORWARDING = 4;
  const long CALL_FORWARD_REASON_ALL_CONDITIONAL_CALL_FORWARDING = 5;

  /**
   * Indicates the reason the call is being forwarded.
   *
   * One of the CALL_FORWARD_REASON_* constants. It will be either
   * unconditional (0), mobile busy (1), no reply (2), not reachable (3),
   * all call forwarding (4), or all conditional call forwarding (5).
   *
   * @see 3GPP TS 27.007 7.11 "reason".
   */
  readonly attribute unsigned short reason;

  /**
   * Phone number of forwarding address.
   */
  readonly attribute DOMString number;

  /**
   * When "no reply" is enabled or queried, this gives the time in
   * seconds to wait before call is forwarded.
   */
  readonly attribute unsigned short timeSeconds;
};