nsIStatefulFrame.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. /*
  5. * interface for rendering objects whose state is saved in
  6. * session-history (back-forward navigation)
  7. */
  8. #ifndef _nsIStatefulFrame_h
  9. #define _nsIStatefulFrame_h
  10. #include "nsContentUtils.h"
  11. #include "nsQueryFrame.h"
  12. class nsPresState;
  13. class nsIStatefulFrame
  14. {
  15. public:
  16. NS_DECL_QUERYFRAME_TARGET(nsIStatefulFrame)
  17. // Save the state for this frame. If this method succeeds, the caller is
  18. // responsible for deleting the resulting state when done with it.
  19. NS_IMETHOD SaveState(nsPresState** aState) = 0;
  20. // Restore the state for this frame from aState
  21. NS_IMETHOD RestoreState(nsPresState* aState) = 0;
  22. // Generate a key for this stateful frame
  23. NS_IMETHOD GenerateStateKey(nsIContent* aContent,
  24. nsIDocument* aDocument,
  25. nsACString& aKey)
  26. {
  27. return nsContentUtils::GenerateStateKey(aContent, aDocument, aKey);
  28. };
  29. };
  30. #endif /* _nsIStatefulFrame_h */