2002-01-25 02:07:03 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2002-01-25 02:07:03 +00:00
|
|
|
#ifndef nsPageContentFrame_h___
|
|
|
|
#define nsPageContentFrame_h___
|
|
|
|
|
2003-01-20 18:04:34 +00:00
|
|
|
#include "nsViewportFrame.h"
|
2002-01-25 02:07:03 +00:00
|
|
|
class nsPageFrame;
|
2002-09-19 21:45:07 +00:00
|
|
|
class nsSharedPageData;
|
2002-01-25 02:07:03 +00:00
|
|
|
|
|
|
|
// Page frame class used by the simple page sequence frame
|
2003-01-20 18:04:34 +00:00
|
|
|
class nsPageContentFrame : public ViewportFrame {
|
2002-01-25 02:07:03 +00:00
|
|
|
|
|
|
|
public:
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2006-03-26 21:30:36 +00:00
|
|
|
friend nsIFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2002-01-25 02:07:03 +00:00
|
|
|
friend class nsPageFrame;
|
|
|
|
|
|
|
|
// nsIFrame
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
2002-01-25 02:07:03 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aMaxSize,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool IsFrameOfType(PRUint32 aFlags) const
|
2010-04-12 18:36:58 +00:00
|
|
|
{
|
|
|
|
return ViewportFrame::IsFrameOfType(aFlags &
|
|
|
|
~(nsIFrame::eCanContainOverflowContainers));
|
|
|
|
}
|
2002-01-25 02:07:03 +00:00
|
|
|
|
2002-09-19 21:45:07 +00:00
|
|
|
virtual void SetSharedPageData(nsSharedPageData* aPD) { mPD = aPD; }
|
|
|
|
|
2008-02-09 02:54:55 +00:00
|
|
|
/**
|
|
|
|
* Computes page size based on shared page data; SetSharedPageData must be
|
|
|
|
* given valid data first.
|
|
|
|
*/
|
2011-04-08 01:04:40 +00:00
|
|
|
virtual nsSize ComputeSize(nsRenderingContext *aRenderingContext,
|
2008-02-09 02:54:55 +00:00
|
|
|
nsSize aCBSize, nscoord aAvailableWidth,
|
|
|
|
nsSize aMargin, nsSize aBorder, nsSize aPadding,
|
2012-03-16 18:01:05 +00:00
|
|
|
PRUint32 aFlags) MOZ_OVERRIDE;
|
2008-02-09 02:54:55 +00:00
|
|
|
|
2002-01-25 02:07:03 +00:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
2008-04-08 13:06:12 +00:00
|
|
|
* @see nsGkAtoms::pageContentFrame
|
2002-01-25 02:07:03 +00:00
|
|
|
*/
|
2003-10-31 20:19:18 +00:00
|
|
|
virtual nsIAtom* GetType() const;
|
2002-01-25 02:07:03 +00:00
|
|
|
|
|
|
|
#ifdef NS_DEBUG
|
|
|
|
// Debugging
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
|
|
|
#endif
|
|
|
|
|
2002-01-31 14:24:06 +00:00
|
|
|
protected:
|
2006-03-26 21:30:36 +00:00
|
|
|
nsPageContentFrame(nsStyleContext* aContext) : ViewportFrame(aContext) {}
|
2003-01-20 18:04:34 +00:00
|
|
|
|
|
|
|
nsSharedPageData* mPD;
|
2002-01-25 02:07:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsPageContentFrame_h___ */
|
|
|
|
|