Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsColumnSetFrame.cpp File Reference
#include "nsHTMLContainerFrame.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsISupports.h"
#include "nsIAtom.h"
#include "nsPresContext.h"
#include "nsHTMLParts.h"
#include "nsLayoutAtoms.h"
#include "nsStyleConsts.h"
#include "nsCOMPtr.h"
#include "nsReflowPath.h"

Go to the source code of this file.

Classes

class  nsColumnSetFrame
struct  nsColumnSetFrame::ReflowConfig
 These are the parameters that control the layout of columns. More...

Functions

nsresult NS_NewColumnSetFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame, PRUint32 aStateFlags)
 Tracking issues:
static nscoord GetAvailableContentWidth (const nsHTMLReflowState &aReflowState)
static nscoord GetAvailableContentHeight (const nsHTMLReflowState &aReflowState)
static void PlaceFrameView (nsIFrame *aFrame)
static void MoveChildTo (nsIFrame *aParent, nsIFrame *aChild, nsPoint aOrigin)
static nscoord ComputeSumOfChildHeights (nsIFrame *aFrame)

Class Documentation

struct nsColumnSetFrame::ReflowConfig

These are the parameters that control the layout of columns.

Definition at line 98 of file nsColumnSetFrame.cpp.

Class Members
PRInt32 mBalanceColCount
nscoord mColGap
nscoord mColMaxHeight
nscoord mColWidth
nscoord mExpectedWidthLeftOver

Function Documentation

static nscoord ComputeSumOfChildHeights ( nsIFrame aFrame) [static]

Definition at line 639 of file nsColumnSetFrame.cpp.

                                                          {
  nscoord totalHeight = 0;
  for (nsIFrame* f = aFrame->GetFirstChild(nsnull); f; f = f->GetNextSibling()) {
    // individual columns don't have borders or padding so this is a
    // reasonable way to get their content height
    totalHeight += f->GetSize().height;
  }
  return totalHeight;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nscoord GetAvailableContentHeight ( const nsHTMLReflowState aReflowState) [static]

Definition at line 204 of file nsColumnSetFrame.cpp.

                                                                                {
  if (aReflowState.availableHeight == NS_INTRINSICSIZE) {
    return NS_INTRINSICSIZE;
  }
  nscoord borderPaddingHeight =
    aReflowState.mComputedBorderPadding.top +
    aReflowState.mComputedBorderPadding.bottom;
  return PR_MAX(0, aReflowState.availableHeight - borderPaddingHeight);
}

Here is the caller graph for this function:

static nscoord GetAvailableContentWidth ( const nsHTMLReflowState aReflowState) [static]

Definition at line 194 of file nsColumnSetFrame.cpp.

                                                                               {
  if (aReflowState.availableWidth == NS_INTRINSICSIZE) {
    return NS_INTRINSICSIZE;
  }
  nscoord borderPaddingWidth =
    aReflowState.mComputedBorderPadding.left +
    aReflowState.mComputedBorderPadding.right;
  return PR_MAX(0, aReflowState.availableWidth - borderPaddingWidth);
}

Here is the caller graph for this function:

static void MoveChildTo ( nsIFrame aParent,
nsIFrame aChild,
nsPoint  aOrigin 
) [static]

Definition at line 324 of file nsColumnSetFrame.cpp.

                                                                              {
  if (aChild->GetPosition() == aOrigin) {
    return;
  }
  
  nsRect* overflowArea = aChild->GetOverflowAreaProperty(PR_FALSE);
  nsRect r = overflowArea ? *overflowArea : nsRect(nsPoint(0, 0), aChild->GetSize());
  r += aChild->GetPosition();
  aParent->Invalidate(r);
  r -= aChild->GetPosition();
  aChild->SetPosition(aOrigin);
  r += aOrigin;
  aParent->Invalidate(r);
  PlaceFrameView(aChild);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewColumnSetFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame,
PRUint32  aStateFlags 
)

Tracking issues:

XXX cursor movement around the top and bottom of colums seems to make the editor lose the caret.

XXX should we support CSS columns applied to table elements?

Definition at line 144 of file nsColumnSetFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");

  nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame;
  if (!it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  // set the state flags (if any are provided)
  it->AddStateBits(aStateFlags);
  
  *aNewFrame = it;
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void PlaceFrameView ( nsIFrame aFrame) [static]

Definition at line 316 of file nsColumnSetFrame.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: