Changeset 561 for trunk/src/gui/kernel/qevent.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/kernel/qevent.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 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. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 53 53 #include <QtGui/qdrag.h> 54 54 #include <QtCore/qvariant.h> 55 #include <QtCore/qmap.h> 56 #include <QtCore/qset.h> 55 57 56 58 QT_BEGIN_HEADER … … 61 63 62 64 class QAction; 65 class QGesture; 63 66 64 67 class Q_GUI_EXPORT QInputEvent : public QEvent … … 68 71 ~QInputEvent(); 69 72 inline Qt::KeyboardModifiers modifiers() const { return modState; } 73 inline void setModifiers(Qt::KeyboardModifiers amodifiers) { modState = amodifiers; } 70 74 protected: 71 75 Qt::KeyboardModifiers modState; … … 242 246 int modifiers, const QString& text = QString(), 243 247 bool autorep = false, ushort count = 1) 244 : QInputEvent(type, (Qt::KeyboardModifiers)(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key),248 : QInputEvent(type, Qt::KeyboardModifiers(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key), 245 249 c(count), autor(autorep) 246 250 { … … 425 429 Cursor, 426 430 Language, 427 Ruby 431 Ruby, 432 Selection 428 433 }; 429 434 class Attribute { … … 634 639 public: 635 640 QFileOpenEvent(const QString &file); 641 QFileOpenEvent(const QUrl &url); 636 642 ~QFileOpenEvent(); 637 643 638 644 inline QString file() const { return f; } 645 QUrl url() const; 639 646 private: 640 647 QString f; … … 681 688 ~QClipboardEvent(); 682 689 683 QEventPrivate *data() { return d; } ;690 QEventPrivate *data() { return d; } 684 691 }; 685 692 #endif … … 720 727 #endif // QT_NO_SHORTCUT 721 728 729 class QTouchEventTouchPointPrivate; 730 class Q_GUI_EXPORT QTouchEvent : public QInputEvent 731 { 732 public: 733 class Q_GUI_EXPORT TouchPoint 734 { 735 public: 736 TouchPoint(int id = -1); 737 TouchPoint(const QTouchEvent::TouchPoint &other); 738 ~TouchPoint(); 739 740 int id() const; 741 742 Qt::TouchPointState state() const; 743 bool isPrimary() const; 744 745 QPointF pos() const; 746 QPointF startPos() const; 747 QPointF lastPos() const; 748 749 QPointF scenePos() const; 750 QPointF startScenePos() const; 751 QPointF lastScenePos() const; 752 753 QPointF screenPos() const; 754 QPointF startScreenPos() const; 755 QPointF lastScreenPos() const; 756 757 QPointF normalizedPos() const; 758 QPointF startNormalizedPos() const; 759 QPointF lastNormalizedPos() const; 760 761 QRectF rect() const; 762 QRectF sceneRect() const; 763 QRectF screenRect() const; 764 765 qreal pressure() const; 766 767 // internal 768 void setId(int id); 769 void setState(Qt::TouchPointStates state); 770 void setPos(const QPointF &pos); 771 void setScenePos(const QPointF &scenePos); 772 void setScreenPos(const QPointF &screenPos); 773 void setNormalizedPos(const QPointF &normalizedPos); 774 void setStartPos(const QPointF &startPos); 775 void setStartScenePos(const QPointF &startScenePos); 776 void setStartScreenPos(const QPointF &startScreenPos); 777 void setStartNormalizedPos(const QPointF &startNormalizedPos); 778 void setLastPos(const QPointF &lastPos); 779 void setLastScenePos(const QPointF &lastScenePos); 780 void setLastScreenPos(const QPointF &lastScreenPos); 781 void setLastNormalizedPos(const QPointF &lastNormalizedPos); 782 void setRect(const QRectF &rect); 783 void setSceneRect(const QRectF &sceneRect); 784 void setScreenRect(const QRectF &screenRect); 785 void setPressure(qreal pressure); 786 QTouchEvent::TouchPoint &operator=(const QTouchEvent::TouchPoint &other); 787 788 private: 789 QTouchEventTouchPointPrivate *d; 790 friend class QApplication; 791 friend class QApplicationPrivate; 792 }; 793 794 enum DeviceType { 795 TouchScreen, 796 TouchPad 797 }; 798 799 QTouchEvent(QEvent::Type eventType, 800 QTouchEvent::DeviceType deviceType = TouchScreen, 801 Qt::KeyboardModifiers modifiers = Qt::NoModifier, 802 Qt::TouchPointStates touchPointStates = 0, 803 const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>()); 804 ~QTouchEvent(); 805 806 inline QWidget *widget() const { return _widget; } 807 inline QTouchEvent::DeviceType deviceType() const { return _deviceType; } 808 inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; } 809 inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; } 810 811 // internal 812 inline void setWidget(QWidget *awidget) { _widget = awidget; } 813 inline void setDeviceType(DeviceType adeviceType) { _deviceType = adeviceType; } 814 inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; } 815 inline void setTouchPoints(const QList<QTouchEvent::TouchPoint> &atouchPoints) { _touchPoints = atouchPoints; } 816 817 protected: 818 QWidget *_widget; 819 QTouchEvent::DeviceType _deviceType; 820 Qt::TouchPointStates _touchPointStates; 821 QList<QTouchEvent::TouchPoint> _touchPoints; 822 823 friend class QApplication; 824 friend class QApplicationPrivate; 825 }; 826 827 class QGesture; 828 class QGestureEventPrivate; 829 class Q_GUI_EXPORT QGestureEvent : public QEvent 830 { 831 public: 832 QGestureEvent(const QList<QGesture *> &gestures); 833 ~QGestureEvent(); 834 835 QList<QGesture *> gestures() const; 836 QGesture *gesture(Qt::GestureType type) const; 837 838 QList<QGesture *> activeGestures() const; 839 QList<QGesture *> canceledGestures() const; 840 841 #ifdef Q_NO_USING_KEYWORD 842 inline void setAccepted(bool accepted) { QEvent::setAccepted(accepted); } 843 inline bool isAccepted() const { return QEvent::isAccepted(); } 844 845 inline void accept() { QEvent::accept(); } 846 inline void ignore() { QEvent::ignore(); } 847 #else 848 using QEvent::setAccepted; 849 using QEvent::isAccepted; 850 using QEvent::accept; 851 using QEvent::ignore; 852 #endif 853 854 void setAccepted(QGesture *, bool); 855 void accept(QGesture *); 856 void ignore(QGesture *); 857 bool isAccepted(QGesture *) const; 858 859 void setAccepted(Qt::GestureType, bool); 860 void accept(Qt::GestureType); 861 void ignore(Qt::GestureType); 862 bool isAccepted(Qt::GestureType) const; 863 864 void setWidget(QWidget *widget); 865 QWidget *widget() const; 866 867 #ifndef QT_NO_GRAPHICSVIEW 868 QPointF mapToGraphicsScene(const QPointF &gesturePoint) const; 869 #endif 870 871 private: 872 QGestureEventPrivate *d_func(); 873 const QGestureEventPrivate *d_func() const; 874 875 friend class QApplication; 876 friend class QGestureManager; 877 }; 878 722 879 QT_END_NAMESPACE 723 880
Note:
See TracChangeset
for help on using the changeset viewer.