Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
nsIWidget Class Reference

The base class for all the widgets. More...

#include <nsIWidget.h>

Inheritance diagram for nsIWidget:
Inheritance graph
[legend]
Collaboration diagram for nsIWidget:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsIWidget ()
NS_IMETHOD Create (nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)=0
 Create and initialize a widget.
NS_IMETHOD Create (nsNativeWidget aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, nsIDeviceContext *aContext, nsIAppShell *aAppShell=nsnull, nsIToolkit *aToolkit=nsnull, nsWidgetInitData *aInitData=nsnull)=0
 Create and initialize a widget with a native window parent.
NS_IMETHOD Destroy (void)=0
 Close and destroy the internal native window.
NS_IMETHOD SetParent (nsIWidget *aNewParent)=0
 Reparent a widget.
virtual nsIWidgetGetParent (void)=0
 Return the parent Widget of this Widget or nsnull if this is a top level window.
nsIWidgetGetFirstChild () const
 Return the first child of this widget.
nsIWidgetGetLastChild () const
 Return the last child of this widget.
nsIWidgetGetNextSibling () const
 Return the next sibling of this widget.
void SetNextSibling (nsIWidget *aSibling)
 Set the next sibling of this widget.
nsIWidgetGetPrevSibling () const
 Return the previous sibling of this widget.
void SetPrevSibling (nsIWidget *aSibling)
 Set the previous sibling of this widget.
NS_IMETHOD Show (PRBool aState)=0
 Show or hide this widget.
NS_IMETHOD SetModal (PRBool aModal)=0
 Make the window modal.
NS_IMETHOD IsVisible (PRBool &aState)=0
 Returns whether the window is visible.
NS_IMETHOD ConstrainPosition (PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)=0
 Perform platform-dependent sanity check on a potential window position.
NS_IMETHOD Move (PRInt32 aX, PRInt32 aY)=0
 Move this widget.
NS_IMETHOD Resize (PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)=0
 Resize this widget.
NS_IMETHOD Resize (PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)=0
 Move or resize this widget.
NS_IMETHOD SetZIndex (PRInt32 aZIndex)=0
 Sets the widget's z-index.
NS_IMETHOD GetZIndex (PRInt32 *aZIndex)=0
 Gets the widget's z-index.
NS_IMETHOD PlaceBehind (nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, PRBool aActivate)=0
 Position this widget just behind the given widget.
NS_IMETHOD SetSizeMode (PRInt32 aMode)=0
 Minimize, maximize or normalize the window size.
NS_IMETHOD GetSizeMode (PRInt32 *aMode)=0
 Return size mode (minimized, maximized, normalized).
NS_IMETHOD Enable (PRBool aState)=0
 Enable or disable this Widget.
NS_IMETHOD IsEnabled (PRBool *aState)=0
 Ask whether the widget is enabled.
NS_IMETHOD SetFocus (PRBool aRaise=PR_FALSE)=0
 Give focus to this widget.
NS_IMETHOD GetBounds (nsRect &aRect)=0
 Get this widget's outside dimensions relative to its parent widget.
NS_IMETHOD GetScreenBounds (nsRect &aRect)=0
 Get this widget's outside dimensions in global coordinates.
NS_IMETHOD GetClientBounds (nsRect &aRect)=0
 Get this widget's client area dimensions, if the window has a 3D border appearance this returns the area inside the border, The x and y are always zero.
NS_IMETHOD GetBorderSize (PRInt32 &aWidth, PRInt32 &aHeight)=0
 Gets the width and height of the borders.
virtual nscolor GetForegroundColor (void)=0
 Get the foreground color for this widget.
NS_IMETHOD SetForegroundColor (const nscolor &aColor)=0
 Set the foreground color for this widget.
virtual nscolor GetBackgroundColor (void)=0
 Get the background color for this widget.
NS_IMETHOD SetBackgroundColor (const nscolor &aColor)=0
 Set the background color for this widget.
virtual nsIFontMetricsGetFont (void)=0
 Get the font for this widget.
NS_IMETHOD SetFont (const nsFont &aFont)=0
 Set the font for this widget.
virtual nsCursor GetCursor (void)=0
 Get the cursor for this widget.
NS_IMETHOD SetCursor (nsCursor aCursor)=0
 Set the cursor for this widget.
NS_IMETHOD SetCursor (imgIContainer *aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY)=0
 Sets an image as the cursor for this widget.
NS_IMETHOD GetWindowType (nsWindowType &aWindowType)=0
 Get the window type of this widget.
NS_IMETHOD SetWindowTranslucency (PRBool aTranslucent)=0
 Set the translucency of the top-level window containing this widget.
NS_IMETHOD GetWindowTranslucency (PRBool &aTranslucent)=0
 Get the translucency of the top-level window that contains this widget.
NS_IMETHOD UpdateTranslucentWindowAlpha (const nsRect &aRect, PRUint8 *aAlphas)=0
 Update the alpha channel for some pixels of the top-level window that contains this widget.
