layout/base/nsILayoutHistoryState.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /*
michael@0 7 * interface for container for information saved in session history when
michael@0 8 * the document is not
michael@0 9 */
michael@0 10
michael@0 11 #ifndef _nsILayoutHistoryState_h
michael@0 12 #define _nsILayoutHistoryState_h
michael@0 13
michael@0 14 #include "nsISupports.h"
michael@0 15 #include "nsStringFwd.h"
michael@0 16
michael@0 17 class nsPresState;
michael@0 18 template<typename> class already_AddRefed;
michael@0 19
michael@0 20 #define NS_ILAYOUTHISTORYSTATE_IID \
michael@0 21 { 0x5208993e, 0xd812, 0x431e, \
michael@0 22 { 0x95, 0x9c, 0xc3, 0x84, 0x5b, 0x6e, 0x5a, 0xce } }
michael@0 23
michael@0 24 class nsILayoutHistoryState : public nsISupports {
michael@0 25 public:
michael@0 26 NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILAYOUTHISTORYSTATE_IID)
michael@0 27
michael@0 28 /**
michael@0 29 * Set |aState| as the state object for |aKey|.
michael@0 30 * This _transfers_ownership_ of |aState| to the LayoutHistoryState.
michael@0 31 * It will be freed when RemoveState() is called or when the
michael@0 32 * LayoutHistoryState is destroyed.
michael@0 33 */
michael@0 34 virtual void AddState(const nsCString& aKey, nsPresState* aState) = 0;
michael@0 35
michael@0 36 /**
michael@0 37 * Look up the state object for |aKey|.
michael@0 38 */
michael@0 39 virtual nsPresState* GetState(const nsCString& aKey) = 0;
michael@0 40
michael@0 41 /**
michael@0 42 * Remove the state object for |aKey|.
michael@0 43 */
michael@0 44 virtual void RemoveState(const nsCString& aKey) = 0;
michael@0 45
michael@0 46 /**
michael@0 47 * Check whether this history has any states in it
michael@0 48 */
michael@0 49 virtual bool HasStates() const = 0;
michael@0 50
michael@0 51 /**
michael@0 52 * Sets whether this history can contain only scroll position history
michael@0 53 * or all possible history
michael@0 54 */
michael@0 55 virtual void SetScrollPositionOnly(const bool aFlag) = 0;
michael@0 56 };
michael@0 57
michael@0 58 NS_DEFINE_STATIC_IID_ACCESSOR(nsILayoutHistoryState,
michael@0 59 NS_ILAYOUTHISTORYSTATE_IID)
michael@0 60
michael@0 61 already_AddRefed<nsILayoutHistoryState>
michael@0 62 NS_NewLayoutHistoryState();
michael@0 63
michael@0 64 #endif /* _nsILayoutHistoryState_h */
michael@0 65

mercurial