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