Bumping manifests a=b2g-bump
[gecko.git] / layout / base / nsPresState.h
blobab5f857f4e2e9016306eb19245430fe31f5f1626
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 * a piece of state that is stored in session history when the document
8 * is not
9 */
11 #ifndef nsPresState_h_
12 #define nsPresState_h_
14 #include "nsPoint.h"
15 #include "gfxPoint.h"
16 #include "nsAutoPtr.h"
18 class nsPresState
20 public:
21 nsPresState()
22 : mContentData(nullptr)
23 , mScrollState(0, 0)
24 , mResolution(1.0, 1.0)
25 , mDisabledSet(false)
26 , mDisabled(false)
29 void SetScrollState(const nsPoint& aState)
31 mScrollState = aState;
34 nsPoint GetScrollState() const
36 return mScrollState;
39 void SetResolution(const gfxSize& aSize)
41 mResolution = aSize;
44 gfxSize GetResolution() const
46 return mResolution;
49 void ClearNonScrollState()
51 mContentData = nullptr;
52 mDisabledSet = false;
55 bool GetDisabled() const
57 return mDisabled;
60 void SetDisabled(bool aDisabled)
62 mDisabled = aDisabled;
63 mDisabledSet = true;
66 bool IsDisabledSet() const
68 return mDisabledSet;
71 nsISupports* GetStateProperty() const
73 return mContentData;
76 void SetStateProperty(nsISupports *aProperty)
78 mContentData = aProperty;
81 // MEMBER VARIABLES
82 protected:
83 nsCOMPtr<nsISupports> mContentData;
84 nsPoint mScrollState;
85 gfxSize mResolution;
86 bool mDisabledSet;
87 bool mDisabled;
90 #endif /* nsPresState_h_ */