| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information ([email protected])
|
|---|
| 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 [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #ifndef QPAINTENGINE_H
|
|---|
| 43 | #define QPAINTENGINE_H
|
|---|
| 44 |
|
|---|
| 45 | #include <QtCore/qnamespace.h>
|
|---|
| 46 | #include <QtCore/qobjectdefs.h>
|
|---|
| 47 | #include <QtGui/qpainter.h>
|
|---|
| 48 |
|
|---|
| 49 | QT_BEGIN_HEADER
|
|---|
| 50 |
|
|---|
| 51 | QT_BEGIN_NAMESPACE
|
|---|
| 52 |
|
|---|
| 53 | QT_MODULE(Gui)
|
|---|
| 54 |
|
|---|
| 55 | class QFontEngine;
|
|---|
| 56 | class QLineF;
|
|---|
| 57 | class QPaintDevice;
|
|---|
| 58 | class QPaintEnginePrivate;
|
|---|
| 59 | class QPainterPath;
|
|---|
| 60 | class QPointF;
|
|---|
| 61 | class QPolygonF;
|
|---|
| 62 | class QRectF;
|
|---|
| 63 | struct QGlyphLayout;
|
|---|
| 64 | class QTextItemInt;
|
|---|
| 65 | class QPaintEngineState;
|
|---|
| 66 |
|
|---|
| 67 | class Q_GUI_EXPORT QTextItem {
|
|---|
| 68 | public:
|
|---|
| 69 | enum RenderFlag {
|
|---|
| 70 | RightToLeft = 0x1,
|
|---|
| 71 | Overline = 0x10,
|
|---|
| 72 | Underline = 0x20,
|
|---|
| 73 | StrikeOut = 0x40,
|
|---|
| 74 |
|
|---|
| 75 | Dummy = 0xffffffff
|
|---|
| 76 | };
|
|---|
| 77 | Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
|
|---|
| 78 | qreal descent() const;
|
|---|
| 79 | qreal ascent() const;
|
|---|
| 80 | qreal width() const;
|
|---|
| 81 |
|
|---|
| 82 | RenderFlags renderFlags() const;
|
|---|
| 83 | QString text() const;
|
|---|
| 84 | QFont font() const;
|
|---|
| 85 | };
|
|---|
| 86 | Q_DECLARE_TYPEINFO(QTextItem, Q_PRIMITIVE_TYPE);
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 | class Q_GUI_EXPORT QPaintEngine
|
|---|
| 90 | {
|
|---|
| 91 | Q_DECLARE_PRIVATE(QPaintEngine)
|
|---|
| 92 | public:
|
|---|
| 93 | enum PaintEngineFeature {
|
|---|
| 94 | PrimitiveTransform = 0x00000001, // Can transform primitives brushes
|
|---|
| 95 | PatternTransform = 0x00000002, // Can transform pattern brushes
|
|---|
| 96 | PixmapTransform = 0x00000004, // Can transform pixmaps
|
|---|
| 97 | PatternBrush = 0x00000008, // Can fill with pixmaps and standard patterns
|
|---|
| 98 | LinearGradientFill = 0x00000010, // Can fill gradient areas
|
|---|
| 99 | RadialGradientFill = 0x00000020, // Can render radial gradients
|
|---|
| 100 | ConicalGradientFill = 0x00000040, // Can render conical gradients
|
|---|
| 101 | AlphaBlend = 0x00000080, // Can do source over alpha blend
|
|---|
| 102 | PorterDuff = 0x00000100, // Can do general porter duff compositions
|
|---|
| 103 | PainterPaths = 0x00000200, // Can fill, outline and clip paths
|
|---|
| 104 | Antialiasing = 0x00000400, // Can antialias lines
|
|---|
| 105 | BrushStroke = 0x00000800, // Can render brush based pens
|
|---|
| 106 | ConstantOpacity = 0x00001000, // Can render at constant opacity
|
|---|
| 107 | MaskedBrush = 0x00002000, // Can fill with textures that has an alpha channel or mask
|
|---|
| 108 | PerspectiveTransform = 0x00004000, // Can do perspective transformations
|
|---|
| 109 | BlendModes = 0x00008000, // Can do extended Porter&Duff composition
|
|---|
|
|---|