00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QCOREEVENT_H
00043 #define QCOREEVENT_H
00044
00045 #include <QtCore/qnamespace.h>
00046 #include <QtCore/qbytearray.h>
00047 #include <QtCore/qobjectdefs.h>
00048
00049 QT_BEGIN_HEADER
00050
00051 QT_BEGIN_NAMESPACE
00052
00053 QT_MODULE(Core)
00054
00055 class QEventPrivate;
00056 class Q_CORE_EXPORT QEvent
00057 {
00058 Q_GADGET
00059 QDOC_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
00060 Q_ENUMS(Type)
00061 public:
00062 enum Type {
00063
00064
00065
00066
00067
00068
00069 None = 0,
00070 Timer = 1,
00071 MouseButtonPress = 2,
00072 MouseButtonRelease = 3,
00073 MouseButtonDblClick = 4,
00074 MouseMove = 5,
00075 KeyPress = 6,
00076 KeyRelease = 7,
00077 FocusIn = 8,
00078 FocusOut = 9,
00079 Enter = 10,
00080 Leave = 11,
00081 Paint = 12,
00082 Move = 13,
00083 Resize = 14,
00084 Create = 15,
00085 Destroy = 16,
00086 Show = 17,
00087 Hide = 18,
00088 Close = 19,
00089 Quit = 20,
00090 ParentChange = 21,
00091 ParentAboutToChange = 131,
00092 #ifdef QT3_SUPPORT
00093 Reparent = ParentChange,
00094 #endif
00095 ThreadChange = 22,
00096 WindowActivate = 24,
00097 WindowDeactivate = 25,
00098 ShowToParent = 26,
00099 HideToParent = 27,
00100 Wheel = 31,
00101 WindowTitleChange = 33,
00102 WindowIconChange = 34,
00103 ApplicationWindowIconChange = 35,
00104 ApplicationFontChange = 36,
00105 ApplicationLayoutDirectionChange = 37,
00106 ApplicationPaletteChange = 38,
00107 PaletteChange = 39,
00108 Clipboard = 40,
00109 Speech = 42,
00110 MetaCall = 43,
00111 SockAct = 50,
00112 WinEventAct = 132,
00113 DeferredDelete = 52,
00114 DragEnter = 60,
00115 DragMove = 61,
00116 DragLeave = 62,
00117 Drop = 63,
00118 DragResponse = 64,
00119 ChildAdded = 68,
00120 ChildPolished = 69,
00121 #ifdef QT3_SUPPORT
00122 ChildInsertedRequest = 67,
00123 ChildInserted = 70,
00124 LayoutHint = 72,
00125 #endif
00126 ChildRemoved = 71,
00127 ShowWindowRequest = 73,
00128 PolishRequest = 74,
00129 Polish = 75,
00130 LayoutRequest = 76,
00131 UpdateRequest = 77,
00132 UpdateLater = 78,
00133
00134 EmbeddingControl = 79,
00135 ActivateControl = 80,
00136 DeactivateControl = 81,
00137 ContextMenu = 82,
00138 InputMethod = 83,
00139 AccessibilityPrepare = 86,
00140 TabletMove = 87,
00141 LocaleChange = 88,
00142 LanguageChange = 89,
00143 LayoutDirectionChange = 90,
00144 Style = 91,
00145 TabletPress = 92,
00146 TabletRelease = 93,
00147 OkRequest = 94,
00148 HelpRequest = 95,
00149
00150 IconDrag = 96,
00151
00152 FontChange = 97,
00153 EnabledChange = 98,
00154 ActivationChange = 99,
00155 StyleChange = 100,
00156 IconTextChange = 101,
00157 ModifiedChange = 102,
00158 MouseTrackingChange = 109,
00159
00160 WindowBlocked = 103,
00161 WindowUnblocked = 104,
00162 WindowStateChange = 105,
00163
00164 ToolTip = 110,
00165 WhatsThis = 111,
00166 StatusTip = 112,
00167
00168 ActionChanged = 113,
00169 ActionAdded = 114,
00170 ActionRemoved = 115,
00171
00172 FileOpen = 116,
00173
00174 Shortcut = 117,
00175 ShortcutOverride = 51,
00176
00177 #ifdef QT3_SUPPORT
00178 Accel = 30,
00179 AccelAvailable = 32,
00180 AccelOverride = ShortcutOverride,
00181 #endif
00182
00183 WhatsThisClicked = 118,
00184
00185 #ifdef QT3_SUPPORT
00186 CaptionChange = WindowTitleChange,
00187 IconChange = WindowIconChange,
00188 #endif
00189 ToolBarChange = 120,
00190
00191 ApplicationActivate = 121,
00192 ApplicationActivated = ApplicationActivate,
00193 ApplicationDeactivate = 122,
00194 ApplicationDeactivated = ApplicationDeactivate,
00195
00196 QueryWhatsThis = 123,
00197 EnterWhatsThisMode = 124,
00198 LeaveWhatsThisMode = 125,
00199
00200 ZOrderChange = 126,
00201
00202 HoverEnter = 127,
00203 HoverLeave = 128,
00204 HoverMove = 129,
00205
00206 AccessibilityHelp = 119,
00207 AccessibilityDescription = 130,
00208
00209
00210
00211 #ifdef QT_KEYPAD_NAVIGATION
00212 EnterEditFocus = 150,
00213 LeaveEditFocus = 151,
00214 #endif
00215 AcceptDropsChange = 152,
00216
00217 MenubarUpdated = 153,
00218
00219
00220 ZeroTimerEvent = 154,
00221
00222 GraphicsSceneMouseMove = 155,
00223 GraphicsSceneMousePress = 156,
00224 GraphicsSceneMouseRelease = 157,
00225 GraphicsSceneMouseDoubleClick = 158,
00226 GraphicsSceneContextMenu = 159,
00227 GraphicsSceneHoverEnter = 160,
00228 GraphicsSceneHoverMove = 161,
00229 GraphicsSceneHoverLeave = 162,
00230 GraphicsSceneHelp = 163,
00231 GraphicsSceneDragEnter = 164,
00232 GraphicsSceneDragMove = 165,
00233 GraphicsSceneDragLeave = 166,
00234 GraphicsSceneDrop = 167,
00235 GraphicsSceneWheel = 168,
00236
00237 KeyboardLayoutChange = 169,
00238
00239 DynamicPropertyChange = 170,
00240
00241 TabletEnterProximity = 171,
00242 TabletLeaveProximity = 172,
00243
00244 NonClientAreaMouseMove = 173,
00245 NonClientAreaMouseButtonPress = 174,
00246 NonClientAreaMouseButtonRelease = 175,
00247 NonClientAreaMouseButtonDblClick = 176,
00248
00249 MacSizeChange = 177,
00250
00251 ContentsRectChange = 178,
00252
00253 MacGLWindowChange = 179,
00254
00255 FutureCallOut = 180,
00256
00257 GraphicsSceneResize = 181,
00258 GraphicsSceneMove = 182,
00259
00260 CursorChange = 183,
00261 ToolTipChange = 184,
00262
00263 NetworkReplyUpdated = 185,
00264
00265 GrabMouse = 186,
00266 UngrabMouse = 187,
00267 GrabKeyboard = 188,
00268 UngrabKeyboard = 189,
00269 MacGLClearDrawable = 191,
00270
00271 StateMachineSignal = 192,
00272 StateMachineWrapped = 193,
00273
00274 TouchBegin = 194,
00275 TouchUpdate = 195,
00276 TouchEnd = 196,
00277
00278 #ifndef QT_NO_GESTURES
00279 NativeGesture = 197,
00280 #endif
00281 RequestSoftwareInputPanel = 199,
00282 CloseSoftwareInputPanel = 200,
00283
00284 UpdateSoftKeys = 201,
00285
00286 WinIdChange = 203,
00287 #ifndef QT_NO_GESTURES
00288 Gesture = 198,
00289 GestureOverride = 202,
00290 #endif
00291
00292
00293
00294 User = 1000,
00295 MaxUser = 65535
00296 };
00297
00298 QEvent(Type type);
00299 virtual ~QEvent();
00300 inline Type type() const { return static_cast<Type>(t); }
00301 inline bool spontaneous() const { return spont; }
00302
00303 inline void setAccepted(bool accepted) { m_accept = accepted; }
00304 inline bool isAccepted() const { return m_accept; }
00305
00306 inline void accept() { m_accept = true; }
00307 inline void ignore() { m_accept = false; }
00308
00309 static int registerEventType(int hint = -1);
00310
00311 protected:
00312 QEventPrivate *d;
00313 ushort t;
00314
00315 private:
00316 ushort posted : 1;
00317 ushort spont : 1;
00318 ushort m_accept : 1;
00319 ushort reserved : 13;
00320
00321 friend class QCoreApplication;
00322 friend class QCoreApplicationPrivate;
00323 friend class QThreadData;
00324 friend class QApplication;
00325 friend class QApplicationPrivate;
00326 friend class Q3AccelManager;
00327 friend class QShortcutMap;
00328 friend class QETWidget;
00329 friend class QGraphicsView;
00330 friend class QGraphicsViewPrivate;
00331 friend class QGraphicsScenePrivate;
00332 #ifndef QT_NO_GESTURES
00333 friend class QGestureManager;
00334 #endif
00335 };
00336
00337 class Q_CORE_EXPORT QTimerEvent : public QEvent
00338 {
00339 public:
00340 QTimerEvent( int timerId );
00341 ~QTimerEvent();
00342 int timerId() const { return id; }
00343 protected:
00344 int id;
00345 };
00346
00347 class QObject;
00348
00349 class Q_CORE_EXPORT QChildEvent : public QEvent
00350 {
00351 public:
00352 QChildEvent( Type type, QObject *child );
00353 ~QChildEvent();
00354 QObject *child() const { return c; }
00355 bool added() const { return type() == ChildAdded; }
00356 #ifdef QT3_SUPPORT
00357 QT3_SUPPORT bool inserted() const { return type() == ChildInserted; }
00358 #endif
00359 bool polished() const { return type() == ChildPolished; }
00360 bool removed() const { return type() == ChildRemoved; }
00361 protected:
00362 QObject *c;
00363 };
00364
00365 #ifdef QT3_SUPPORT
00366 class Q_CORE_EXPORT QCustomEvent : public QEvent
00367 {
00368 public:
00369 QT3_SUPPORT_CONSTRUCTOR QCustomEvent(int type, void *data = 0);
00370 ~QCustomEvent();
00371 QT3_SUPPORT void *data() const { return d; }
00372 QT3_SUPPORT void setData(void* aData) { d = reinterpret_cast<QEventPrivate *>(aData); }
00373 };
00374 #endif
00375
00376 class Q_CORE_EXPORT QDynamicPropertyChangeEvent : public QEvent
00377 {
00378 public:
00379 QDynamicPropertyChangeEvent(const QByteArray &name);
00380 ~QDynamicPropertyChangeEvent();
00381
00382 inline QByteArray propertyName() const { return n; }
00383
00384 private:
00385 QByteArray n;
00386 };
00387
00388 QT_END_NAMESPACE
00389
00390 QT_END_HEADER
00391
00392 #endif // QCOREEVENT_H