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