2010-06-23 23:46:08 +04: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 15:12:37 +04: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 23:46:08 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2010-06-28 22:51:06 +04:00
|
|
|
interface nsIIDBIndex;
|
2010-06-28 22:51:06 +04:00
|
|
|
interface nsIIDBKeyRange;
|
|
|
|
interface nsIIDBRequest;
|
2010-12-10 05:14:09 +03:00
|
|
|
interface nsIIDBTransaction;
|
2010-06-23 23:46:08 +04:00
|
|
|
interface nsIDOMDOMStringList;
|
|
|
|
|
2012-03-13 08:44:48 +04:00
|
|
|
dictionary IDBIndexParameters
|
2011-12-27 22:01:28 +04:00
|
|
|
{
|
2012-03-13 08:44:48 +04:00
|
|
|
boolean unique;
|
|
|
|
boolean multiEntry;
|
2011-12-27 22:01:28 +04:00
|
|
|
};
|
|
|
|
|
2010-06-23 23:46:08 +04:00
|
|
|
/**
|
2010-06-28 22:51:06 +04:00
|
|
|
* nsIIDBObjectStore interface. See
|
|
|
|
* http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-nsIIDBObjectStore
|
|
|
|
* for more information.
|
2010-06-23 23:46:08 +04:00
|
|
|
*/
|
2012-06-29 20:48:34 +04:00
|
|
|
[scriptable, builtinclass, uuid(dd189afd-e1b7-4496-bf8d-629c58709595)]
|
2010-06-23 23:46:08 +04:00
|
|
|
interface nsIIDBObjectStore : nsISupports
|
|
|
|
{
|
|
|
|
readonly attribute DOMString name;
|
|
|
|
|
2011-12-20 14:59:07 +04:00
|
|
|
[implicit_jscontext]
|
|
|
|
readonly attribute jsval keyPath;
|
2010-06-23 23:46:08 +04:00
|
|
|
|
|
|
|
readonly attribute nsIDOMDOMStringList indexNames;
|
2010-06-28 22:51:06 +04:00
|
|
|
|
2010-12-10 05:14:09 +03:00
|
|
|
readonly attribute nsIIDBTransaction transaction;
|
|
|
|
|
2011-12-17 04:40:47 +04:00
|
|
|
readonly attribute boolean autoIncrement;
|
|
|
|
|
2010-06-28 22:51:06 +04:00
|
|
|
// Success fires IDBTransactionEvent, result == value for key
|
2011-11-03 19:57:30 +04:00
|
|
|
[implicit_jscontext]
|
2010-06-28 22:51:06 +04:00
|
|
|
nsIIDBRequest
|
2011-11-03 19:57:30 +04:00
|
|
|
get(in jsval key);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == array of values for given keys
|
2012-06-29 20:48:35 +04:00
|
|
|
[implicit_jscontext, optional_argc, binaryname(GetAll)]
|
2010-06-28 22:51:06 +04:00
|
|
|
nsIIDBRequest
|
2012-06-29 20:48:35 +04:00
|
|
|
mozGetAll([optional /* null */] in jsval key,
|
|
|
|
[optional /* unlimited */] in unsigned long limit);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == key
|
2010-06-29 02:22:41 +04:00
|
|
|
[implicit_jscontext, optional_argc]
|
2010-06-28 22:51:06 +04:00
|
|
|
nsIIDBRequest
|
2010-06-29 02:22:41 +04:00
|
|
|
add(in jsval value,
|
|
|
|
[optional /* undefined */] in jsval key);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == key
|
2010-06-29 02:22:41 +04:00
|
|
|
[implicit_jscontext, optional_argc]
|
2010-06-28 22:51:06 +04:00
|
|
|
nsIIDBRequest
|
2010-08-27 00:57:28 +04:00
|
|
|
put(in jsval value,
|
|
|
|
[optional /* undefined */] in jsval key);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
|
|
|
// Success fires IDBTransactionEvent, result == null
|
2010-12-16 00:21:11 +03:00
|
|
|
[implicit_jscontext]
|
2010-06-28 22:51:06 +04:00
|
|
|
nsIIDBRequest
|
2010-12-16 00:21:11 +03:00
|
|
|
delete(in jsval key);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
2010-08-27 00:57:30 +04:00
|
|
|
// Success fires IDBTransactionEvent, result == null
|
2012-06-29 20:48:34 +04:00
|
|
|
[implicit_jscontext]
|
2010-08-27 00:57:30 +04:00
|
|
|
nsIIDBRequest
|
|
|
|
clear();
|
|
|
|
|
2010-11-11 02:25:53 +03:00
|
|
|
// Success fires IDBTransactionEvent, result == IDBCursor or result == null if
|
|
|
|
// no match.
|
2012-03-13 08:44:45 +04:00
|
|
|
// direction can be "next", "nextunique", "prev" or "prevunique"
|
2011-11-03 19:57:30 +04:00
|
|
|
[implicit_jscontext, optional_argc]
|
2010-06-28 22:51:06 +04:00
|
|
|
nsIIDBRequest
|
2011-11-03 19:57:30 +04:00
|
|
|
openCursor([optional /* null */] in jsval range,
|
2012-03-13 08:44:45 +04:00
|
|
|
[optional /* "next" */] in DOMString direction);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
2010-12-21 19:02:01 +03:00
|
|
|
[implicit_jscontext]
|
2010-10-19 21:58:52 +04:00
|
|
|
nsIIDBIndex
|
2011-11-08 03:37:16 +04:00
|
|
|
createIndex([Null(Stringify)] in DOMString name,
|
2011-12-20 14:59:07 +04:00
|
|
|
in jsval keyPath,
|
2011-12-27 22:01:28 +04:00
|
|
|
/* nsIIDBIndexParameters */
|
2010-12-21 19:02:01 +03:00
|
|
|
[optional /* none */] in jsval options);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
|
|
|
// Returns object immediately
|
2010-06-28 22:51:06 +04:00
|
|
|
nsIIDBIndex
|
2011-11-08 03:37:16 +04:00
|
|
|
index([Null(Stringify)] in DOMString name);
|
2010-06-28 22:51:06 +04:00
|
|
|
|
2010-10-19 21:58:52 +04:00
|
|
|
void
|
2011-11-08 03:37:16 +04:00
|
|
|
deleteIndex([Null(Stringify)] in DOMString name);
|
2011-11-03 19:57:30 +04:00
|
|
|
|
|
|
|
// Accepts null, a key value, or a nsIIDBKeyRange object.
|
|
|
|
[implicit_jscontext, optional_argc]
|
|
|
|
nsIIDBRequest
|
|
|
|
count([optional] in jsval key);
|
2010-06-23 23:46:08 +04:00
|
|
|
};
|