/****************************************************************************
**
** Copyright (C) 1992-2004 Trolltech AS. All rights reserved.
**
** This file is part of the painting module of the Qt Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
**   information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/

#include "qstylepainter.h"

/*!
    \class QStylePainter

    \brief The QStylePainter class is a convenience class for drawing QStyle
    elements inside a widget.

    \ingroup appearance multimedia

    QStylePainter extends QPainter with a set of high-level \c
    draw...() functions implemented on top of QStyle's API. The
    advantage of using QStylePainter is that the parameter lists get
    considerably shorter. Whereas a QStyle object must be able to
    draw on any widget using any painter (because the application
    normally has one QStyle object shared by all widget), a
    QStylePainter is initialized with a widget, eliminating the need
    to specify the QWidget, the QPainter, and the QStyle for every
    function call.

    Example using QStyle directly:

    \quotefromfile snippets/styles/styles.cpp
    \skipto ::paintEvent(
    \printuntil }

    Example using QStylePainter:

    \quotefromfile snippets/styles/styles.cpp
    \skipto ::paintEvent(
    \printline paintEvent
    \skipuntil ::paintEvent2(
    \printline {
    \printuntil }

    \sa QStyle, QStyleOption
*/

/*!
    \fn QStylePainter::QStylePainter()

    Constructs a QStylePainter.
*/

/*!
    \fn QStylePainter::QStylePainter(QWidget *widget)

    Construct a QStylePainter using widget \a widget for its paint device.
*/

/*!
    \fn QStylePainter::QStylePainter(QPaintDevice *pd, QWidget *widget)

    Construct a QStylePainter using \a pd for its paint device, and
    attributes from \a widget.
*/


/*!
    \fn bool QStylePainter::begin(QWidget *widget)

    Begin painting operations on widget \a widget.
    This is automatically called by the constructor that takes a QWidget.
*/

/*!
    \fn bool QStylePainter::begin(QPaintDevice *pd, QWidget *widget)
    \overload

    Begin painting operations on paint device \a pd as if it was \a
    widget.  This is automatically called by the constructor that
    takes a QPaintDevice and a QWidget.
*/


/*!
    \fn void QStylePainter::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &option)

    Use the widget's style to draw a primitive element \a pe specified by QStyleOption \a option.

    \sa QStyle::drawPrimitive()
*/

/*!
    \fn void QStylePainter::drawControl(QStyle::ControlElement ce, const QStyleOption &option)

    Use the widget's style to draw a control element \a ce specified by QStyleOption \a option.

    \sa QStyle::drawControl()
*/

/*!
    \fn void QStylePainter::drawControlMask(QStyle::ControlElement element, const QStyleOption &option)

    Use the widget's style to draw the mast for control element \a
    element further specified by QStyleOption \a option.

    \sa QStyle::drawControlMask()
*/

/*!
  \fn void QStylePainter::drawComplexControl(QStyle::ComplexControl cc,
                                             const QStyleOptionComplex &option)

    Use the widget's style to draw a complex control \a cc specified by the
    QStyleOptionComplex \a option.

    \sa QStyle::drawComplexControl()
*/


/*!
    \fn void QStylePainter::drawComplexControlMask(QStyle::ComplexControl cc,
                                                   const QStyleOptionComplex &option);

    Use the widget's style to draw a complex control element's mask \a cc
    specified by QStyleOptionComplex \a option.

    \sa QStyle::drawComplexControlMask()
*/

/*!
    \fn void QStylePainter::drawItem(const QRect &rect, int flags, const QPalette &pal,
                                     bool enabled, const QString &text, int len = -1,
                                     const QColor *penColor = 0)

    Draws the \a text in rectangle \a rect and palette \a pal.

    The pen color is specified with \a penColor. The
    \a enabled bool indicates whether or not the item is enabled;
    when reimplementing this bool should influence how the item is
    drawn.

    If \a len is -1 (the default), all the \a text is drawn;
    otherwise only the first \a len characters of \a text are drawn.
    The text is aligned and wrapped according to \a
    flags.

    \sa QStyle::drawItem(), Qt::Alignment
*/

/*!
    \fn void QStylePainter::drawItem(const QRect &rect, int flags, const QPalette &pal,
                                     bool enabled, const QPixmap &pixmap,
                                     const QColor *penColor = 0)

    \overload

    Draws the \a pixmap in rectangle \a rect using palette \a pal.

    \sa QStyle::drawItem()
*/


/*!
    \fn void QStylePainter::drawItem(const QRect &rect, int flags, const QPalette &pal,
                                     bool enabled, const QPixmap &pixmap, const QString &text,
                                     int len = -1, const QColor *penColor = 0)

    \overload

    Draws the \a pixmap or \a text in rectangle \a rect using palette \a pal.

    \sa QStyle::drawItem()
*/

/*!
    \fn QStyle *QStylePainter::style() const

    Return the current style used by the QStylePainter.
*/
