mobile/android/components/SessionStore.idl

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #include "nsISupports.idl"
michael@0 6
michael@0 7 interface nsIDOMWindow;
michael@0 8 interface nsIDOMNode;
michael@0 9
michael@0 10 /**
michael@0 11 * nsISessionStore keeps track of the current browsing state.
michael@0 12 *
michael@0 13 * The nsISessionStore API operates mostly on browser windows and the browser
michael@0 14 * tabs contained in them.
michael@0 15 */
michael@0 16
michael@0 17 [scriptable, uuid(fe116b56-0226-4562-b52a-a623dad07ead)]
michael@0 18 interface nsISessionStore : nsISupports
michael@0 19 {
michael@0 20 /**
michael@0 21 * Get the current browsing state.
michael@0 22 * @returns a JSON string representing the session state.
michael@0 23 */
michael@0 24 AString getBrowserState();
michael@0 25
michael@0 26 /**
michael@0 27 * Get the number of restore-able tabs for a browser window
michael@0 28 */
michael@0 29 unsigned long getClosedTabCount(in nsIDOMWindow aWindow);
michael@0 30
michael@0 31 /**
michael@0 32 * Get closed tab data
michael@0 33 *
michael@0 34 * @param aWindow is the browser window for which to get closed tab data
michael@0 35 * @returns a JSON string representing the list of closed tabs.
michael@0 36 */
michael@0 37 AString getClosedTabData(in nsIDOMWindow aWindow);
michael@0 38
michael@0 39 /**
michael@0 40 * @param aWindow is the browser window to reopen a closed tab in.
michael@0 41 * @param aIndex is the index of the tab to be restored (FIFO ordered).
michael@0 42 * @returns a reference to the reopened tab.
michael@0 43 */
michael@0 44 nsIDOMNode undoCloseTab(in nsIDOMWindow aWindow, in unsigned long aIndex);
michael@0 45
michael@0 46 /**
michael@0 47 * @param aWindow is the browser window associated with the closed tab.
michael@0 48 * @param aIndex is the index of the closed tab to be removed (FIFO ordered).
michael@0 49 */
michael@0 50 nsIDOMNode forgetClosedTab(in nsIDOMWindow aWindow, in unsigned long aIndex);
michael@0 51
michael@0 52 /**
michael@0 53 * @param aTab is the browser tab to get the value for.
michael@0 54 * @param aKey is the value's name.
michael@0 55 *
michael@0 56 * @returns A string value or an empty string if none is set.
michael@0 57 */
michael@0 58 AString getTabValue(in jsval aTab, in AString aKey);
michael@0 59
michael@0 60 /**
michael@0 61 * @param aTab is the browser tab to set the value for.
michael@0 62 * @param aKey is the value's name.
michael@0 63 * @param aStringValue is the value itself (use JSON.stringify/parse before setting JS objects).
michael@0 64 */
michael@0 65 void setTabValue(in jsval aTab, in AString aKey, in AString aStringValue);
michael@0 66
michael@0 67 /**
michael@0 68 * @param aTab is the browser tab to get the value for.
michael@0 69 * @param aKey is the value's name.
michael@0 70 */
michael@0 71 void deleteTabValue(in jsval aTab, in AString aKey);
michael@0 72
michael@0 73 /**
michael@0 74 * Restores the previous browser session using a fast, lightweight strategy
michael@0 75 * @param aSessionString The session string to restore from. If null, the
michael@0 76 * backup session file is read from.
michael@0 77 */
michael@0 78 void restoreLastSession(in AString aSessionString);
michael@0 79 };

mercurial