NS_IMETHOD HideWindowChrome (PRBool aShouldHide)=0
 Hide window chrome (borders, buttons) for this widget.
NS_IMETHOD MakeFullScreen (PRBool aFullScreen)=0
 Put the toplevel window into or out of fullscreen mode.
NS_IMETHOD Validate ()=0
 Validate the widget.
NS_IMETHOD Invalidate (PRBool aIsSynchronous)=0
 Invalidate the widget and repaint it.
NS_IMETHOD Invalidate (const nsRect &aRect, PRBool aIsSynchronous)=0
 Invalidate a specified rect for a widget and repaints it.
NS_IMETHOD InvalidateRegion (const nsIRegion *aRegion, PRBool aIsSynchronous)=0
 Invalidate a specified region for a widget and repaints it.
NS_IMETHOD Update ()=0
 Force a synchronous repaint of the window if there are dirty rects.
NS_IMETHOD AddMouseListener (nsIMouseListener *aListener)=0
 Adds a mouse listener to this widget Any existing mouse listener is replaced.
NS_IMETHOD AddEventListener (nsIEventListener *aListener)=0
 Adds an event listener to this widget Any existing event listener is replaced.
NS_IMETHOD AddMenuListener (nsIMenuListener *aListener)=0
 Adds a menu listener to this widget Any existing menu listener is replaced.
virtual nsIToolkitGetToolkit ()=0
 Return the widget's toolkit.
NS_IMETHOD SetColorMap (nsColorMap *aColorMap)=0
 Set the color map for this widget.
NS_IMETHOD Scroll (PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)=0
 XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.
NS_IMETHOD ScrollWidgets (PRInt32 aDx, PRInt32 aDy)=0
 Scroll the contents of the widget.
NS_IMETHOD ScrollRect (nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy)=0
 Scroll an area of this widget.
NS_IMETHOD SetBorderStyle (nsBorderStyle aBorderStyle)=0
 Set border style Must be called before Create.
NS_IMETHOD SetTitle (const nsAString &aTitle)=0
 Set the widget's title.
NS_IMETHOD SetIcon (const nsAString &anIconSpec)=0
 Set the widget's icon.
NS_IMETHOD SetMenuBar (nsIMenuBar *aMenuBar)=0
 Set the widget's MenuBar.
NS_IMETHOD ShowMenuBar (PRBool aShow)=0
 Set the widget's MenuBar's visibility.
NS_IMETHOD WidgetToScreen (const nsRect &aOldRect, nsRect &aNewRect)=0
 Convert from this widget coordinates to screen coordinates.
NS_IMETHOD ScreenToWidget (const nsRect &aOldRect, nsRect &aNewRect)=0
 Convert from screen coordinates to this widget's coordinates.
NS_IMETHOD BeginResizingChildren (void)=0
 When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.
NS_IMETHOD EndResizingChildren (void)=0
 Call this when finished adjusting child windows.
NS_IMETHOD GetPreferredSize (PRInt32 &aWidth, PRInt32 &aHeight)=0
 Returns the preferred width and height for the widget.
NS_IMETHOD SetPreferredSize (PRInt32 aWidth, PRInt32 aHeight)=0
 Set the preferred width and height for the widget.
NS_IMETHOD DispatchEvent (nsGUIEvent *event, nsEventStatus &aStatus)=0
 Dispatches an event to the widget.
NS_IMETHOD Paint (nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect)=0
 For printing and lightweight widgets.
NS_IMETHOD EnableDragDrop (PRBool aEnable)=0
 Enables the dropping of files to a widget (XXX this is temporary)
virtual void ConvertToDeviceCoordinates (nscoord &aX, nscoord &aY)=0
NS_IMETHOD CaptureMouse (PRBool aCapture)=0
 Enables/Disables system mouse capture.
NS_IMETHOD GetWindowClass (char *aClass)=0
 Gets the window class implemented in gtk.
NS_IMETHOD SetWindowClass (char *aClass)=0
 Sets the window class implemented in gtk.
NS_IMETHOD CaptureRollupEvents (nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent)=0
 Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.
NS_IMETHOD ModalEventFilter (PRBool aRealEvent, void *aEvent, PRBool *aForWindow)=0
 Determine whether a given event should be processed assuming we are the currently active modal window.
NS_IMETHOD GetAttention (PRInt32 aCycleCount)=0
 Bring this window to the user's attention.
NS_IMETHOD GetLastInputEventTime (PRUint32 &aTime)=0
 Get the last user input event time in milliseconds.
NS_IMETHOD GetClientData (void *&aClientData)=0
 Accessor functions to get and set the client data associated with the widget.
NS_IMETHOD SetClientData (void *aClientData)=0
virtual void AddChild (nsIWidget *aChild)=0
 Internal methods.
