michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * interface for container for information saved in session history when michael@0: * the document is not michael@0: */ michael@0: michael@0: #ifndef _nsILayoutHistoryState_h michael@0: #define _nsILayoutHistoryState_h michael@0: michael@0: #include "nsISupports.h" michael@0: #include "nsStringFwd.h" michael@0: michael@0: class nsPresState; michael@0: template class already_AddRefed; michael@0: michael@0: #define NS_ILAYOUTHISTORYSTATE_IID \ michael@0: { 0x5208993e, 0xd812, 0x431e, \ michael@0: { 0x95, 0x9c, 0xc3, 0x84, 0x5b, 0x6e, 0x5a, 0xce } } michael@0: michael@0: class nsILayoutHistoryState : public nsISupports { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILAYOUTHISTORYSTATE_IID) michael@0: michael@0: /** michael@0: * Set |aState| as the state object for |aKey|. michael@0: * This _transfers_ownership_ of |aState| to the LayoutHistoryState. michael@0: * It will be freed when RemoveState() is called or when the michael@0: * LayoutHistoryState is destroyed. michael@0: */ michael@0: virtual void AddState(const nsCString& aKey, nsPresState* aState) = 0; michael@0: michael@0: /** michael@0: * Look up the state object for |aKey|. michael@0: */ michael@0: virtual nsPresState* GetState(const nsCString& aKey) = 0; michael@0: michael@0: /** michael@0: * Remove the state object for |aKey|. michael@0: */ michael@0: virtual void RemoveState(const nsCString& aKey) = 0; michael@0: michael@0: /** michael@0: * Check whether this history has any states in it michael@0: */ michael@0: virtual bool HasStates() const = 0; michael@0: michael@0: /** michael@0: * Sets whether this history can contain only scroll position history michael@0: * or all possible history michael@0: */ michael@0: virtual void SetScrollPositionOnly(const bool aFlag) = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsILayoutHistoryState, michael@0: NS_ILAYOUTHISTORYSTATE_IID) michael@0: michael@0: already_AddRefed michael@0: NS_NewLayoutHistoryState(); michael@0: michael@0: #endif /* _nsILayoutHistoryState_h */ michael@0: