2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* a piece of state that is stored in session history when the document
|
|
|
|
* is not
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsPresState_h_
|
|
|
|
#define nsPresState_h_
|
|
|
|
|
|
|
|
#include "nsPoint.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsRect.h"
|
|
|
|
|
|
|
|
class nsPresState
|
|
|
|
{
|
|
|
|
public:
|
2008-12-12 11:25:22 -08:00
|
|
|
nsPresState()
|
2012-07-30 07:20:58 -07:00
|
|
|
: mContentData(nullptr)
|
2010-01-11 13:45:18 -08:00
|
|
|
, mScrollState(0, 0)
|
2011-10-17 07:59:28 -07:00
|
|
|
, mDisabledSet(false)
|
|
|
|
, mDisabled(false)
|
2008-12-12 11:25:22 -08:00
|
|
|
{}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-01-11 13:45:18 -08:00
|
|
|
void SetScrollState(const nsPoint& aState)
|
|
|
|
{
|
|
|
|
mScrollState = aState;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-01-11 13:45:18 -08:00
|
|
|
nsPoint GetScrollState()
|
|
|
|
{
|
|
|
|
return mScrollState;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-01-11 13:45:18 -08:00
|
|
|
void ClearNonScrollState()
|
|
|
|
{
|
2012-07-30 07:20:58 -07:00
|
|
|
mContentData = nullptr;
|
2011-10-17 07:59:28 -07:00
|
|
|
mDisabledSet = false;
|
2010-01-11 13:45:18 -08:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool GetDisabled()
|
2008-12-12 11:25:22 -08:00
|
|
|
{
|
|
|
|
return mDisabled;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
void SetDisabled(bool aDisabled)
|
2008-12-12 11:25:22 -08:00
|
|
|
{
|
|
|
|
mDisabled = aDisabled;
|
2011-10-17 07:59:28 -07:00
|
|
|
mDisabledSet = true;
|
2008-12-12 11:25:22 -08:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsDisabledSet()
|
2008-12-12 11:25:22 -08:00
|
|
|
{
|
|
|
|
return mDisabledSet;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-12-12 11:25:22 -08:00
|
|
|
nsISupports* GetStateProperty()
|
|
|
|
{
|
|
|
|
return mContentData;
|
|
|
|
}
|
2008-12-03 09:55:14 -08:00
|
|
|
|
2008-12-12 11:25:22 -08:00
|
|
|
void SetStateProperty(nsISupports *aProperty)
|
|
|
|
{
|
|
|
|
mContentData = aProperty;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// MEMBER VARIABLES
|
|
|
|
protected:
|
2008-12-12 11:25:22 -08:00
|
|
|
nsCOMPtr<nsISupports> mContentData;
|
2010-01-11 13:45:18 -08:00
|
|
|
nsPoint mScrollState;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mDisabledSet;
|
|
|
|
bool mDisabled;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsPresState_h_ */
|