Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
nsFocusIterator Class Reference
Inheritance diagram for nsFocusIterator:
Inheritance graph
[legend]
Collaboration diagram for nsFocusIterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsFocusIterator (nsPresContext *aPresContext, nsIFrame *aStart)
NS_DECL_ISUPPORTS NS_IMETHOD First ()
NS_IMETHOD CurrentItem (nsISupports **aItem)
NS_IMETHOD IsDone ()
void last ()
 Last will reset the list to the end.
void prev ()
 Prev will decrement the list.
void first ()
 First will reset the list.
void next ()
 Next will advance the list.
nsISupports currentItem ()
 CurrentItem will return the CurrentItem item it will fail if the list is empty.
void isDone ()
 return if the collection is at the end.

Protected Member Functions

void setCurrent (nsIFrame *aFrame)
nsIFramegetCurrent ()
void setStart (nsIFrame *aFrame)
nsIFramegetStart ()
nsIFramegetLast ()
void setLast (nsIFrame *aFrame)
PRInt8 getOffEdge ()
void setOffEdge (PRInt8 aOffEdge)

Private Member Functions

NS_IMETHOD Next ()
NS_IMETHOD Prev ()
NS_IMETHOD Last ()
nsIFrameGetParentFrame (nsIFrame *aFrame)
nsIFrameGetFirstChild (nsIFrame *aFrame)
nsIFrameGetNextSibling (nsIFrame *aFrame)
nsIFrameGetPrevSibling (nsIFrame *aFrame)
nsIFrameGetPlaceholderFrame (nsIFrame *aFrame)
PRBool IsPopupFrame (nsIFrame *aFrame)

Private Attributes

nsPresContextmPresContext

Detailed Description

Definition at line 112 of file nsFrameTraversal.cpp.


Constructor & Destructor Documentation

nsFocusIterator::nsFocusIterator ( nsPresContext aPresContext,
nsIFrame aStart 
)

Definition at line 478 of file nsFrameTraversal.cpp.

  : mPresContext(aPresContext)
{
  nsIFrame* start = aStart;
  if (aStart)
    start = nsPlaceholderFrame::GetRealFrameFor(aStart);

  setStart(start);
  setCurrent(start);
  setLast(start);
}

Here is the call graph for this function:


Member Function Documentation

NS_IMETHODIMP nsFrameIterator::CurrentItem ( nsISupports **  aItem) [inherited]

Definition at line 283 of file nsFrameTraversal.cpp.

{
  if (!aItem)
    return NS_ERROR_NULL_POINTER;
  *aItem = mCurrent;
  if (mOffEdge)
    return NS_ENUMERATOR_FALSE;
  return NS_OK;
}
nsISupports nsIEnumerator::currentItem ( ) [inherited]

CurrentItem will return the CurrentItem item it will fail if the list is empty.

Definition at line 306 of file nsFrameTraversal.cpp.

{
  mCurrent = mStart;
  return NS_OK;
}
void nsIEnumerator::first ( ) [inherited]

First will reset the list.

will return NS_FAILED if no items

nsIFrame* nsFrameIterator::getCurrent ( ) [inline, protected, inherited]

Definition at line 66 of file nsFrameTraversal.cpp.

{return mCurrent;}

Here is the caller graph for this function:

Definition at line 525 of file nsFrameTraversal.cpp.

