nsIStatefulFrame.h (1231B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 /* 8 * interface for rendering objects whose state is saved in 9 * session-history (back-forward navigation) 10 */ 11 12 #ifndef _nsIStatefulFrame_h 13 #define _nsIStatefulFrame_h 14 15 #include "nsContentUtils.h" 16 #include "nsQueryFrame.h" 17 18 namespace mozilla { 19 class PresState; 20 } // namespace mozilla 21 22 class nsIStatefulFrame { 23 public: 24 NS_DECL_QUERYFRAME_TARGET(nsIStatefulFrame) 25 26 // Save the state for this frame. 27 virtual mozilla::UniquePtr<mozilla::PresState> SaveState() = 0; 28 29 // Restore the state for this frame from aState 30 NS_IMETHOD RestoreState(mozilla::PresState* aState) = 0; 31 32 // Generate a key for this stateful frame 33 virtual void GenerateStateKey(nsIContent* aContent, 34 mozilla::dom::Document* aDocument, 35 nsACString& aKey) { 36 nsContentUtils::GenerateStateKey(aContent, aDocument, aKey); 37 }; 38 }; 39 40 #endif /* _nsIStatefulFrame_h */