2010-06-23 19:46:08 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2010-06-23 19:46:08 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2010-06-28 18:51:06 +00:00
|
|
|
interface nsIIDBIndex;
|
2010-06-28 18:51:06 +00:00
|
|
|
interface nsIIDBKeyRange;
|
|
|
|
interface nsIIDBRequest;
|
2010-12-10 02:14:09 +00:00
|
|
|
interface nsIIDBTransaction;
|
2010-06-23 19:46:08 +00:00
|
|
|
interface nsIDOMDOMStringList;
|
|
|
|
|
2012-03-13 04:44:48 +00:00
|
|
|
dictionary IDBIndexParameters
|
2011-12-27 18:01:28 +00:00
|
|
|
{
|
2012-03-13 04:44:48 +00:00
|
|
|
boolean unique;
|
|
|
|
boolean multiEntry;
|
2011-12-27 18:01:28 +00:00
|
|
|
};
|
|
|
|
|
2010-06-23 19:46:08 +00:00
|
|
|
/**
|
2010-06-28 18:51:06 +00:00
|
|
|
* nsIIDBObjectStore interface. See
|
|
|
|
* http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-nsIIDBObjectStore
|
|
|
|
* for more information.
|
2010-06-23 19:46:08 +00:00
|
|
|
*/
|
2012-03-13 04:44:45 +00:00
|
|
|
[scriptable, builtinclass, uuid(43157a3c-bed1-4ce7-98c0-11365b852560)]
|
2010-06-23 19:46:08 +00:00
|
|
|
interface nsIIDBObjectStore : nsISupports
|
|
|
|
{
|
|
|
|
readonly attribute DOMString name;
|
|
|
|
|
2011-12-20 10:59:07 +00:00
|
|
|
[implicit_jscontext]
|
|
|
|
readonly attribute jsval keyPath;
|
2010-06-23 19:46:08 +00:00
|
|
|
|
|
|
|
readonly attribute nsIDOMDOMStringList indexNames;
|
2010-06-28 18:51:06 +00:00
|
|
|
|
2010-12-10 02:14:09 +00:00
|
|
|
readonly attribute nsIIDBTransaction transaction;
|
|
|
|
|
2011-12-17 00:40:47 +00:00
|
|
|
readonly attribute boolean autoIncrement;
|
|
|
|
|
2010-06-28 18:51:06 +00:00
|
|
|
// Success fires IDBTransactionEvent, result == value for key
|
2011-11-03 15:57:30 +00:00
|
|
|
[implicit_jscontext]
|
2010-06-28 18:51:06 +00:00
|
|
|
nsIIDBRequest
|
2011-11-03 15:57:30 +00:00
|
|
|
get(in jsval key);
|
2010-06-28 18:51:06 +00:00
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == array of values for given keys
|
2011-11-03 15:57:30 +00:00
|
|
|
[implicit_jscontext, optional_argc]
|
2010-06-28 18:51:06 +00:00
|
|
|
nsIIDBRequest
|
2011-11-03 15:57:30 +00:00
|
|
|
getAll([optional /* null */] in jsval key,
|
2010-06-28 18:51:06 +00:00
|
|
|
[optional /* unlimited */] in unsigned long limit);
|
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == key
|
2010-06-28 22:22:41 +00:00
|
|
|
[implicit_jscontext, optional_argc]
|
2010-06-28 18:51:06 +00:00
|
|
|
nsIIDBRequest
|
2010-06-28 22:22:41 +00:00
|
|
|
add(in jsval value,
|
|
|
|
[optional /* undefined */] in jsval key);
|
2010-06-28 18:51:06 +00:00
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == key
|
2010-06-28 22:22:41 +00:00
|
|
|
[implicit_jscontext, optional_argc]
|
2010-06-28 18:51:06 +00:00
|
|
|
nsIIDBRequest
|
2010-08-26 20:57:28 +00:00
|
|
|
put(in jsval value,
|
|
|
|
[optional /* undefined */] in jsval key);
|
2010-06-28 18:51:06 +00:00
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == null
|
2010-12-15 21:21:11 +00:00
|
|
|
[implicit_jscontext]
|
2010-06-28 18:51:06 +00:00
|
|
|
nsIIDBRequest
|
2010-12-15 21:21:11 +00:00
|
|
|
delete(in jsval key);
|
2010-06-28 18:51:06 +00:00
|
|
|
|
2010-08-26 20:57:30 +00:00
|
|
|
// Success fires IDBTransactionEvent, result == null
|
|
|
|
nsIIDBRequest
|
|
|
|
clear();
|
|
|
|
|
2010-11-10 23:25:53 +00:00
|
|
|
// Success fires IDBTransactionEvent, result == IDBCursor or result == null if
|
|
|
|
// no match.
|
2012-03-13 04:44:45 +00:00
|
|
|
// direction can be "next", "nextunique", "prev" or "prevunique"
|
2011-11-03 15:57:30 +00:00
|
|
|
[implicit_jscontext, optional_argc]
|
2010-06-28 18:51:06 +00:00
|
|
|
nsIIDBRequest
|
2011-11-03 15:57:30 +00:00
|
|
|
openCursor([optional /* null */] in jsval range,
|
2012-03-13 04:44:45 +00:00
|
|
|
[optional /* "next" */] in DOMString direction);
|
2010-06-28 18:51:06 +00:00
|
|
|
|
2010-12-21 16:02:01 +00:00
|
|
|
[implicit_jscontext]
|
2010-10-19 17:58:52 +00:00
|
|
|
nsIIDBIndex
|
2011-11-07 23:37:16 +00:00
|
|
|
createIndex([Null(Stringify)] in DOMString name,
|
2011-12-20 10:59:07 +00:00
|
|
|
in jsval keyPath,
|
2011-12-27 18:01:28 +00:00
|
|
|
/* nsIIDBIndexParameters */
|
2010-12-21 16:02:01 +00:00
|
|
|
[optional /* none */] in jsval options);
|
2010-06-28 18:51:06 +00:00
|
|
|
|
|
|
|
// Returns object immediately
|
2010-06-28 18:51:06 +00:00
|
|
|
nsIIDBIndex
|
2011-11-07 23:37:16 +00:00
|
|
|
index([Null(Stringify)] in DOMString name);
|
2010-06-28 18:51:06 +00:00
|
|
|
|
2010-10-19 17:58:52 +00:00
|
|
|
void
|
2011-11-07 23:37:16 +00:00
|
|
|
deleteIndex([Null(Stringify)] in DOMString name);
|
2011-11-03 15:57:30 +00:00
|
|
|
|
|
|
|
// Accepts null, a key value, or a nsIIDBKeyRange object.
|
|
|
|
[implicit_jscontext, optional_argc]
|
|
|
|
nsIIDBRequest
|
|
|
|
count([optional] in jsval key);
|
2010-06-23 19:46:08 +00:00
|
|
|
};
|