~ubuntu-branches/ubuntu/precise/qt4-x11/precise-proposed

« back to all changes in this revision

Viewing changes to .pc/kubuntu_97_a11y_qt_and_qml_backport.diff/src/declarative/graphicsitems/qdeclarativeitem.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Jonathan Riddell, Felix Geyer
  • Date: 2011-11-01 16:23:55 UTC
  • mfrom: (15.3.22 sid)
  • Revision ID: package-import@ubuntu.com-20111101162355-4dhsj6563ii8enl6
Tags: 4:4.7.4-1ubuntu1
[ Jonathan Riddell ]
* Merge from Debian Git packaging.  Remaining Ubuntu changes:
  - Do not package ibase/firebird package, remove from debian/rules and
    debian/control
  - libqt4-sql-ibase not recommend for libqt4-sql
  - build with -no-phonon
  - do not build libqt4-phonon, disable in debian/control
  - Build packages with lzma compression using the dh addon from pkg-kde-tools
  - Rules to remove po dir in clean
  - Add MessagesQt.sh
  - Rules to create Messages.sh link to MessagesQt.sh and rules to create po
    dir and exectue extract-messages.sh in common-install-prehook-impl
  - Make libqt4-dev depend on libx11-dev
  - Add and install Trolltech.conf in libqtcore4.install
  - Build QtWebkit and use it only for QtAssistant
    + Rule to put qt_webkit_version.pri in mkspecs/modules
    + Rule to remove libQtWebKit* after build
    + Exclude usr/bin/assistant-qt4 from dh_shlibdeps
  - Fix Lucid upgrades: libqt4-help breaks/replaces libqtcore4 (<< 4:4.7.0)
  - Change OpenGL backend from GL to GLES 2 for armel (Debian does this for
    armhf)
    + Build-depend and make libqt4-opengl-dev depend on libgles2-mesa-dev
      instead of libgl1-mesa-dev and libglu1-mesa-dev
    + Pass "-opengl es2" to configure
  - Pass extra_configure_opts += -arch armv6 on both armel and armhf and not
    just armhf
  - In debian/rules Move documentation building to override_dh_auto_install where
    dh_listpackages works as expected with dpkg-buildpackage. (LP: #857377)
  - debian/compat is 9 and build-depend on newer debhelper for multiarch
* debian/patches/blacklist-diginotar-certs.diff is now
  debian/patches/blacklist-diginotar-cert.diff to match Debian
* Add prefix to some patches to clarify they come from Ubuntu rather than Debian
 - kubuntu_97_a11y_qt_and_qml_backport.diff
 - kubuntu_98_fix_accessible_menu.diff
 - kubuntu_99_notify_qml_name_description_change.diff

[ Felix Geyer ]
* Use DEB_*_MAINT_APPEND instead of setting CXXFLAGS and LDFLAGS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 
4
** All rights reserved.
 
5
** Contact: Nokia Corporation (qt-info@nokia.com)
 
6
**
 
7
** This file is part of the QtDeclarative module of the Qt Toolkit.
 
8
**
 
9
** $QT_BEGIN_LICENSE:LGPL$
 
10
** GNU Lesser General Public License Usage
 
11
** This file may be used under the terms of the GNU Lesser General Public
 
12
** License version 2.1 as published by the Free Software Foundation and
 
13
** appearing in the file LICENSE.LGPL included in the packaging of this
 
14
** file. Please review the following information to ensure the GNU Lesser
 
15
** General Public License version 2.1 requirements will be met:
 
16
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
17
**
 
18
** In addition, as a special exception, Nokia gives you certain additional
 
19
** rights. These rights are described in the Nokia Qt LGPL Exception
 
20
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
21
**
 
22
** GNU General Public License Usage
 
23
** Alternatively, this file may be used under the terms of the GNU General
 
24
** Public License version 3.0 as published by the Free Software Foundation
 
25
** and appearing in the file LICENSE.GPL included in the packaging of this
 
26
** file. Please review the following information to ensure the GNU General
 
27
** Public License version 3.0 requirements will be met:
 
28
** http://www.gnu.org/copyleft/gpl.html.
 
29
**
 
30
** Other Usage
 
31
** Alternatively, this file may be used in accordance with the terms and
 
32
** conditions contained in a signed written agreement between you and Nokia.
 
33
**
 
34
**
 
35
**
 
36
**
 
37
**
 
38
** $QT_END_LICENSE$
 
39
**
 
40
****************************************************************************/
 
41
 
 
42
#ifndef QDECLARATIVEITEM_H
 
43
#define QDECLARATIVEITEM_H
 
44
 
 
45
#include <QtDeclarative/qdeclarative.h>
 
46
#include <QtDeclarative/qdeclarativecomponent.h>
 
47
 
 
48
#include <QtCore/QObject>
 
49
#include <QtCore/QList>
 
50
#include <QtGui/qgraphicsitem.h>
 
51
#include <QtGui/qgraphicstransform.h>
 
52
#include <QtGui/qfont.h>
 
53
#include <QtGui/qaction.h>
 
54
 
 
55
QT_BEGIN_HEADER
 
56
 
 
57
QT_BEGIN_NAMESPACE
 
58
 
 
59
QT_MODULE(Declarative)
 
60
 
 
61
class QDeclarativeState;
 
62
class QDeclarativeAnchorLine;
 
63
class QDeclarativeTransition;
 
64
class QDeclarativeKeyEvent;
 
65
class QDeclarativeAnchors;
 
66
class QDeclarativeItemPrivate;
 
67
class Q_DECLARATIVE_EXPORT QDeclarativeItem : public QGraphicsObject, public QDeclarativeParserStatus
 
68
{
 
69
    Q_OBJECT
 
70
    Q_INTERFACES(QDeclarativeParserStatus)
 
71
 
 
72
    Q_PROPERTY(QDeclarativeItem * parent READ parentItem WRITE setParentItem NOTIFY parentChanged DESIGNABLE false FINAL)
 
73
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QObject> data READ data DESIGNABLE false)
 
74
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QObject> resources READ resources DESIGNABLE false)
 