virtual void RemoveChild (nsIWidget *aChild)=0
virtual voidGetNativeData (PRUint32 aDataType)=0
virtual void FreeNativeData (void *data, PRUint32 aDataType)=0
virtual nsIRenderingContextGetRenderingContext ()=0
virtual nsIDeviceContextGetDeviceContext ()=0
virtual nsIAppShellGetAppShell ()=0

Protected Attributes

nsCOMPtr< nsIWidgetmFirstChild
nsIWidgetmLastChild
nsCOMPtr< nsIWidgetmNextSibling
nsIWidgetmPrevSibling

Detailed Description

The base class for all the widgets.

It provides the interface for all basic and necessary functionality.

Definition at line 255 of file nsIWidget.h.


Constructor & Destructor Documentation

nsIWidget::nsIWidget ( ) [inline]

Definition at line 261 of file nsIWidget.h.


Member Function Documentation

virtual void nsIWidget::AddChild ( nsIWidget aChild) [pure virtual]

Internal methods.

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::AddEventListener ( nsIEventListener aListener) [pure virtual]

Adds an event listener to this widget Any existing event listener is replaced.

Parameters:
aListenerevent listener to add to this widget.

Implemented in nsBaseWidget.

NS_IMETHOD nsIWidget::AddMenuListener ( nsIMenuListener aListener) [pure virtual]

Adds a menu listener to this widget Any existing menu listener is replaced.

Parameters:
aListenermenu listener to add to this widget.

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::AddMouseListener ( nsIMouseListener aListener) [pure virtual]

Adds a mouse listener to this widget Any existing mouse listener is replaced.

Parameters:
aListenermouse listener to add to this widget.

Implemented in nsBaseWidget.

When adjustments are to made to a whole set of child widgets, call this before resizing/positioning the child windows to minimize repaints.

Must be followed by EndResizingChildren() after child windows have been adjusted.

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsCocoaWindow, nsWidget, nsWindow, nsWidget, nsCommonWidget, and nsWindow.

NS_IMETHOD nsIWidget::CaptureMouse ( PRBool  aCapture) [pure virtual]

Enables/Disables system mouse capture.

Parameters:
aCapturePR_TRUE enables mouse capture, PR_FALSE disables mouse capture

Implemented in nsWindow, nsWidget, nsWidget, nsWindow, nsWindow, nsWindow, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::CaptureRollupEvents ( nsIRollupListener aListener,
PRBool  aDoCapture,
PRBool  aConsumeRollupEvent 
) [pure virtual]

Enables/Disables system capture of any and all events that would cause a dropdown to be rolled up, This method ignores the aConsumeRollupEvent parameter when aDoCapture is FALSE.

Parameters:
aDoCapturePR_TRUE enables capture, PR_FALSE disables capture
aConsumeRollupEventPR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsCocoaWindow, nsWindow, nsWidget, nsWindow, nsWidget, nsWidget, nsCommonWidget, nsWindow, nsWindow, and nsWindow.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::ConstrainPosition ( PRBool  aAllowSlop,
PRInt32 aX,
PRInt32 aY 
) [pure virtual]

Perform platform-dependent sanity check on a potential window position.

This is guaranteed to work only for top-level windows.

