layout/base/nsILayoutHistoryState.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/base/nsILayoutHistoryState.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,65 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/*
    1.10 + * interface for container for information saved in session history when
    1.11 + * the document is not
    1.12 + */
    1.13 +
    1.14 +#ifndef _nsILayoutHistoryState_h
    1.15 +#define _nsILayoutHistoryState_h
    1.16 +
    1.17 +#include "nsISupports.h"
    1.18 +#include "nsStringFwd.h"
    1.19 +
    1.20 +class nsPresState;
    1.21 +template<typename> class already_AddRefed;
    1.22 +
    1.23 +#define NS_ILAYOUTHISTORYSTATE_IID \
    1.24 +{ 0x5208993e, 0xd812, 0x431e, \
    1.25 +  { 0x95, 0x9c, 0xc3, 0x84, 0x5b, 0x6e, 0x5a, 0xce } }
    1.26 +
    1.27 +class nsILayoutHistoryState : public nsISupports {
    1.28 + public: 
    1.29 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILAYOUTHISTORYSTATE_IID)
    1.30 +
    1.31 +  /**
    1.32 +   * Set |aState| as the state object for |aKey|.
    1.33 +   * This _transfers_ownership_ of |aState| to the LayoutHistoryState.
    1.34 +   * It will be freed when RemoveState() is called or when the
    1.35 +   * LayoutHistoryState is destroyed.
    1.36 +   */
    1.37 +  virtual void AddState(const nsCString& aKey, nsPresState* aState) = 0;
    1.38 +
    1.39 +  /**
    1.40 +   * Look up the state object for |aKey|.
    1.41 +   */
    1.42 +  virtual nsPresState* GetState(const nsCString& aKey) = 0;
    1.43 +
    1.44 +  /**
    1.45 +   * Remove the state object for |aKey|.
    1.46 +   */
    1.47 +  virtual void RemoveState(const nsCString& aKey) = 0;
    1.48 +
    1.49 +  /**
    1.50 +   * Check whether this history has any states in it
    1.51 +   */
    1.52 +  virtual bool HasStates() const = 0;
    1.53 +
    1.54 +  /**
    1.55 +   * Sets whether this history can contain only scroll position history
    1.56 +   * or all possible history
    1.57 +   */
    1.58 +  virtual void SetScrollPositionOnly(const bool aFlag) = 0;
    1.59 +};
    1.60 +
    1.61 +NS_DEFINE_STATIC_IID_ACCESSOR(nsILayoutHistoryState,
    1.62 +                              NS_ILAYOUTHISTORYSTATE_IID)
    1.63 +
    1.64 +already_AddRefed<nsILayoutHistoryState>
    1.65 +NS_NewLayoutHistoryState();
    1.66 +
    1.67 +#endif /* _nsILayoutHistoryState_h */
    1.68 +

mercurial