75
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QDeclarativeState> states READ states DESIGNABLE false)
 
76
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitions DESIGNABLE false)
 
77
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QString state READ state WRITE setState NOTIFY stateChanged)
 
78
    Q_PROPERTY(QRectF childrenRect READ childrenRect NOTIFY childrenRectChanged DESIGNABLE false FINAL)
 
79
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL)
 
80
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine left READ left CONSTANT FINAL)
 
81
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine right READ right CONSTANT FINAL)
 
82
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine horizontalCenter READ horizontalCenter CONSTANT FINAL)
 
83
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine top READ top CONSTANT FINAL)
 
84
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine bottom READ bottom CONSTANT FINAL)
 
85
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine verticalCenter READ verticalCenter CONSTANT FINAL)
 
86
    Q_PRIVATE_PROPERTY(QDeclarativeItem::d_func(), QDeclarativeAnchorLine baseline READ baseline CONSTANT FINAL)
 
87
    Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
 
88
    Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged) // ### move to QGI/QGO, NOTIFY
 
89
    Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL)
 
90
    Q_PROPERTY(bool activeFocus READ hasActiveFocus NOTIFY activeFocusChanged)
 
91
    Q_PROPERTY(QDeclarativeListProperty<QGraphicsTransform> transform READ transform DESIGNABLE false FINAL)
 
92
    Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged)
 
93
    Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // transformOriginPoint is read-only for Item
 
94
    Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
 
95
    Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged REVISION 1)
 
96
    Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged REVISION 1)
 
97
 
 
98
    Q_ENUMS(TransformOrigin)
 
99
    Q_CLASSINFO("DefaultProperty", "data")
 
100
 
 
101
public:
 
102
    enum TransformOrigin {
 
103
        TopLeft, Top, TopRight,
 
104
        Left, Center, Right,
 
105
        BottomLeft, Bottom, BottomRight
 
106
    };
 
107
 
 
108
    QDeclarativeItem(QDeclarativeItem *parent = 0);
 
109
    virtual ~QDeclarativeItem();
 
110
 
 
111
    QDeclarativeItem *parentItem() const;
 
112
    void setParentItem(QDeclarativeItem *parent);
 
113
 
 
114
    QRectF childrenRect();
 
115
 
 
116
    bool clip() const;
 
117
    void setClip(bool);
 
118
 
 
119
    qreal baselineOffset() const;
 
120
    void setBaselineOffset(qreal);
 
121
 
 
122
    QDeclarativeListProperty<QGraphicsTransform> transform();
 
123
 
 
124
    qreal width() const;
 
125
    void setWidth(qreal);
 
126
    void resetWidth();
 
127
    qreal implicitWidth() const;
 
128
 
 
129
    qreal height() const;
 
130
    void setHeight(qreal);
 
131
    void resetHeight();
 
132
    qreal implicitHeight() const;
 
133
 
 
134
    void setSize(const QSizeF &size);
 
