Back to index

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

List of all members.

Public Member Functions

 nsImageControlFrame ()
 ~nsImageControlFrame ()
NS_IMETHOD Destroy (nsPresContext *aPresContext)
NS_IMETHOD QueryInterface (const nsIID &aIID, void **aInstancePtr)
NS_IMETHOD Reflow (nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
NS_IMETHOD HandleEvent (nsPresContext *aPresContext, nsGUIEvent *aEvent, nsEventStatus *aEventStatus)
virtual nsIAtomGetType () const
NS_IMETHOD GetCursor (const nsPoint &aPoint, nsIFrame::Cursor &aCursor)
 NS_IMETHOD_ (PRInt32) GetFormControlType() const
NS_IMETHOD GetName (nsAString *aName)
void SetFocus (PRBool aOn, PRBool aRepaint)
void ScrollIntoView (nsPresContext *aPresContext)
NS_IMETHOD GetFormContent (nsIContent *&aContent) const
 Get the content object associated with this frame.
virtual nscoord GetVerticalInsidePadding (nsPresContext *aPresContext, float aPixToTwip, nscoord aInnerHeight) const
virtual nscoord GetHorizontalInsidePadding (nsPresContext *aPresContext, float aPixToTwip, nscoord aInnerWidth, nscoord aCharWidth) const
NS_IMETHOD SetProperty (nsPresContext *aPresContext, nsIAtom *aName, const nsAString &aValue)
 Set a property on the form control frame.
NS_IMETHOD GetProperty (nsIAtom *aName, nsAString &aValue)
 Get a property from the form control frame.
NS_IMETHOD SetSuggestedSize (nscoord aWidth, nscoord aHeight)
 Set the suggested size for the form element.
NS_IMETHOD OnContentReset ()
 Notification that the content has been reset.
NS_IMETHOD GetClickedX (PRInt32 *aX)
 Get the place the user last clicked on the image (esp.
NS_IMETHOD GetClickedY (PRInt32 *aY)
 Get the place the user last clicked on the image (esp.

Protected Member Functions

 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)

Protected Attributes

nsPoint mLastClickPoint

Detailed Description

Definition at line 66 of file nsImageControlFrame.cpp.


Constructor & Destructor Documentation

Definition at line 136 of file nsImageControlFrame.cpp.

Definition at line 141 of file nsImageControlFrame.cpp.

{
}

Member Function Documentation

Definition at line 146 of file nsImageControlFrame.cpp.

Here is the call graph for this function:

Get the place the user last clicked on the image (esp.

for submits)

Implements nsIImageControlFrame.

Definition at line 371 of file nsImageControlFrame.cpp.

{
  *aX = mLastClickPoint.x;
  return NS_OK;
}

Get the place the user last clicked on the image (esp.

for submits)

Implements nsIImageControlFrame.

Definition at line 378 of file nsImageControlFrame.cpp.

{
  *aY = mLastClickPoint.y;
  return NS_OK;
}

Definition at line 304 of file nsImageControlFrame.cpp.

{
  // Use style defined cursor if one is provided, otherwise when
  // the cursor style is "auto" we use the pointer cursor.
  FillCursorInformationFromStyle(GetStyleUserInterface(), aCursor);

  if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
    aCursor.mCursor = NS_STYLE_CURSOR_POINTER;
  }

  return NS_OK;
}

Get the content object associated with this frame.

Adds a reference to the content object so the caller must do a release.

See also:
nsISupports::Release()

Implements nsIFormControlFrame.

Definition at line 319 of file nsImageControlFrame.cpp.

{
  aContent = GetContent();
  NS_IF_ADDREF(aContent);
  return NS_OK;
}
nscoord nsImageControlFrame::GetHorizontalInsidePadding ( nsPresContext aPresContext,
float  aPixToTwip,
nscoord  aInnerWidth,
nscoord  aCharWidth 
) const [virtual]

Definition at line 335 of file nsImageControlFrame.cpp.

{
  return 0;
}
NS_IMETHODIMP nsImageControlFrame::GetName ( nsAString *  aName) [virtual]

Implements nsIFormControlFrame.

Definition at line 298 of file nsImageControlFrame.cpp.

{
  return nsFormControlHelper::GetName(mContent, aResult);
}

Here is the caller graph for this function:

NS_IMETHODIMP nsImageControlFrame::GetProperty ( nsIAtom aName,
nsAString &  aValue 
) [virtual]

Get a property from the form control frame.

Parameters:
aNamename of the property to get
aValuevalue of the property
Returns:
NS_OK if the property name is valid, otherwise an error code

Implements nsIFormControlFrame.

Definition at line 350 of file nsImageControlFrame.cpp.

{
  aValue.Truncate();
  return NS_OK;
}
nsIAtom * nsImageControlFrame::GetType ( void  ) const [virtual]

Definition at line 219 of file nsImageControlFrame.cpp.

{
  return nsLayoutAtoms::imageControlFrame; 
}
nscoord nsImageControlFrame::GetVerticalInsidePadding ( nsPresContext aPresContext,
float  aPixToTwip,
nscoord  aInnerHeight 
) const [virtual]

Definition at line 327 of file nsImageControlFrame.cpp.

{
   return 0;
}
NS_METHOD nsImageControlFrame::HandleEvent ( nsPresContext aPresContext,
nsGUIEvent aEvent,
nsEventStatus aEventStatus 
)

Definition at line 239 of file nsImageControlFrame.cpp.

{
  NS_ENSURE_ARG_POINTER(aEventStatus);

  // Don't do anything if the event has already been handled by someone
  if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
    return NS_OK;
  }

  // do we have user-input style?
  const nsStyleUserInterface* uiStyle = GetStyleUserInterface();
  if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED)
    return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);

  if (nsFormControlHelper::GetDisabled(mContent)) { // XXX cache disabled
    return NS_OK;
  }

  *aEventStatus = nsEventStatus_eIgnore;

  switch (aEvent->message) {
    case NS_MOUSE_LEFT_BUTTON_UP:
    {
      // Store click point for GetNamesValues
      // Do this on MouseUp because the specs don't say and that's what IE does
      TranslateEventCoords(aEvent->point, mLastClickPoint);
      break;
    }
  }
  return nsImageControlFrameSuper::HandleEvent(aPresContext, aEvent,
                                               aEventStatus);
}