Parameters:
aAllowSlop,:if true, allow the window to slop offscreen; the window should be partially visible. if false, force the entire window onscreen (or at least the upper-left corner, if it's too large).
aXin: an x position expressed in screen coordinates. out: the x position constrained to fit on the screen(s).
aYin: an y position expressed in screen coordinates. out: the y position constrained to fit on the screen(s).
Returns:
vapid success indication. but see also the parameters.

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsMacWindow, nsWindow, nsWidget, nsWindow, and nsCommonWidget.

virtual void nsIWidget::ConvertToDeviceCoordinates ( nscoord aX,
nscoord aY 
) [pure virtual]

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWindow, nsWidget, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Create ( nsIWidget aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell = nsnull,
nsIToolkit aToolkit = nsnull,
nsWidgetInitData aInitData = nsnull 
) [pure virtual]

Create and initialize a widget.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event. The widget should not automatically clear the window to the background color. The calling code must handle paint messages and clear the background itself.

aInitData cannot be eWindowType_popup here; popups cannot be hooked into the nsIWidget hierarchy.

Parameters:
parentor null if it's a top level window
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function
aContext
aAppShellthe parent application shell. If nsnull, the parent window's application shell will be used.
aToolkit
aInitDatadata that is used for widget initialization

Implemented in nsWindow, nsChildView, nsWindow, nsCommonWidget, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsWindow, nsWidget, and nsMacControl.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Create ( nsNativeWidget  aParent,
const nsRect aRect,
EVENT_CALLBACK  aHandleEventFunction,
nsIDeviceContext aContext,
nsIAppShell aAppShell = nsnull,
nsIToolkit aToolkit = nsnull,
nsWidgetInitData aInitData = nsnull 
) [pure virtual]

Create and initialize a widget with a native window parent.

The widget represents a window that can be drawn into. It also is the base class for user-interface widgets such as buttons and text boxes.

All the arguments can be NULL in which case a top level window with size 0 is created. The event callback function has to be provided only if the caller wants to deal with the events this widget receives. The event callback is basically a preprocess hook called synchronously. The return value determines whether the event goes to the default window procedure or it is hidden to the os. The assumption is that if the event handler returns false the widget does not see the event.

Parameters:
aParentnative window.
aRectthe widget dimension
aHandleEventFunctionthe event handler callback function

Implemented in nsWindow, nsChildView, nsWindow, nsCommonWidget, nsWindow, nsWindow, nsWidget, nsMacWindow, nsWidget, nsCocoaWindow, nsWindow, and nsWidget.

NS_IMETHOD nsIWidget::Destroy ( void  ) [pure virtual]

Close and destroy the internal native window.

This method does not delete the widget.

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWindow, nsWidget, nsWidget, nsWindow, nsWidget, nsBaseWidget, nsNativeScrollbar, and nsMacControl.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::DispatchEvent ( nsGUIEvent event,
nsEventStatus aStatus 
) [pure virtual]

Dispatches an event to the widget.

  

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWidget, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsCommonWidget, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Enable ( PRBool  aState) [pure virtual]

Enable or disable this Widget.

Parameters:
aStatePR_TRUE to enable the Widget, PR_FALSE to disable it.

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsCommonWidget, nsCocoaWindow, nsWidget, nsWindow, nsWidget, nsWindow, nsNativeScrollbar, nsCommonWidget, and nsMacControl.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::EnableDragDrop ( PRBool  aEnable) [pure virtual]

Enables the dropping of files to a widget (XXX this is temporary)

  

Implemented in nsWindow, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

Call this when finished adjusting child windows.

Must be preceded by BeginResizingChildren().

Implemented in nsWindow, nsChildView, nsWindow, nsWidget, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWindow, nsWidget, nsCommonWidget, and nsWindow.

virtual void nsIWidget::FreeNativeData ( void data,
PRUint32  aDataType 
) [pure virtual]

Implemented in nsWindow, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

virtual nsIAppShell* nsIWidget::GetAppShell ( ) [pure virtual]

Implemented in nsBaseWidget.

NS_IMETHOD nsIWidget::GetAttention ( PRInt32  aCycleCount) [pure virtual]

Bring this window to the user's attention.

This is intended to be a more gentle notification than popping the window to the top or putting up an alert. See, for example, Win32 FlashWindow or the NotificationManager on the Mac. The notification should be suppressed if the window is already in the foreground and should be dismissed when the user brings this window to the foreground.

Parameters:
aCycleCountMaximum number of times to animate the window per system conventions. If set to -1, cycles indefinitely until window is brought into the foreground.

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsBaseWidget, nsWindow, nsWindow, and nsWindow.

virtual nscolor nsIWidget::GetBackgroundColor ( void  ) [pure virtual]

Get the background color for this widget.

Returns:
this widget's background color

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetBorderSize ( PRInt32 aWidth,
PRInt32 aHeight 
) [pure virtual]

Gets the width and height of the borders.

Parameters:
aWidththe width of the border
aHeightthe height of the border

Implemented in nsBaseWidget.

NS_IMETHOD nsIWidget::GetBounds ( nsRect aRect) [pure virtual]

Get this widget's outside dimensions relative to its parent widget.

Parameters:
aRecton return it holds the x, y, width and height of this widget

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsBaseWidget, nsLabel, nsLabel, nsTextWidget, and nsTextWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetClientBounds ( nsRect aRect) [pure virtual]

Get this widget's client area dimensions, if the window has a 3D border appearance this returns the area inside the border, The x and y are always zero.

Parameters:
aRecton return it holds the x. y, width and height of the client area of this widget

Implemented in nsWindow, nsWindow, nsBaseWidget, nsWindow, and nsFrameWindow.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetClientData ( void *&  aClientData) [pure virtual]

Accessor functions to get and set the client data associated with the widget.

Implemented in nsBaseWidget.

Here is the caller graph for this function:

virtual nsCursor nsIWidget::GetCursor ( void  ) [pure virtual]

Get the cursor for this widget.

Returns:
this widget's cursor.

Implemented in nsCommonWidget, and nsBaseWidget.

virtual nsIDeviceContext* nsIWidget::GetDeviceContext ( ) [pure virtual]

Implemented in nsBaseWidget.

Here is the caller graph for this function:

nsIWidget* nsIWidget::GetFirstChild ( ) const [inline]

Return the first child of this widget.

Will return null if there are no children.

Definition at line 374 of file nsIWidget.h.

                                     {
        return mFirstChild;
    }

Here is the caller graph for this function:

virtual nsIFontMetrics* nsIWidget::GetFont ( void  ) [pure virtual]

Get the font for this widget.

Returns:
the font metrics

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsWidget, nsWindow, and nsCommonWidget.

virtual nscolor nsIWidget::GetForegroundColor ( void  ) [pure virtual]

Get the foreground color for this widget.

Returns:
this widget's foreground color

Implemented in nsBaseWidget.

nsIWidget* nsIWidget::GetLastChild ( ) const [inline]

Return the last child of this widget.

Will return null if there are no children.

Definition at line 382 of file nsIWidget.h.

                                    {
        return mLastChild;
    }

Get the last user input event time in milliseconds.

If there are any pending native toolkit input events it returns the current time. All input events are included (ie. it is not limited to events targeted at this nsIWidget instance.

Parameters:
aTimeLast user input time in milliseconds. This value can be used to compare durations but can not be used for determining wall clock time. The value returned is platform dependent, but is compatible with the expression PR_IntervalToMicroseconds(PR_IntervalNow()).

Implemented in nsWindow, nsWindow, and nsBaseWidget.

virtual void* nsIWidget::GetNativeData ( PRUint32  aDataType) [pure virtual]
nsIWidget* nsIWidget::GetNextSibling ( ) const [inline]

Return the next sibling of this widget.

Definition at line 389 of file nsIWidget.h.

                                      {
        return mNextSibling;
    }

Here is the caller graph for this function:

virtual nsIWidget* nsIWidget::GetParent ( void  ) [pure virtual]

Return the parent Widget of this Widget or nsnull if this is a top level window.

Returns:
the parent widget or nsnull if it does not have a parent

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsWidget, nsWidget, nsBaseWidget, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetPreferredSize ( PRInt32 aWidth,
PRInt32 aHeight 
) [pure virtual]

Returns the preferred width and height for the widget.

  

Implemented in nsWindow, nsChildView, nsWindow, nsWidget, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsCommonWidget, nsCommonWidget, nsLabel, nsLabel, and nsLabel.

nsIWidget* nsIWidget::GetPrevSibling ( ) const [inline]

Return the previous sibling of this widget.

Definition at line 403 of file nsIWidget.h.

                                      {
        return mPrevSibling;
    }

Here is the caller graph for this function:

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetScreenBounds ( nsRect aRect) [pure virtual]

Get this widget's outside dimensions in global coordinates.

(One might think this could be accomplished by stringing together other methods in this interface, but then one would bloody one's nose on different coordinate system handling by different platforms.)

Parameters:
aRecton return it holds the x, y, width and height of this widget

Implemented in nsWindow, nsWindow, nsCocoaWindow, nsBaseWidget, nsMacWindow, nsWindow, nsWindow, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetSizeMode ( PRInt32 aMode) [pure virtual]

Return size mode (minimized, maximized, normalized).

Returns a value from nsSizeMode (see nsGUIEvent.h)

Implemented in nsBaseWidget.

virtual nsIToolkit* nsIWidget::GetToolkit ( ) [pure virtual]

Return the widget's toolkit.

Returns:
the toolkit this widget was created in. See nsToolkit.

Implemented in nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetWindowClass ( char *  aClass) [pure virtual]

Gets the window class implemented in gtk.

Implemented in nsWidget, and nsBaseWidget.

NS_IMETHOD nsIWidget::GetWindowTranslucency ( PRBool aTranslucent) [pure virtual]

Get the translucency of the top-level window that contains this widget.

Parameters:
aTranslucenttrue if the window may have translucent or transparent pixels

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetWindowType ( nsWindowType aWindowType) [pure virtual]

Get the window type of this widget.

Parameters:
aWindowTypethe window type of the widget

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::GetZIndex ( PRInt32 aZIndex) [pure virtual]

Gets the widget's z-index.

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::HideWindowChrome ( PRBool  aShouldHide) [pure virtual]

Hide window chrome (borders, buttons) for this widget.

Implemented in nsWindow, nsWindow, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Invalidate ( PRBool  aIsSynchronous) [pure virtual]

Invalidate the widget and repaint it.

Parameters:
aIsSynchronousPR_TRUE then repaint synchronously. If PR_FALSE repaint later.
See also:
Update()

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWidget, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWindow, nsWindow, nsWindow, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Invalidate ( const nsRect aRect,
PRBool  aIsSynchronous 
) [pure virtual]

Invalidate a specified rect for a widget and repaints it.

Parameters:
aIsSynchronousePR_TRUE then repaint synchronously. If PR_FALSE repaint later.
See also:
Update()

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWidget, nsWindow, nsWindow, nsCocoaWindow, nsWindow, nsWidget, nsWindow, and nsWindow.

NS_IMETHOD nsIWidget::InvalidateRegion ( const nsIRegion aRegion,
PRBool  aIsSynchronous 
) [pure virtual]

Invalidate a specified region for a widget and repaints it.

Parameters:
aIsSynchronousePR_TRUE then repaint synchronously. If PR_FALSE repaint later.
See also:
Update()

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWidget, nsWindow, nsWindow, nsWindow, nsWindow, nsWindow, and nsBaseWidget.

NS_IMETHOD nsIWidget::IsEnabled ( PRBool aState) [pure virtual]

Ask whether the widget is enabled.

Parameters:
aStatereturns PR_TRUE if the widget is enabled

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsCommonWidget, nsCocoaWindow, nsWidget, nsWindow, nsWidget, nsNativeScrollbar, and nsCommonWidget.

NS_IMETHOD nsIWidget::IsVisible ( PRBool aState) [pure virtual]

Returns whether the window is visible.

  

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsWindow, nsWidget, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::MakeFullScreen ( PRBool  aFullScreen) [pure virtual]

Put the toplevel window into or out of fullscreen mode.

Implemented in nsWindow, nsWindow, and nsBaseWidget.

NS_IMETHOD nsIWidget::ModalEventFilter ( PRBool  aRealEvent,
void aEvent,
PRBool aForWindow 
) [pure virtual]

Determine whether a given event should be processed assuming we are the currently active modal window.

Note that the exact semantics of this method are platform-dependent. The Macintosh, for instance, cares deeply that this method do exactly as advertised. Gtk, for instance, handles modality in a completely different fashion and does little if anything with this method.

Parameters:
aRealEventevent is real or a null placeholder (Macintosh)
aEventvoid pointer to native event structure
aForWindowreturn value. PR_TRUE iff event should be processed.

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, and nsBaseWidget.

NS_IMETHOD nsIWidget::Move ( PRInt32  aX,
PRInt32  aY 
) [pure virtual]

Move this widget.

Parameters:
aXthe new x position expressed in the parent's coordinate system
aYthe new y position expressed in the parent's coordinate system

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsMacWindow, nsWindow, nsWidget, nsWindow, nsWindow, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Paint ( nsIRenderingContext aRenderingContext,
const nsRect aDirtyRect 
) [pure virtual]

For printing and lightweight widgets.

  

Implemented in nsBaseWidget, nsCheckButton, nsTextWidget, nsCheckButton, nsButton, nsTextWidget, nsButton, nsCheckButton, nsButton, and nsTextWidget.

NS_IMETHOD nsIWidget::PlaceBehind ( nsTopLevelWidgetZPlacement  aPlacement,
nsIWidget aWidget,
PRBool  aActivate 
) [pure virtual]

Position this widget just behind the given widget.

(Used to control z-order for top-level widgets. Get/SetZIndex by contrast control z-order for child widgets of other widgets.)

Parameters:
aPlacementtop, bottom, or below a widget (if top or bottom, param aWidget is ignored)
aWidgetwidget to place this widget behind (only if aPlacement is eZPlacementBelow). null is equivalent to aPlacement of eZPlacementTop
aActivatetrue to activate the widget after placing it

Implemented in nsWindow, nsWindow, nsCocoaWindow, nsMacWindow, nsWindow, and nsBaseWidget.

virtual void nsIWidget::RemoveChild ( nsIWidget aChild) [pure virtual]

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Resize ( PRInt32  aWidth,
PRInt32  aHeight,
PRBool  aRepaint 
) [pure virtual]

Resize this widget.

Parameters:
aWidththe new width expressed in the parent's coordinate system
aHeightthe new height expressed in the parent's coordinate system
aRepaintwhether the widget should be repainted

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsMacWindow, nsWidget, nsWidget, nsCommonWidget, nsWindow, nsWidget, nsWindow, nsWindow, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Resize ( PRInt32  aX,
PRInt32  aY,
PRInt32  aWidth,
PRInt32  aHeight,
PRBool  aRepaint 
) [pure virtual]

Move or resize this widget.

Parameters:
aXthe new x position expressed in the parent's coordinate system
aYthe new y position expressed in the parent's coordinate system
aWidththe new width expressed in the parent's coordinate system
aHeightthe new height expressed in the parent's coordinate system
aRepaintwhether the widget should be repainted if the size changes

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsCommonWidget, nsWidget, nsWindow, nsWidget, nsWindow, nsWindow, and nsCommonWidget.

NS_IMETHOD nsIWidget::ScreenToWidget ( const nsRect aOldRect,
nsRect aNewRect 
) [pure virtual]

Convert from screen coordinates to this widget's coordinates.

Parameters:
aOldRectscreen coordinates stored in the x,y members
aNewRectwidget's coordinates stored in the x,y members

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsWidget, nsWindow, nsWidget, nsCocoaWindow, and nsCommonWidget.

NS_IMETHOD nsIWidget::Scroll ( PRInt32  aDx,
PRInt32  aDy,
nsRect aClipRect 
) [pure virtual]

XXX (This is obsolete and will be removed soon, Use ScrollWidgets instead) Scroll this widget.

Parameters:
aDxamount to scroll along the x-axis
aDyamount to scroll along the y-axis.
aClipRectclipping rectangle to limit the scroll to.

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWindow, nsWindow, nsWidget, nsCocoaWindow, nsWindow, nsWidget, nsWindow, nsCommonWidget, nsWindow, and nsWindow.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::ScrollRect ( nsRect aSrcRect,
PRInt32  aDx,
PRInt32  aDy 
) [pure virtual]

Scroll an area of this widget.

Child widgets are not scrolled. A NS_PAINT message is synchronously dispatched for the newly exposed rectangle.

Parameters:
aRectsource rectangle to scroll in the widget in pixels
aDxx offset from the source in pixels
aDyy offset from the source in pixels

Implemented in nsWindow, nsWindow, nsBaseWidget, nsWindow, nsWindow, nsWindow, and nsWindow.

NS_IMETHOD nsIWidget::ScrollWidgets ( PRInt32  aDx,
PRInt32  aDy 
) [pure virtual]

Scroll the contents of the widget.

All child widgets are also scrolled by offsetting their coordinates. A NS_PAINT message is synchronously dispatched for the newly exposed rectangle.

Parameters:
aDxamount to scroll along the x-axis in pixels
aDyamount to scroll along the y-axis in pixels

Implemented in nsWindow, nsWidget, nsWindow, nsBaseWidget, nsWindow, nsWindow, nsCommonWidget, nsWindow, and nsWindow.

NS_IMETHOD nsIWidget::SetBackgroundColor ( const nscolor aColor) [pure virtual]

Set the background color for this widget.

Parameters:
aColorthe new background color

Implemented in nsWindow, nsWindow, nsWidget, nsWidget, nsWindow, nsWidget, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetBorderStyle ( nsBorderStyle  aBorderStyle) [pure virtual]

Set border style Must be called before Create.

Parameters:
aBorderStyle
See also:
nsBorderStyle

Implemented in nsWindow, and nsBaseWidget.

NS_IMETHOD nsIWidget::SetClientData ( void aClientData) [pure virtual]

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetColorMap ( nsColorMap aColorMap) [pure virtual]

Set the color map for this widget.

Parameters:
aColorMapcolor map for displaying this widget

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsCocoaWindow, nsWidget, nsWindow, nsWidget, and nsCommonWidget.

NS_IMETHOD nsIWidget::SetCursor ( nsCursor  aCursor) [pure virtual]

Set the cursor for this widget.

Parameters:
aCursorthe new cursor for this widget

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsWidget, nsCommonWidget, nsWindow, nsWidget, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetCursor ( imgIContainer aCursor,
PRUint32  aHotspotX,
PRUint32  aHotspotY 
) [pure virtual]

Sets an image as the cursor for this widget.

Parameters:
aCursorthe cursor to set
aXthe X coordinate of the hotspot (from left).
aYthe Y coordinate of the hotspot (from top).
Return values:
NS_ERROR_NOT_IMPLEMENTEDif setting images as cursors is not supported

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, and nsBaseWidget.

NS_IMETHOD nsIWidget::SetFocus ( PRBool  aRaise = PR_FALSE) [pure virtual]
NS_IMETHOD nsIWidget::SetFont ( const nsFont aFont) [pure virtual]

Set the font for this widget.

Parameters:
aFontfont to display. See nsFont for allowable fonts

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsWidget, nsWindow, nsCommonWidget, and nsMacControl.

NS_IMETHOD nsIWidget::SetForegroundColor ( const nscolor aColor) [pure virtual]

Set the foreground color for this widget.

Parameters:
aColorthe new foreground color

Implemented in nsWindow, and nsBaseWidget.

NS_IMETHOD nsIWidget::SetIcon ( const nsAString &  anIconSpec) [pure virtual]

Set the widget's icon.

Must be called after Create.

Parameters:
anIconSpecstring specifying the icon to use; convention is to pass a resource: URL from which a platform-dependent resource file name will be constructed

Implemented in nsWindow, nsWindow, nsBaseWidget, nsWindow, and nsWindow.

NS_IMETHOD nsIWidget::SetMenuBar ( nsIMenuBar aMenuBar) [pure virtual]

Set the widget's MenuBar.

Must be called after Create.

Parameters:
aMenuBarthe menubar

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWindow, nsWindow, nsWidget, nsWindow, nsCocoaWindow, nsWidget, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetModal ( PRBool  aModal) [pure virtual]

Make the window modal.

  

Implemented in nsWindow, nsWindow, nsCocoaWindow, nsBaseWidget, nsWidget, nsCommonWidget, and nsWindow.

void nsIWidget::SetNextSibling ( nsIWidget aSibling) [inline]

Set the next sibling of this widget.

Definition at line 396 of file nsIWidget.h.

                                             {
        mNextSibling = aSibling;
    }

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetParent ( nsIWidget aNewParent) [pure virtual]

Reparent a widget.

Change the widgets parent

Parameters:
aNewParentnew parent

Implemented in nsWindow, nsWindow, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetPreferredSize ( PRInt32  aWidth,
PRInt32  aHeight 
) [pure virtual]

Set the preferred width and height for the widget.

  

Implemented in nsWindow, nsChildView, nsWindow, nsWidget, nsWindow, nsWindow, nsCocoaWindow, nsWidget, nsWidget, nsCommonWidget, nsCommonWidget, nsLabel, nsLabel, and nsLabel.

void nsIWidget::SetPrevSibling ( nsIWidget aSibling) [inline]

Set the previous sibling of this widget.

Definition at line 410 of file nsIWidget.h.

                                             {
        mPrevSibling = aSibling;
    }

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetSizeMode ( PRInt32  aMode) [pure virtual]

Minimize, maximize or normalize the window size.

Takes a value from nsSizeMode (see nsGUIEvent.h)

Implemented in nsWindow, nsCocoaWindow, nsWindow, nsMacWindow, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetTitle ( const nsAString &  aTitle) [pure virtual]

Set the widget's title.

Must be called after Create.

Parameters:
aTitlestring displayed as the title of the widget

Implemented in nsWindow, nsChildView, nsWindow, nsWidget, nsWindow, nsWindow, nsWidget, nsCocoaWindow, nsWidget, nsWindow, nsMacWindow, nsWindow, nsCommonWidget, nsWindow, and nsWindow.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetWindowClass ( char *  aClass) [pure virtual]

Sets the window class implemented in gtk.

Implemented in nsWidget, and nsBaseWidget.

NS_IMETHOD nsIWidget::SetWindowTranslucency ( PRBool  aTranslucent) [pure virtual]

Set the translucency of the top-level window containing this widget.

So, e.g., if you call this on the widget for an IFRAME, the top level browser window containing the IFRAME actually gets set. Be careful.

This can fail if the platform doesn't support transparency/translucency. By default widgets are not transparent. This will also fail if the toplevel window is not a Mozilla window, e.g., if the widget is in an embedded context.

After translucency has been enabled, the initial alpha channel value for all pixels is 1, i.e., opaque. If the window is resized then the alpha channel values for all pixels are reset to 1. Pixel RGB color values are already premultiplied with alpha channel values.

Parameters:
aTranslucenttrue if the window may have translucent or transparent pixels

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::SetZIndex ( PRInt32  aZIndex) [pure virtual]

Sets the widget's z-index.

Implemented in nsWidget, nsWindow, and nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Show ( PRBool  aState) [pure virtual]

Show or hide this widget.

Parameters:
aStatePR_TRUE to show the Widget, PR_FALSE to hide it

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsCocoaWindow, nsCommonWidget, nsWidget, nsMacWindow, nsWidget, nsWindow, nsWidget, nsWindow, nsFrameWindow, nsNativeScrollbar, nsMacControl, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::ShowMenuBar ( PRBool  aShow) [pure virtual]

Set the widget's MenuBar's visibility.

Parameters:
aShowPR_TRUE to show, PR_FALSE to hide

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWindow, nsWindow, nsWidget, nsWindow, nsCocoaWindow, nsWidget, and nsCommonWidget.

NS_IMETHOD nsIWidget::Update ( ) [pure virtual]

Force a synchronous repaint of the window if there are dirty rects.

See also:
Invalidate()

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWindow, nsWidget, nsWindow, nsCocoaWindow, nsWindow, nsMacWindow, nsWindow, nsWidget, nsWindow, and nsCommonWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::UpdateTranslucentWindowAlpha ( const nsRect aRect,
PRUint8 aAlphas 
) [pure virtual]

Update the alpha channel for some pixels of the top-level window that contains this widget.

The window must have been made translucent using SetWindowTranslucency. Pixel RGB color values are already premultiplied with alpha channel values.

Parameters:
aRectthe rect to update
aAlphasthe alpha values, in w x h array, row-major order, in units of 1/255. nsBlender::GetAlphas is a good way to compute this array.

Implemented in nsBaseWidget.

Here is the caller graph for this function:

NS_IMETHOD nsIWidget::Validate ( ) [pure virtual]

Validate the widget.

Implemented in nsWindow, nsChildView, nsWidget, nsWindow, nsWindow, nsWindow, and nsBaseWidget.

NS_IMETHOD nsIWidget::WidgetToScreen ( const nsRect aOldRect,
nsRect aNewRect 
) [pure virtual]

Convert from this widget coordinates to screen coordinates.

Parameters:
aOldRectwidget coordinates stored in the x,y members
aNewRectscreen coordinates stored in the x,y members

Implemented in nsWindow, nsChildView, nsWindow, nsWindow, nsWindow, nsWidget, nsWidget, nsWindow, nsWidget, nsCocoaWindow, nsCommonWidget, nsWindow, and nsWindow.

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1046 of file nsIWidget.h.

Definition at line 1047 of file nsIWidget.h.

Definition at line 1048 of file nsIWidget.h.

Definition at line 1049 of file nsIWidget.h.


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