{
  nsIFrame* result = aFrame->GetFirstChild(nsnull);
  if (result)
    result = nsPlaceholderFrame::GetRealFrameFor(result);

  if (result && IsPopupFrame(result))
    result = GetNextSibling(result);

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIFrame* nsFrameIterator::getLast ( ) [inline, protected, inherited]

Definition at line 69 of file nsFrameTraversal.cpp.

{return mLast;}

Here is the caller graph for this function:

Definition at line 538 of file nsFrameTraversal.cpp.

{
  nsIFrame* result = nsnull;
  nsIFrame* placeholder = GetPlaceholderFrame(aFrame);
  if (placeholder) {
    result = placeholder->GetNextSibling();
    if (result)
      result = nsPlaceholderFrame::GetRealFrameFor(result);
  }

  if (result && IsPopupFrame(result))
    result = GetNextSibling(result);

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt8 nsFrameIterator::getOffEdge ( ) [inline, protected, inherited]

Definition at line 71 of file nsFrameTraversal.cpp.

{return mOffEdge;}

Definition at line 515 of file nsFrameTraversal.cpp.

{
  nsIFrame* placeholder = GetPlaceholderFrame(aFrame);
  if (placeholder)
    return placeholder->GetParent();

  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 491 of file nsFrameTraversal.cpp.

{
  nsIFrame* result = aFrame;
  nsIPresShell *presShell = mPresContext->GetPresShell();
  if (presShell) {
    nsIFrame* placeholder = 0;
    presShell->GetPlaceholderFrameFor(aFrame, &placeholder);
    if (placeholder)
      result = placeholder;
  }

  if (result != aFrame)
    result = GetPlaceholderFrame(result);

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 555 of file nsFrameTraversal.cpp.

{
  nsIFrame* result = 0;
  nsIFrame* placeholder = GetPlaceholderFrame(aFrame);
  if (placeholder) {
    nsIFrame* parent = GetParentFrame(placeholder);
    if (parent) {
      nsFrameList list(parent->GetFirstChild(nsnull));
      result = list.GetPrevSiblingFor(placeholder);
      if (result)
        result = nsPlaceholderFrame::GetRealFrameFor(result);
    }
  }

  if (result && IsPopupFrame(result))
    result = GetPrevSibling(result);

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsIFrame* nsFrameIterator::getStart ( ) [inline, protected, inherited]

Definition at line 68 of file nsFrameTraversal.cpp.

{return mStart;}

Definition at line 296 of file nsFrameTraversal.cpp.

{
  if (mOffEdge != 0)
    return NS_OK;
  return NS_ENUMERATOR_FALSE;
}
void nsIEnumerator::isDone ( ) [inherited]

return if the collection is at the end.

that is the beginning following a call to Prev and it is the end of the list following a call to next

Definition at line 509 of file nsFrameTraversal.cpp.

{
  return (aFrame->GetStyleDisplay()->mDisplay == NS_STYLE_DISPLAY_POPUP);
}

Here is the caller graph for this function:

Last will reset the list to the end.

will return NS_FAILED if no items

Reimplemented from nsFrameIterator.

Definition at line 642 of file nsFrameTraversal.cpp.

{
  nsIFrame* result;
  nsIFrame* parent = getCurrent();
  while (!IsRootFrame(parent) && (result = GetParentFrame(parent)))
    parent = result;

  while ((result = GetFirstChild(parent))) {
    parent = result;
    while ((result = GetNextSibling(parent)))
      parent = result;
  }

  setCurrent(parent);
  if (!parent)
    setOffEdge(1);
  return NS_OK;
}

Here is the call graph for this function:

void nsIEnumerator::next ( ) [inherited]

Next will advance the list.

will return failed if already at end

NS_IMETHODIMP nsFocusIterator::Next ( ) [private, virtual]

Implements nsFrameIterator.

Definition at line 576 of file nsFrameTraversal.cpp.

{
  nsIFrame* result = 0;
  nsIFrame* parent = getCurrent();
  if (!parent)
    parent = getLast();

  if ((result = GetFirstChild(parent)))
    parent = result;

  result = parent;
  if (result == getCurrent()) {
    while (result) {
      if ((parent = GetNextSibling(result))) {
        result = parent;
        break;
       } else {
        parent = result;
        result = GetParentFrame(parent);
        if (!result || IsRootFrame(result)) {
          result = nsnull;
          break;
        }
      }
    }

    if (!result) {
      setLast(parent);
    }
  }

  setCurrent(result);
  if (!result)
    setOffEdge(1);
  return NS_OK;
}

Here is the call graph for this function:

Prev will decrement the list.

will return failed if already at beginning

NS_IMETHODIMP nsFocusIterator::Prev ( ) [private, virtual]

Implements nsFrameIterator.

Definition at line 614 of file nsFrameTraversal.cpp.

{
  nsIFrame *result = nsnull;
  nsIFrame *parent = getCurrent();
  if (!parent)
    parent = getLast();
  if (parent) {
    if ((result = GetPrevSibling(parent))) {
      parent = result;
      while ((result = GetFirstChild(parent))) {
        parent = result;
        while ((result = GetNextSibling(parent)))
          parent = result;
      }
      result = parent;
    } else if (!(result = GetParentFrame(parent))) {
      result = 0;
      setLast(parent);
    }
  }

  setCurrent(result);
  if (!result)
    setOffEdge(-1);
  return NS_OK;
}

Here is the call graph for this function:

void nsFrameIterator::setCurrent ( nsIFrame aFrame) [inline, protected, inherited]

Definition at line 65 of file nsFrameTraversal.cpp.

{mCurrent = aFrame;}

Here is the caller graph for this function:

void nsFrameIterator::setLast ( nsIFrame aFrame) [inline, protected, inherited]

Definition at line 70 of file nsFrameTraversal.cpp.

{mLast = aFrame;}

Here is the caller graph for this function:

void nsFrameIterator::setOffEdge ( PRInt8  aOffEdge) [inline, protected, inherited]

Definition at line 72 of file nsFrameTraversal.cpp.

{mOffEdge = aOffEdge;}

Here is the caller graph for this function:

void nsFrameIterator::setStart ( nsIFrame aFrame) [inline, protected, inherited]

Definition at line 67 of file nsFrameTraversal.cpp.

{mStart = aFrame;}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 147 of file nsFrameTraversal.cpp.


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