dom/indexedDB/nsIIDBIndex.idl
author Kyle Huey <khuey@kylehuey.com>
Fri, 29 Jun 2012 09:48:35 -0700
changeset 97937 8f307e676f320f0c9985bc44634c4349aa05351e
parent 94475 f4157e8c410708d76703f19e4dfb61859bfe32d8
child 140794 947b4570fae6827474da90120767c7ef3218dc68
permissions -rw-r--r--
Bug 726378: Unprefix IndexedDB. r=sicking

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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 nsIIDBObjectStore;
interface nsIIDBRequest;

/**
 * IDBIndex interface.  See
 * http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-IDBIndex for more
 * information.
 */
[scriptable, builtinclass, uuid(a859747a-0f05-4dfb-8f42-05c61415d4e4)]
interface nsIIDBIndex : nsISupports
{
  readonly attribute DOMString name;

  readonly attribute DOMString storeName;

  [implicit_jscontext]
  readonly attribute jsval keyPath;

  readonly attribute boolean unique;

  readonly attribute boolean multiEntry;

  readonly attribute nsIIDBObjectStore objectStore;

  [implicit_jscontext]
  nsIIDBRequest
  get(in jsval key);

  [implicit_jscontext]
  nsIIDBRequest
  getKey(in jsval key);

  [implicit_jscontext, optional_argc, binaryname(GetAll)]
  nsIIDBRequest
  mozGetAll([optional /* null */] in jsval key,
            [optional /* unlimited */] in unsigned long limit);

  [implicit_jscontext, optional_argc, binaryname(GetAllKeys)]
  nsIIDBRequest
  mozGetAllKeys([optional /* null */] in jsval key,
                [optional /* unlimited */] in unsigned long limit);

  // direction can be "next", "nextunique", "prev" or "prevunique"
  [implicit_jscontext, optional_argc]
  nsIIDBRequest
  openCursor([optional /* null */] in jsval key,
             [optional /* "next" */] in DOMString direction);

  // direction can be "next", "nextunique", "prev" or "prevunique"
  [implicit_jscontext, optional_argc]
  nsIIDBRequest
  openKeyCursor([optional /* null */] in jsval key,
                [optional /* "next" */] in DOMString direction);

  // Accepts null, a key value, or a nsIIDBKeyRange object.
  [implicit_jscontext, optional_argc]
  nsIIDBRequest
  count([optional] in jsval key);
};