gecko-dev/docshell/shistory/nsIPartialSHistory.idl

81 строка
3.1 KiB
Plaintext

/* -*- 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 nsIGroupedSHistory;
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;
// The current global index of the active shentry in this partialSHistory.
[infallible] readonly attribute long globalIndex;
// 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;
// The groupedSHistory which this partialSHistory is a part of, or null.
readonly attribute nsIGroupedSHistory groupedSHistory;
// The current state of the nsIPartialSHistory, whether it is active,
// inactive, or currently prerendering.
const long STATE_INACTIVE = 0;
const long STATE_ACTIVE = 1;
const long STATE_PRERENDER = 2;
[infallible] attribute long activeState;
/**
* 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 aGroup The GroupedSHistory which this partialSHistory
* is joining.
*
* @param aOffset The number of entries in preceding partial
* session histories.
*/
void onAttachGroupedSHistory(in nsIGroupedSHistory aGroup, in unsigned long aOffset);
/**
* This method is used by the TabParent to notify the PartialSHistory
* that the state of its corresponding nsISHistory in the content process
* has been updated. It is unused in the in-process case.
*
* @param aCount The number of entries in the associated session history.
* @param aLocalIndex The local index of the currently active entry in the
* associated session history
*/
void handleSHistoryUpdate(in unsigned long aCount, in unsigned long aLocalIndex, in boolean aTruncate);
/**
* 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();
};