2005-01-28 23:01:46 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2005-01-28 23:01:46 +03:00
|
|
|
|
2006-03-30 09:56:38 +04:00
|
|
|
/*
|
|
|
|
* a piece of state that is stored in session history when the document
|
|
|
|
* is not
|
|
|
|
*/
|
|
|
|
|
2005-01-28 23:01:46 +03:00
|
|
|
#ifndef nsPresState_h_
|
|
|
|
#define nsPresState_h_
|
|
|
|
|
2006-11-06 19:08:20 +03:00
|
|
|
#include "prtypes.h"
|
|
|
|
#include "nsPoint.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsRect.h"
|
2005-01-28 23:01:46 +03:00
|
|
|
|
|
|
|
class nsPresState
|
|
|
|
{
|
|
|
|
public:
|
2008-12-12 22:25:22 +03:00
|
|
|
nsPresState()
|
|
|
|
: mContentData(nsnull)
|
2010-01-12 00:45:18 +03:00
|
|
|
, mScrollState(0, 0)
|
2011-10-17 18:59:28 +04:00
|
|
|
, mDisabledSet(false)
|
|
|
|
, mDisabled(false)
|
2008-12-12 22:25:22 +03:00
|
|
|
{}
|
2005-01-28 23:01:46 +03:00
|
|
|
|
2010-01-12 00:45:18 +03:00
|
|
|
void SetScrollState(const nsPoint& aState)
|
|
|
|
{
|
|
|
|
mScrollState = aState;
|
|
|
|
}
|
2005-01-28 23:01:46 +03:00
|
|
|
|
2010-01-12 00:45:18 +03:00
|
|
|
nsPoint GetScrollState()
|
|
|
|
{
|
|
|
|
return mScrollState;
|
|
|
|
}
|
2005-01-28 23:01:46 +03:00
|
|
|
|
2010-01-12 00:45:18 +03:00
|
|
|
void ClearNonScrollState()
|
|
|
|
{
|
|
|
|
mContentData = nsnull;
|
2011-10-17 18:59:28 +04:00
|
|
|
mDisabledSet = false;
|
2010-01-12 00:45:18 +03:00
|
|
|
}
|
2005-01-28 23:01:46 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetDisabled()
|
2008-12-12 22:25:22 +03:00
|
|
|
{
|
|
|
|
return mDisabled;
|
|
|
|
}
|
2005-01-28 23:01:46 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetDisabled(bool aDisabled)
|
2008-12-12 22:25:22 +03:00
|
|
|
{
|
|
|
|
mDisabled = aDisabled;
|
2011-10-17 18:59:28 +04:00
|
|
|
mDisabledSet = true;
|
2008-12-12 22:25:22 +03:00
|
|
|
}
|
2005-01-28 23:01:46 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsDisabledSet()
|
2008-12-12 22:25:22 +03:00
|
|
|
{
|
|
|
|
return mDisabledSet;
|
|
|
|
}
|
2006-11-06 19:08:20 +03:00
|
|
|
|
2008-12-12 22:25:22 +03:00
|
|
|
nsISupports* GetStateProperty()
|
|
|
|
{
|
|
|
|
return mContentData;
|
|
|
|
}
|
2008-12-03 20:55:14 +03:00
|
|
|
|
2008-12-12 22:25:22 +03:00
|
|
|
void SetStateProperty(nsISupports *aProperty)
|
|
|
|
{
|
|
|
|
mContentData = aProperty;
|
|
|
|
}
|
2006-11-06 19:08:20 +03:00
|
|
|
|
2005-01-28 23:01:46 +03:00
|
|
|
// MEMBER VARIABLES
|
|
|
|
protected:
|
2008-12-12 22:25:22 +03:00
|
|
|
nsCOMPtr<nsISupports> mContentData;
|
2010-01-12 00:45:18 +03:00
|
|
|
nsPoint mScrollState;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mDisabledSet;
|
|
|
|
bool mDisabled;
|
2005-01-28 23:01:46 +03:00
|
|
|
};
|
|
|
|
|
2006-11-06 19:08:20 +03:00
|
|
|
#endif /* nsPresState_h_ */
|