NAME

Mozilla::DOM::Window

DESCRIPTION

Mozilla::DOM::Window is a wrapper around an instance of Mozilla's nsIDOMWindow interface. This class inherits from Supports.

* The nsIDOMWindow interface is the primary interface for a DOM
* window object. It represents a single window object that may
* contain child windows if the document in the window contains a
* HTML frameset document or if the document contains iframe elements.
*
* This interface is not officially defined by any standard bodies, it
* originates from the defacto DOM Level 0 standard.

Note: the following methods aren't wrapped: GetScrollbars, GetScrollX, GetScrollY, ScrollTo, ScrollBy, ScrollByLines, ScrollByPages. (Only GetScrollbars would be non-trivial to wrap, just didn't get around to the others yet.)

CLASS METHODS

$iid = Mozilla::DOM::Window->GetIID()

Pass this to QueryInterface.

METHODS

$document = $window->GetDocument()

    * Accessor for the document in this window.

$window_collection = $window->GetFrames()

* Accessor for the child windows in this window.

In scalar context, returns a Mozilla::DOM::WindowCollection.

In list context, returns a list of Mozilla::DOM::Window (I think... whatever $window_collection->Item($n) is.)

$name = $window->GetName()

    Get the name of this window.

    This corresponds to window.name in JavaScript.

$window = $window->GetParent()

    * Accessor for this window's parent window, or the window itself if
    * there is no parent, or if the parent is of different type
    * (i.e. this does not cross chrome-content boundaries).

$selection = $window->GetSelection()

    * Method for accessing this window's selection object.

$num = $window->GetTextZoom()

    * Set/Get the document scale factor as a multiplier on the default
    * size. When setting this attribute, a NS_ERROR_NOT_IMPLEMENTED
    * error may be returned by implementations not supporting
    * zoom. Implementations not supporting zoom should return 1.0 all
    * the time for the Get operation. 1.0 is equals normal size,
    * i.e. no zoom.

$window = $window->GetTop()

    * Accessor for the root of this hierarchy of windows. This root may
    * be the window itself if there is no parent, or if the parent is
    * of different type (i.e. this does not cross chrome-content
    * boundaries).
    *
    * This property is "replaceable" in JavaScript */

$window->SetName($name)

    • $name (string)

    Set the name of this window.

    "This attribute is 'replaceable' in JavaScript"; where it corresponds to window.name.

$window->SetTextZoom($num)

    • $zoom (double)

$window->SizeToContent()

    * Method for sizing this window to the content in the window.

    XXX: doesn't seem to work. Maybe window resize is disabled, or maybe Gtk2 prevents it.

SEE ALSO

Mozilla::DOM

COPYRIGHT

Copyright (C) 2005, Scott Lanning

This software is licensed under the LGPL. See Mozilla::DOM for a full notice.