Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
nsFrameNavigator Class Reference

Eric D Vaughan This class lays out its children either vertically or horizontally. More...

#include <nsFrameNavigator.h>

List of all members.

Static Public Member Functions

static nsIBox * GetChildBeforeAfter (nsPresContext *aPresContext, nsIBox *start, PRBool before)
static nsIBox * GetChildAt (nsPresContext *aPresContext, nsIBox *parent, PRInt32 index)
static PRInt32 IndexOf (nsPresContext *aPresContext, nsIBox *parent, nsIBox *child)
static PRInt32 CountFrames (nsPresContext *aPresContext, nsIBox *aFrame)

Detailed Description

Eric D Vaughan This class lays out its children either vertically or horizontally.

Definition at line 52 of file nsFrameNavigator.h.


Member Function Documentation

PRInt32 nsFrameNavigator::CountFrames ( nsPresContext aPresContext,
nsIBox *  aFrame 
) [static]

Definition at line 98 of file nsFrameNavigator.cpp.

{
  PRInt32 count = 0;

  nsIBox* box;
  aBox->GetChildBox(&box); 
  while (nsnull != box) 
  {    
    nsresult rv = box->GetNextBox(&box);
    NS_ASSERTION(rv == NS_OK,"failed to get next child");
    count++;
  }

  return count;
}

Here is the caller graph for this function:

nsIBox * nsFrameNavigator::GetChildAt ( nsPresContext aPresContext,
nsIBox *  parent,
PRInt32  index 
) [static]

Definition at line 115 of file nsFrameNavigator.cpp.

{
  PRInt32 count = 0;

  nsIBox* box;
  parent->GetChildBox(&box); 
  while (nsnull != box) 
  {    
    if (count == index)
       return box;

    nsresult rv = box->GetNextBox(&box);
    NS_ASSERTION(rv == NS_OK,"failed to get next child");
    count++;
  }

  return nsnull;
}

Here is the caller graph for this function:

nsIBox * nsFrameNavigator::GetChildBeforeAfter ( nsPresContext aPresContext,
nsIBox *  start,
PRBool  before 
) [static]

Definition at line 51 of file nsFrameNavigator.cpp.

{
   nsIBox* parent = nsnull;
   start->GetParentBox(&parent);
   PRInt32 index = IndexOf(aPresContext, parent,start);
   PRInt32 count = CountFrames(aPresContext, parent);

   if (index == -1) 
     return nsnull;

   if (before) {
     if (index == 0) {
         return nsnull;
     }

     return GetChildAt(aPresContext, parent, index-1);
   }


   if (index == count-1)
       return nsnull;

   return GetChildAt(aPresContext, parent, index+1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 nsFrameNavigator::IndexOf ( nsPresContext aPresContext,
nsIBox *  parent,
nsIBox *  child 
) [static]

Definition at line 78 of file nsFrameNavigator.cpp.

{
  PRInt32 count = 0;

  nsIBox* box = nsnull;
  parent->GetChildBox(&box); 
  while (nsnull != box) 
  {    
    if (box == child)
       return count;

    nsresult rv = box->GetNextBox(&box);
    NS_ASSERTION(rv == NS_OK,"failed to get next child");
    count++;
  }

  return -1;
}

Here is the caller graph for this function:


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