Here is the call graph for this function:

Implements nsIFormControlFrame.

Notification that the content has been reset.

Implements nsIFormControlFrame.

Definition at line 365 of file nsImageControlFrame.cpp.

{
  return NS_OK;
}

Definition at line 170 of file nsImageControlFrame.cpp.

{
  NS_PRECONDITION(0 != aInstancePtr, "null ptr");
  if (NULL == aInstancePtr) {
    return NS_ERROR_NULL_POINTER;
  }
  if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
    *aInstancePtr = (void*) ((nsIFormControlFrame*) this);
    return NS_OK;
  } 
  if (aIID.Equals(NS_GET_IID(nsIImageControlFrame))) {
    *aInstancePtr = (void*) ((nsIImageControlFrame*) this);
    return NS_OK;
  }

  return nsImageControlFrameSuper::QueryInterface(aIID, aInstancePtr);
}

Here is the call graph for this function:

NS_METHOD nsImageControlFrame::Reflow ( nsPresContext aPresContext,
nsHTMLReflowMetrics aDesiredSize,
const nsHTMLReflowState aReflowState,
nsReflowStatus aStatus 
)

Definition at line 225 of file nsImageControlFrame.cpp.

{
  DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame", aReflowState.reason);
  DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
  if (aReflowState.reason == eReflowReason_Initial) {
    nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE);
  }
  return nsImageControlFrameSuper::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
}

Here is the call graph for this function:

Implements nsIFormControlFrame.

Definition at line 280 of file nsImageControlFrame.cpp.

{
  if (aPresContext) {
    nsIPresShell *presShell = aPresContext->GetPresShell();
    if (presShell) {
      presShell->ScrollFrameIntoView(this,
                   NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE);
    }
  }
}

Here is the call graph for this function:

void nsImageControlFrame::SetFocus ( PRBool  aOn,
PRBool  aRepaint 
) [virtual]

Implements nsIFormControlFrame.

Definition at line 275 of file nsImageControlFrame.cpp.

{
}
NS_IMETHODIMP nsImageControlFrame::SetProperty ( nsPresContext aPresContext,
nsIAtom aName,
const nsAString &  aValue 
) [virtual]

Set a property on the form control frame.

Parameters:
aNamename of the property to set
aValuevalue of the property
Returns:
NS_OK if the property name is valid, otherwise an error code

Implements nsIFormControlFrame.

Definition at line 343 of file nsImageControlFrame.cpp.

{
  return NS_OK;
}

Set the suggested size for the form element.

This is used to control the size of the element during reflow if it hasn't had it's size explicitly set.

Parameters:
aWidthwidth of the form element
aHeightheight of the form element
Returns:
NS_OK

Implements nsIFormControlFrame.

Definition at line 357 of file nsImageControlFrame.cpp.

{
//  mSuggestedWidth = aWidth;
//  mSuggestedHeight = aHeight;
  return NS_OK;
}

Member Data Documentation

Definition at line 132 of file nsImageControlFrame.cpp.


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