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: * a piece of state that is stored in session history when the document michael@0: * is not michael@0: */ michael@0: michael@0: #ifndef nsPresState_h_ michael@0: #define nsPresState_h_ michael@0: michael@0: #include "nsPoint.h" michael@0: #include "gfxPoint.h" michael@0: #include "nsAutoPtr.h" michael@0: michael@0: class nsPresState michael@0: { michael@0: public: michael@0: nsPresState() michael@0: : mContentData(nullptr) michael@0: , mScrollState(0, 0) michael@0: , mResolution(1.0, 1.0) michael@0: , mDisabledSet(false) michael@0: , mDisabled(false) michael@0: {} michael@0: michael@0: void SetScrollState(const nsPoint& aState) michael@0: { michael@0: mScrollState = aState; michael@0: } michael@0: michael@0: nsPoint GetScrollState() const michael@0: { michael@0: return mScrollState; michael@0: } michael@0: michael@0: void SetResolution(const gfxSize& aSize) michael@0: { michael@0: mResolution = aSize; michael@0: } michael@0: michael@0: gfxSize GetResolution() const michael@0: { michael@0: return mResolution; michael@0: } michael@0: michael@0: void ClearNonScrollState() michael@0: { michael@0: mContentData = nullptr; michael@0: mDisabledSet = false; michael@0: } michael@0: michael@0: bool GetDisabled() const michael@0: { michael@0: return mDisabled; michael@0: } michael@0: michael@0: void SetDisabled(bool aDisabled) michael@0: { michael@0: mDisabled = aDisabled; michael@0: mDisabledSet = true; michael@0: } michael@0: michael@0: bool IsDisabledSet() const michael@0: { michael@0: return mDisabledSet; michael@0: } michael@0: michael@0: nsISupports* GetStateProperty() const michael@0: { michael@0: return mContentData; michael@0: } michael@0: michael@0: void SetStateProperty(nsISupports *aProperty) michael@0: { michael@0: mContentData = aProperty; michael@0: } michael@0: michael@0: // MEMBER VARIABLES michael@0: protected: michael@0: nsCOMPtr mContentData; michael@0: nsPoint mScrollState; michael@0: gfxSize mResolution; michael@0: bool mDisabledSet; michael@0: bool mDisabled; michael@0: }; michael@0: michael@0: #endif /* nsPresState_h_ */