Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsSliderFrame.cpp File Reference
#include "nsSliderFrame.h"
#include "nsStyleContext.h"
#include "nsPresContext.h"
#include "nsIContent.h"
#include "nsCOMPtr.h"
#include "nsUnitConversion.h"
#include "nsINameSpaceManager.h"
#include "nsXULAtoms.h"
#include "nsHTMLAtoms.h"
#include "nsHTMLParts.h"
#include "nsIPresShell.h"
#include "nsStyleChangeList.h"
#include "nsCSSRendering.h"
#include "nsIDOMEventReceiver.h"
#include "nsIViewManager.h"
#include "nsIWidget.h"
#include "nsIDOMMouseEvent.h"
#include "nsIDocument.h"
#include "nsScrollbarButtonFrame.h"
#include "nsIScrollbarListener.h"
#include "nsIScrollbarMediator.h"
#include "nsIScrollbarFrame.h"
#include "nsISupportsArray.h"
#include "nsLayoutAtoms.h"
#include "nsIScrollableView.h"
#include "nsRepeatService.h"
#include "nsBoxLayoutState.h"
#include "nsSprocketLayout.h"
#include "nsIServiceManager.h"
#include "nsGUIEvent.h"
#include "nsContentUtils.h"
#include "nsIPrivateDOMEvent.h"

Go to the source code of this file.

Functions

static already_AddRefed
< nsIContent
GetContentOfBox (nsIBox *aBox)
nsresult NS_NewSliderFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
static void UpdateAttribute (nsIContent *aScrollbar, nscoord aNewPos, PRBool aNotify, PRBool aIsSmooth)
 NS_IMETHODIMP_ (void) nsSliderFrame
 Call this method once you've created a parser, and want to instruct it about the command which caused the parser to be constructed.

Function Documentation

static already_AddRefed<nsIContent> GetContentOfBox ( nsIBox *  aBox) [static]

Definition at line 89 of file nsSliderFrame.cpp.

{
  nsIContent* content = aBox->GetContent();
  NS_IF_ADDREF(content);
  return content;
}

Here is the caller graph for this function:

Call this method once you've created a parser, and want to instruct it about the command which caused the parser to be constructed.

Open up the parser for tokenization, building up content model..etc.

Stops parsing temporarily.

This method gets called in order to set the content sink for this parser to dump nodes to.

For example, this allows us to select a DTD which can do, say, view-source.

gess 01/04/99

Parameters:
aCommandthe command string to set

For example, this allows us to select a DTD which can do, say, view-source.

gess 01/04/99

Parameters:
aParserCommandthe command to set

gess 01/04/99

Parameters:
nsIContentSinkinterface for node receiver
Returns:

That's it will prevent the parser from building up content model.

Returns:

However, this method does not resume parsing automatically. It's the callers' responsibility to restart the parsing engine.

Returns:

Definition at line 1070 of file nsSliderFrame.cpp.

{
    PRBool stop = PR_FALSE;

    nsIFrame* thumbFrame = mFrames.FirstChild();
    nsRect thumbRect = thumbFrame->GetRect();

    PRBool isHorizontal = IsHorizontal();

    // See if the thumb has moved past our destination point.
    // if it has we want to stop.
    if (isHorizontal) {
        if (mChange < 0) {
            if (thumbRect.x < mDestinationPoint.x)
                stop = PR_TRUE;
        } else {
            if (thumbRect.x + thumbRect.width > mDestinationPoint.x)
                stop = PR_TRUE;
        }
    } else {
         if (mChange < 0) {
            if (thumbRect.y < mDestinationPoint.y)
                stop = PR_TRUE;
        } else {
            if (thumbRect.y + thumbRect.height > mDestinationPoint.y)
                stop = PR_TRUE;
        }
    }


    if (stop) {
       nsRepeatService::GetInstance()->Stop();
    } else {
      PageUpDown(thumbFrame, mChange);
    }
}

Here is the call graph for this function:

nsresult NS_NewSliderFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 97 of file nsSliderFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");
  if (nsnull == aNewFrame) {
    return NS_ERROR_NULL_POINTER;
  }
  nsSliderFrame* it = new (aPresShell) nsSliderFrame(aPresShell);
  if (nsnull == it)
    return NS_ERROR_OUT_OF_MEMORY;

  *aNewFrame = it;
  return NS_OK;

} // NS_NewSliderFrame

Here is the caller graph for this function:

static void UpdateAttribute ( nsIContent aScrollbar,
nscoord  aNewPos,
PRBool  aNotify,
PRBool  aIsSmooth 
) [static]

Definition at line 676 of file nsSliderFrame.cpp.

                                                                                                       {
  nsAutoString str;
  str.AppendInt(aNewPos);
  
  if (aIsSmooth) {
    aScrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::smooth, NS_LITERAL_STRING("true"), PR_FALSE);
  }
  aScrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, str, aNotify);
  if (aIsSmooth) {
    aScrollbar->UnsetAttr(kNameSpaceID_None, nsXULAtoms::smooth, PR_FALSE);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function: