2005-01-27 22:52:53 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2005-01-27 22:52:53 +00:00
|
|
|
|
2006-03-30 05:56:38 +00:00
|
|
|
/*
|
|
|
|
* interface for container for information saved in session history when
|
|
|
|
* the document is not
|
|
|
|
*/
|
|
|
|
|
1999-08-30 22:38:58 +00:00
|
|
|
#ifndef _nsILayoutHistoryState_h
|
|
|
|
#define _nsILayoutHistoryState_h
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
2005-01-27 22:52:53 +00:00
|
|
|
#include "nsStringFwd.h"
|
1999-08-30 22:38:58 +00:00
|
|
|
|
2005-01-27 22:52:53 +00:00
|
|
|
class nsPresState;
|
2013-07-24 07:38:13 +00:00
|
|
|
template<typename> class already_AddRefed;
|
1999-08-30 22:38:58 +00:00
|
|
|
|
|
|
|
#define NS_ILAYOUTHISTORYSTATE_IID \
|
2013-07-24 07:38:13 +00:00
|
|
|
{ 0x5208993e, 0xd812, 0x431e, \
|
|
|
|
{ 0x95, 0x9c, 0xc3, 0x84, 0x5b, 0x6e, 0x5a, 0xce } }
|
1999-08-30 22:38:58 +00:00
|
|
|
|
|
|
|
class nsILayoutHistoryState : public nsISupports {
|
|
|
|
public:
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILAYOUTHISTORYSTATE_IID)
|
1999-08-30 22:38:58 +00:00
|
|
|
|
2005-01-27 22:52:53 +00:00
|
|
|
/**
|
|
|
|
* Set |aState| as the state object for |aKey|.
|
|
|
|
* This _transfers_ownership_ of |aState| to the LayoutHistoryState.
|
|
|
|
* It will be freed when RemoveState() is called or when the
|
|
|
|
* LayoutHistoryState is destroyed.
|
|
|
|
*/
|
2013-07-24 07:38:13 +00:00
|
|
|
virtual void AddState(const nsCString& aKey, nsPresState* aState) = 0;
|
2005-01-27 22:52:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Look up the state object for |aKey|.
|
|
|
|
*/
|
2013-07-24 07:38:13 +00:00
|
|
|
virtual nsPresState* GetState(const nsCString& aKey) = 0;
|
2005-01-27 22:52:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the state object for |aKey|.
|
|
|
|
*/
|
2013-07-24 07:38:13 +00:00
|
|
|
virtual void RemoveState(const nsCString& aKey) = 0;
|
2007-07-21 03:00:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check whether this history has any states in it
|
|
|
|
*/
|
2013-07-24 07:38:13 +00:00
|
|
|
virtual bool HasStates() const = 0;
|
2008-12-03 17:55:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets whether this history can contain only scroll position history
|
|
|
|
* or all possible history
|
|
|
|
*/
|
2013-07-24 07:38:13 +00:00
|
|
|
virtual void SetScrollPositionOnly(const bool aFlag) = 0;
|
1999-08-30 22:38:58 +00:00
|
|
|
};
|
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsILayoutHistoryState,
|
|
|
|
NS_ILAYOUTHISTORYSTATE_IID)
|
|
|
|
|
2013-07-24 07:38:13 +00:00
|
|
|
already_AddRefed<nsILayoutHistoryState>
|
|
|
|
NS_NewLayoutHistoryState();
|
1999-08-30 22:38:58 +00:00
|
|
|
|
1999-09-01 00:53:21 +00:00
|
|
|
#endif /* _nsILayoutHistoryState_h */
|
|
|
|
|