Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsGridCell Class Reference

#include <nsGridCell.h>

List of all members.

Public Member Functions

 nsGridCell ()
virtual ~nsGridCell ()
nsresult GetPrefSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aPref)
nsresult GetMinSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aMin)
nsresult GetMaxSize (nsBoxLayoutState &aBoxLayoutState, nsSize &aMax)
nsresult IsCollapsed (nsBoxLayoutState &aBoxLayoutState, PRBool &aIsCollapsed)
nsIBox * GetBoxInColumn ()
nsIBox * GetBoxInRow ()
void SetBoxInRow (nsIBox *aBox)
void SetBoxInColumn (nsIBox *aBox)

Private Attributes

nsIBox * mBoxInColumn
nsIBox * mBoxInRow

Detailed Description

Definition at line 61 of file nsGridCell.h.


Constructor & Destructor Documentation

nsGridCell::~nsGridCell ( ) [virtual]

Definition at line 56 of file nsGridCell.cpp.


Member Function Documentation

nsIBox* nsGridCell::GetBoxInColumn ( ) [inline]

Definition at line 73 of file nsGridCell.h.

{ return mBoxInColumn; }
nsIBox* nsGridCell::GetBoxInRow ( ) [inline]

Definition at line 74 of file nsGridCell.h.

{ return mBoxInRow; }
nsresult nsGridCell::GetMaxSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aMax 
)

Definition at line 127 of file nsGridCell.cpp.

{
  aMax.width = NS_INTRINSICSIZE;
  aMax.height = NS_INTRINSICSIZE;

  // take ours 2 children and add them up.
  // we are as wide as the smallest child plus its left offset
  // we are tall as the shortest child plus its top offset

  nsSize max(NS_INTRINSICSIZE,NS_INTRINSICSIZE);

  if (mBoxInColumn) {
    mBoxInColumn->GetMaxSize(aState, max);      

 
    nsBox::AddMargin(mBoxInColumn, max);
    nsStackLayout::AddOffset(aState, mBoxInColumn, max);

    nsBoxLayout::AddSmallestSize(aMax, max);
  }

  if (mBoxInRow) {
    mBoxInRow->GetMaxSize(aState, max);

    nsBox::AddMargin(mBoxInRow, max);
    nsStackLayout::AddOffset(aState, mBoxInRow, max);

    nsBoxLayout::AddSmallestSize(aMax, max);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsGridCell::GetMinSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aMin 
)

Definition at line 94 of file nsGridCell.cpp.

{
  aMin.width = 0;
  aMin.height = 0;

  // take ours 2 children and add them up.
  // we are as wide as the widest child plus its left offset
  // we are tall as the tallest child plus its top offset

  nsSize min(0,0);

  if (mBoxInColumn) {
    mBoxInColumn->GetMinSize(aState, min);      

    nsBox::AddMargin(mBoxInColumn, min);
    nsStackLayout::AddOffset(aState, mBoxInColumn, min);

    nsBoxLayout::AddLargestSize(aMin, min);
  }

  if (mBoxInRow) {
    mBoxInRow->GetMinSize(aState, min);

    nsBox::AddMargin(mBoxInRow, min);
    nsStackLayout::AddOffset(aState, mBoxInRow, min);

    nsBoxLayout::AddLargestSize(aMin, min);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsGridCell::GetPrefSize ( nsBoxLayoutState aBoxLayoutState,
nsSize aPref 
)

Definition at line 62 of file nsGridCell.cpp.

{
  aPref.width = 0;
  aPref.height = 0;

  // take ours 2 children and add them up.
  // we are as wide as the widest child plus its left offset
  // we are tall as the tallest child plus its top offset

  nsSize pref(0,0);

  if (mBoxInColumn) {
    mBoxInColumn->GetPrefSize(aState, pref);      
    nsBox::AddMargin(mBoxInColumn, pref);
    nsStackLayout::AddOffset(aState, mBoxInColumn, pref);

    nsBoxLayout::AddLargestSize(aPref, pref);
  }

  if (mBoxInRow) {
    mBoxInRow->GetPrefSize(aState, pref);

    nsBox::AddMargin(mBoxInRow, pref);
    nsStackLayout::AddOffset(aState, mBoxInRow, pref);

    nsBoxLayout::AddLargestSize(aPref, pref);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsGridCell::IsCollapsed ( nsBoxLayoutState aBoxLayoutState,
PRBool aIsCollapsed 
)

Definition at line 162 of file nsGridCell.cpp.

{
  PRBool c1 = PR_FALSE, c2 = PR_FALSE;

  if (mBoxInColumn) 
    mBoxInColumn->IsCollapsed(aState, c1);

  if (mBoxInRow) 
    mBoxInRow->IsCollapsed(aState, c2);

  aIsCollapsed = (c1 || c2);

  return NS_OK;
}

Here is the caller graph for this function:

void nsGridCell::SetBoxInColumn ( nsIBox *  aBox) [inline]

Definition at line 76 of file nsGridCell.h.

{ mBoxInColumn = aBox; }

Here is the caller graph for this function:

void nsGridCell::SetBoxInRow ( nsIBox *  aBox) [inline]

Definition at line 75 of file nsGridCell.h.

{ mBoxInRow = aBox; }

Here is the caller graph for this function:


Member Data Documentation

nsIBox* nsGridCell::mBoxInColumn [private]

Definition at line 79 of file nsGridCell.h.

nsIBox* nsGridCell::mBoxInRow [private]

Definition at line 80 of file nsGridCell.h.


The documentation for this class was generated from the following files: