| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information (qt-info@nokia.com)
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the QtGui module of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** package.
|
|---|
| 27 | **
|
|---|
| 28 | ** GNU General Public License Usage
|
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ** packaging of this file. Please review the following information to
|
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | **
|
|---|
| 36 | ** If you are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department at qt-sales@nokia.com.
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #ifndef QDRAWUTIL_H
|
|---|
| 43 | #define QDRAWUTIL_H
|
|---|
| 44 |
|
|---|
| 45 | #include <QtCore/qnamespace.h>
|
|---|
| 46 | #include <QtCore/qstring.h> // char*->QString conversion
|
|---|
| 47 |
|
|---|
| 48 | QT_BEGIN_HEADER
|
|---|
| 49 |
|
|---|
| 50 | QT_BEGIN_NAMESPACE
|
|---|
| 51 |
|
|---|
| 52 | QT_MODULE(Gui)
|
|---|
| 53 |
|
|---|
| 54 | class QPainter;
|
|---|
| 55 | #ifndef QT3_SUPPORT
|
|---|
| 56 | class QColorGroup;
|
|---|
| 57 | #endif
|
|---|
| 58 | class QPalette;
|
|---|
| 59 | class QPoint;
|
|---|
| 60 | class QColor;
|
|---|
| 61 | class QBrush;
|
|---|
| 62 | class QRect;
|
|---|
| 63 | class QPixmap;
|
|---|
| 64 |
|
|---|
| 65 | //
|
|---|
| 66 | // Standard shade drawing
|
|---|
| 67 | //
|
|---|
| 68 |
|
|---|
| 69 | Q_GUI_EXPORT void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2,
|
|---|
| 70 | const QPalette &pal, bool sunken = true,
|
|---|
| 71 | int lineWidth = 1, int midLineWidth = 0);
|
|---|
| 72 |
|
|---|
| 73 | Q_GUI_EXPORT void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint &p2,
|
|---|
| 74 | const QPalette &pal, bool sunken = true,
|
|---|
| 75 | int lineWidth = 1, int midLineWidth = 0);
|
|---|
| 76 |
|
|---|
| 77 | Q_GUI_EXPORT void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
|
|---|
| 78 | const QPalette &pal, bool sunken = false,
|
|---|
| 79 | int lineWidth = 1, int midLineWidth = 0,
|
|---|
| 80 | const QBrush *fill = 0);
|
|---|
| 81 |
|
|---|
| 82 | Q_GUI_EXPORT void qDrawShadeRect(QPainter *p, const QRect &r,
|
|---|
| 83 | const QPalette &pal, bool sunken = false,
|
|---|
| 84 | int lineWidth = 1, int midLineWidth = 0,
|
|---|
| 85 | const QBrush *fill = 0);
|
|---|
| 86 |
|
|---|
| 87 | Q_GUI_EXPORT void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
|
|---|
| 88 | const QPalette &pal, bool sunken = false,
|
|---|
| 89 | int lineWidth = 1, const QBrush *fill = 0);
|
|---|
| 90 |
|
|---|
| 91 | Q_GUI_EXPORT void qDrawShadePanel(QPainter *p, const QRect &r,
|
|---|
| 92 | const QPalette &pal, bool sunken = false,
|
|---|
| 93 | int lineWidth = 1, const QBrush *fill = 0);
|
|---|
| 94 |
|
|---|
| 95 | Q_GUI_EXPORT void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
|
|---|
| 96 | const QPalette &pal, bool sunken = false,
|
|---|
| 97 | const QBrush *fill = 0);
|
|---|
| 98 |
|
|---|
| 99 | Q_GUI_EXPORT void qDrawWinButton(QPainter *p, const QRect &r,
|
|---|
| 100 | const QPalette &pal, bool sunken = false,
|
|---|
| 101 | const QBrush *fill = 0);
|
|---|
| 102 |
|
|---|
| 103 | Q_GUI_EXPORT void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
|
|---|
| 104 | const QPalette &pal, bool sunken = false,
|
|---|
| 105 | const QBrush *fill = 0);
|
|---|
| 106 |
|
|---|
| 107 | Q_GUI_EXPORT void qDrawWinPanel(QPainter *p, const QRect &r,
|
|---|
| 108 | const QPalette &pal, bool sunken = false,
|
|---|
| 109 | const QBrush *fill = 0);
|
|---|
| 110 |
|
|---|
| 111 | Q_GUI_EXPORT void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
|
|---|
| 112 | int lineWidth = 1, const QBrush *fill = 0);
|
|---|
| 113 |
|
|---|
| 114 | Q_GUI_EXPORT void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
|
|---|
| 115 | int lineWidth = 1, const QBrush *fill = 0);
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 | #ifdef QT3_SUPPORT
|
|---|
| 119 | //
|
|---|
| 120 | // Use QStyle::itemRect(), QStyle::drawItem() and QStyle::drawArrow() instead.
|
|---|
| 121 | //
|
|---|
| 122 | Q_GUI_EXPORT QT3_SUPPORT QRect qItemRect(QPainter *p, Qt::GUIStyle gs, int x, int y, int w, int h,
|
|---|
| 123 | int flags, bool enabled,
|
|---|
| 124 | const QPixmap *pixmap, const QString& text, int len=-1);
|
|---|
| 125 |
|
|---|
| 126 | Q_GUI_EXPORT QT3_SUPPORT void qDrawItem(QPainter *p, Qt::GUIStyle gs, int x, int y, int w, int h,
|
|---|
| 127 | int flags, const QPalette &pal, bool enabled,
|
|---|
| 128 | const QPixmap *pixmap, const QString& text,
|
|---|
| 129 | int len=-1, const QColor* penColor = 0);
|
|---|
| 130 |
|
|---|
| 131 | Q_GUI_EXPORT QT3_SUPPORT void qDrawArrow(QPainter *p, Qt::ArrowType type, Qt::GUIStyle style, bool down,
|
|---|
| 132 | int x, int y, int w, int h,
|
|---|
| 133 | const QPalette &pal, bool enabled);
|
|---|
| 134 | #endif
|
|---|
| 135 |
|
|---|
| 136 | QT_END_NAMESPACE
|
|---|
| 137 |
|
|---|
| 138 | QT_END_HEADER
|
|---|
| 139 |
|
|---|
| 140 | #endif // QDRAWUTIL_H
|
|---|