1999-04-16 05:39:34 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-04-16 05:39:34 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-04-16 05:39:34 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-04-16 05:39:34 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-04-16 05:39:34 +04:00
|
|
|
*/
|
|
|
|
#ifndef nsAbsoluteContainingBlock_h___
|
|
|
|
#define nsAbsoluteContainingBlock_h___
|
|
|
|
|
|
|
|
#include "nslayout.h"
|
|
|
|
#include "nsFrameList.h"
|
|
|
|
|
|
|
|
class nsIAtom;
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIPresContext;
|
|
|
|
|
|
|
|
/**
|
1999-07-24 06:37:45 +04:00
|
|
|
* This class contains the logic for being an absolute containing block.
|
1999-04-16 05:39:34 +04:00
|
|
|
*
|
|
|
|
* There is no principal child list, just a named child list which contains
|
|
|
|
* the absolutely positioned frames
|
|
|
|
*
|
1999-07-24 06:37:45 +04:00
|
|
|
* All functions include as the first argument the frame that is delegating
|
|
|
|
* the request
|
|
|
|
*
|
1999-04-16 05:39:34 +04:00
|
|
|
* @see nsLayoutAtoms::absoluteList
|
|
|
|
*/
|
|
|
|
class nsAbsoluteContainingBlock
|
|
|
|
{
|
|
|
|
public:
|
1999-07-24 06:37:45 +04:00
|
|
|
nsresult FirstChild(const nsIFrame* aDelegatingFrame,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame** aFirstChild) const;
|
1999-04-16 05:39:34 +04:00
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
nsresult SetInitialChildList(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
1999-04-16 05:39:34 +04:00
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aChildList);
|
1999-07-24 06:37:45 +04:00
|
|
|
nsresult AppendFrames(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
1999-07-24 06:37:45 +04:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aFrameList);
|
|
|
|
nsresult InsertFrames(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
1999-07-24 06:37:45 +04:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aPrevFrame,
|
|
|
|
nsIFrame* aFrameList);
|
|
|
|
nsresult RemoveFrame(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
1999-07-24 06:37:45 +04:00
|
|
|
nsIPresShell& aPresShell,
|
|
|
|
nsIAtom* aListName,
|
|
|
|
nsIFrame* aOldFrame);
|
1999-04-16 05:39:34 +04:00
|
|
|
|
|
|
|
// Called by the delegating frame after it has done its reflow first. This
|
|
|
|
// function will reflow any absolutely positioned child frames that need to
|
|
|
|
// be reflowed, e.g., because the absolutely positioned child frame has
|
|
|
|
// 'auto' for an offset, or a percentage based width or height
|
1999-07-24 06:37:45 +04:00
|
|
|
nsresult Reflow(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
1999-09-16 18:33:19 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nscoord aContainingBlockWidth,
|
|
|
|
nscoord aContainingBlockHeight);
|
1999-04-16 05:39:34 +04:00
|
|
|
|
|
|
|
// Called only for a reflow reason of eReflowReason_Incremental. The
|
|
|
|
// aWasHandled return value indicates whether the reflow command was
|
|
|
|
// handled (i.e., the reflow command involved an absolutely positioned
|
|
|
|
// child element), or whether the caller should handle it
|
1999-07-24 06:37:45 +04:00
|
|
|
nsresult IncrementalReflow(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
1999-04-16 05:39:34 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
1999-09-16 18:33:19 +04:00
|
|
|
nscoord aContainingBlockWidth,
|
|
|
|
nscoord aContainingBlockHeight,
|
1999-04-16 05:39:34 +04:00
|
|
|
PRBool& aWasHandled);
|
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
void DestroyFrames(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext);
|
1999-04-16 05:39:34 +04:00
|
|
|
|
1999-07-24 06:37:45 +04:00
|
|
|
nsresult GetPositionedInfo(const nsIFrame* aDelegatingFrame,
|
|
|
|
nscoord& aXMost,
|
|
|
|
nscoord& aYMost) const;
|
1999-04-16 05:39:34 +04:00
|
|
|
|
|
|
|
protected:
|
1999-07-24 06:37:45 +04:00
|
|
|
nsresult ReflowAbsoluteFrame(nsIFrame* aDelegatingFrame,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsIPresContext* aPresContext,
|
1999-04-16 05:39:34 +04:00
|
|
|
const nsHTMLReflowState& aReflowState,
|
1999-09-16 18:33:19 +04:00
|
|
|
nscoord aContainingBlockWidth,
|
|
|
|
nscoord aContainingBlockHeight,
|
1999-04-16 05:39:34 +04:00
|
|
|
nsIFrame* aKidFrame,
|
|
|
|
PRBool aInitialReflow,
|
|
|
|
nsReflowStatus& aStatus);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsFrameList mAbsoluteFrames; // additional named child list
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsnsAbsoluteContainingBlock_h___ */
|
|
|
|
|