/****************************************************************************
**
** Copyright (C) 2008-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the documentation of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file.  Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/

/*!
    \class QDesktopWidget
    \brief The QDesktopWidget class provides access to screen information on multi-head systems.

    \ingroup advanced
    \ingroup desktop
    \ingroup environment
    \mainclass

    Systems with more than one graphics card and monitor can manage the
    physical screen space available either as multiple desktops, or as a
    large virtual desktop, which usually has the size of the bounding
    rectangle of all the screens (see isVirtualDesktop()). For an
    application, one of the available screens is the primary screen, i.e.
    the screen where the main widget resides (see primaryScreen()). All
    windows opened in the context of the application should be
    constrained to the boundaries of the primary screen; for example,
    it would be inconvenient if a dialog box popped up on a different
    screen, or split over two screens.

    The QDesktopWidget provides information about the geometry of the
    available screens with screenGeometry(). The number of screens
    available is returned by numScreens(). The screen number that a
    particular point or widget is located in is returned by
    screenNumber().

    Widgets provided by Qt use this class, for example, to place
    tooltips, menus and dialog boxes according to the parent or
    application widget.

    Applications can use this class to save window positions, or to place
    child widgets on one screen.

    \img qdesktopwidget.png Managing Multiple Screens

    In the illustration above, Application One's primary screen is
    screen 0, and App Two's primary screen is screen 1.

    \target multiple screens note
    \note QDesktopWidget inherits the QWidget properties, width() and
    height(), which specify the size of the desktop. However, for
    desktops with multiple screens, the size of the desktop is the union
    of all the screen sizes, so width() and height() should \e not be
    used for computing the size of a widget to be placed on one of the
    screens. The correct width and height values are obtained using
    availableGeometry() or screenGeometry() for a particular screen.

    \sa QApplication, QX11Info::appRootWindow()
*/

/*!
    \fn QDesktopWidget::QDesktopWidget()

    Creates the desktop widget.

    If the system supports a virtual desktop, this widget will have
    the size of the virtual desktop; otherwise this widget will have
    the size of the primary screen.

    Instead of using QDesktopWidget directly, use QApplication::desktop().
*/

/*!
    \fn QDesktopWidget::~QDesktopWidget()

    Destroys the desktop widget and frees any allocated resources.
*/

/*!
    \fn bool QDesktopWidget::isVirtualDesktop() const

    Returns true if the system manages the available screens in a
    virtual desktop; otherwise returns false.

    For virtual desktops, screen() will always return the same widget.
    The size of the virtual desktop is the size of this desktop
    widget.
*/

/*!
    \fn int QDesktopWidget::primaryScreen() const

    Returns the index of the primary screen.

    \sa numScreens()
*/

/*!
    \fn int QDesktopWidget::numScreens() const

    Returns the number of available screens.

    \sa primaryScreen()
*/

/*!
    \fn QWidget *QDesktopWidget::screen(int screen)

    Returns a widget that represents the screen with index \a screen.

    If the system uses a virtual desktop, the returned widget will
    have the geometry of the entire virtual desktop; i.e., bounding
    every \a screen.

    \sa primaryScreen(), numScreens(), isVirtualDesktop()
*/

/*!
    \fn const QRect QDesktopWidget::availableGeometry(int screen) const

     Returns the available geometry of the screen with index \a screen. What
     is available will be subrect of screenGeometry() based on what the
     platform decides is available (for example excludes the dock and menu bar
     on Mac OS X, or the task bar on Windows).

     \sa screenNumber(), screenGeometry()
*/

/*!
    \fn const QRect QDesktopWidget::availableGeometry(const QWidget *widget) const
    \overload

    Returns the available geometry of the screen which contains \a widget.

    \sa screenGeometry()
*/

/*!
    \fn const QRect QDesktopWidget::availableGeometry(const QPoint &p) const
    \overload

    Returns the available geometry of the screen which contains \a p.

    \sa screenGeometry()
*/


/*!
    \fn const QRect QDesktopWidget::screenGeometry(int screen) const

    Returns the geometry of the screen with index \a screen.

    \sa screenNumber()
*/

/*!
    \fn const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const
    \overload

    Returns the geometry of the screen which contains \a widget.
*/

/*!
    \fn const QRect QDesktopWidget::screenGeometry(const QPoint &p) const
    \overload

    Returns the geometry of the screen which contains \a p.
*/


/*!
    \fn int QDesktopWidget::screenNumber(const QWidget *widget) const

    Returns the index of the screen that contains the largest
    part of \a widget, or -1 if the widget not on a screen.

    \sa primaryScreen()
*/

/*!
    \fn int QDesktopWidget::screenNumber(const QPoint &point) const

    \overload
    Returns the index of the screen that contains the \a point, or the
    screen which is the shortest distance from the \a point.

    \sa primaryScreen()
*/

/*!
    \fn void QDesktopWidget::resizeEvent(QResizeEvent *event)
    \reimp
*/

/*!
    \fn void QDesktopWidget::resized(int screen)

    This signal is emitted when the size of \a screen changes.
*/

/*!
    \fn void QDesktopWidget::workAreaResized(int screen)

    This signal is emitted when the work area available on \a screen changes.
*/