135
 
 
136
    TransformOrigin transformOrigin() const;
 
137
    void setTransformOrigin(TransformOrigin);
 
138
 
 
139
    bool smooth() const;
 
140
    void setSmooth(bool);
 
141
 
 
142
    QRectF boundingRect() const;
 
143
    virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
 
144
 
 
145
    bool hasActiveFocus() const;
 
146
    bool hasFocus() const;
 
147
    void setFocus(bool);
 
148
 
 
149
    bool keepMouseGrab() const;
 
150
    void setKeepMouseGrab(bool);
 
151
 
 
152
    Q_INVOKABLE QScriptValue mapFromItem(const QScriptValue &item, qreal x, qreal y) const;
 
153
    Q_INVOKABLE QScriptValue mapToItem(const QScriptValue &item, qreal x, qreal y) const;
 
154
    Q_INVOKABLE void forceActiveFocus();
 
155
    Q_INVOKABLE QDeclarativeItem *childAt(qreal x, qreal y) const;
 
156
 
 
157
Q_SIGNALS:
 
158
    void childrenRectChanged(const QRectF &);
 
159
    void baselineOffsetChanged(qreal);
 
160
    void stateChanged(const QString &);
 
161
    void focusChanged(bool);
 
162
    void activeFocusChanged(bool);
 
163
    void parentChanged(QDeclarativeItem *);
 
164
    void transformOriginChanged(TransformOrigin);
 
165
    void smoothChanged(bool);
 
166
    void clipChanged(bool);
 
167
    Q_REVISION(1) void implicitWidthChanged();
 
168
    Q_REVISION(1) void implicitHeightChanged();
 
169
 
 
170
protected:
 
171
    bool isComponentComplete() const;
 
172
    virtual bool sceneEvent(QEvent *);
 
173
    virtual bool event(QEvent *);
 
174
    virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
 
175
 
 
176
    void setImplicitWidth(qreal);
 
177
    bool widthValid() const; // ### better name?
 
178
    void setImplicitHeight(qreal);
 
179
    bool heightValid() const; // ### better name?
 
180
 
 
181
    virtual void classBegin();
 
182
    virtual void componentComplete();
 
183
    virtual void keyPressEvent(QKeyEvent *event);
 
184
    virtual void keyReleaseEvent(QKeyEvent *event);
 
185
    virtual void inputMethodEvent(QInputMethodEvent *);
 
186
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
 
187
    void keyPressPreHandler(QKeyEvent *);
 
188
    void keyReleasePreHandler(QKeyEvent *);
 
189
    void inputMethodPreHandler(QInputMethodEvent *);
 
190
 
 
191
    virtual void geometryChanged(const QRectF &newGeometry,
 
192
                                 const QRectF &oldGeometry);
 
193
 
 
194
protected:
 
195
    QDeclarativeItem(QDeclarativeItemPrivate &dd, QDeclarativeItem *parent = 0);
 
196
 
 
197
private:
 
198
    Q_DISABLE_COPY(QDeclarativeItem)
 
199
    Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QDeclarativeItem)
 
200
};
 
201
 
 
202
template<typename T>
 
203
        T qobject_cast(QGraphicsObject *o)
 
204
{
 
205
    QObject *obj = o;
 
206
    return qobject_cast<T>(obj);
 
207
}
 
208
 
 
209
// ### move to QGO
 
210
template<typename T>
 
211
T qobject_cast(QGraphicsItem *item)
 
212
{
 
213
    if (!item) return 0;
 
214
    QObject *o = item->toGraphicsObject();
 
215
    return qobject_cast<T>(o);
 
216
}
 
217
 
 
218
#ifndef QT_NO_DEBUG_STREAM
 
219
QDebug Q_DECLARATIVE_EXPORT operator<<(QDebug debug, QDeclarativeItem *item);
 
220
#endif
 
221
 
 
222
QT_END_NAMESPACE
 
223
 
 
224
QML_DECLARE_TYPE(QDeclarativeItem)
 
225
QML_DECLARE_TYPE(QGraphicsObject)
 
226
QML_DECLARE_TYPE(QGraphicsTransform)
 
227
QML_DECLARE_TYPE(QGraphicsScale)
 
228
QML_DECLARE_TYPE(QGraphicsRotation)
 
229
QML_DECLARE_TYPE(QGraphicsWidget)
 
230
QML_DECLARE_TYPE(QAction)
 
231
 
 
232
QT_END_HEADER
 
233
 
 
234
#endif // QDECLARATIVEITEM_H