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