browser/metro/components/SessionStore.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial