summaryrefslogtreecommitdiff
path: root/docshell/shistory/nsIPartialSHistory.idl
blob: 99359794e765dbf72ed7df9f048c2a5b230ae8f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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 nsIFrameLoader;

/**
 * nsIPartialSHistory represents a part of nsIGroupedSHistory. It associates to
 * a "partial" nsISHistory in either local or remote process.
 */
[scriptable, builtinclass, uuid(5cd75e28-838c-4a0a-972e-6005f736ef7a)]
interface nsIPartialSHistory : nsISupports
{
  // The number of entries of its corresponding nsISHistory.
  [infallible] readonly attribute unsigned long count;

  // If it's part of a grouped session history, globalIndexOffset denotes the
  // number of entries ahead.
  [infallible] readonly attribute unsigned long globalIndexOffset;

  // The frameloader which owns this partial session history.
  readonly attribute nsIFrameLoader ownerFrameLoader;

  /**
   * Notify that it's been added to a grouped session history. It also implies
   * it's becoming the active partial history of the group.
   *
   * @param aOffset                The number of entries in preceding partial
   *                               session histories.
   */
  void onAttachGroupedSessionHistory(in unsigned long aOffset);

  /**
   * Notify that one or more entries in its associated nsISHistory object
   * have been changed (i.e. add / remove / replace). It's mainly used for
   * cross-process case, since in the in-process case we can just register an
   * nsISHistoryListener instead.
   *
   * @param aCount The number of entries in the associated session history.
   *               It can be the same as the old value if entries were replaced.
   */
  void onSessionHistoryChange(in unsigned long aCount);

  /**
   * Notify that the partial session history has been swapped in as the active
   * session history. Only an active session history can possibly add / remove /
   * replace its history entries.
   *
   * @param aGlobalLength      The up-to-date global length.
   * @param aTargetLocalIndex  The local index to navigate to.
   */
  void onActive(in unsigned long aGlobalLength, in unsigned long aTargetLocalIndex);

  /**
   * Notify that the partial session history has been swapped out and is no
   * longer active.
   */
  void onDeactive();
};