summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/src/kernel/tqevent.cpp
blob: 59a6ca788cd1faad2ebb3dc88d313fac4bd1bb6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
/****************************************************************************
**
** Implementation of event classes
**
** Created : 931029
**
** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
**
** This file is part of the kernel module of the TQt GUI Toolkit.
**
** This file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the files LICENSE.GPL2
** and LICENSE.GPL3 included in the packaging of this file.
** Alternatively you may (at your option) use any later version
** of the GNU General Public License if such license has been
** publicly approved by Trolltech ASA (or its successors, if any)
** and the KDE Free TQt Foundation.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/.
** If you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** This file may be used under the terms of the Q Public License as
** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
** included in the packaging of this file.  Licensees holding valid TQt
** Commercial licenses may use this file in accordance with the TQt
** Commercial License Agreement provided with the Software.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
** herein.
**
**********************************************************************/

#include <tqtglobaldefines.h>
#ifdef USE_QT4
// Nasty, nasty horrid HACK to get access to QFont's private members
// This is TERRIBLE and I wish there was a way around it
// See also QRect
#define private protected
#include <Qt/qevent.h>
#undef private
#endif // USE_QT4

#include "tqevent.h"
#include "tqcursor.h"
#include "tqapplication.h"

#ifdef USE_QT4

// TQFocusEvent::Reason TQFocusEvent::prev_reason = TQFocusEvent::Other;

/*!
    Sets the reason for all future focus events to \a reason.

    \sa reason(), resetReason()
 */
void TQFocusEvent::setReason( Qt::FocusReason reason )
{
    prev_reason = m_reason;
    m_reason = reason;
}

/*!
    Resets the reason for all future focus events to the value before
    the last setReason() call.

    \sa reason(), setReason()
 */
void TQFocusEvent::resetReason()
{
    m_reason = prev_reason;
}

TQt::ButtonState TQContextMenuEvent::state() const {
	return TQt::ButtonState(int(QApplication::keyboardModifiers())|QApplication::mouseButtons());
}

/*!
    \class TQCustomEvent tqevent.h
    \brief The TQCustomEvent class provides support for custom events.

    \ingroup events

    TQCustomEvent is a generic event class for user-defined events.
    User defined events can be sent to widgets or other TQObject
    instances using TQApplication::postEvent() or
    TQApplication::sendEvent(). Subclasses of TQObject can easily
    receive custom events by implementing the TQObject::customEvent()
    event handler function.

    TQCustomEvent objects should be created with a type ID that
    uniquely identifies the event type. To avoid clashes with the
    TQt-defined events types, the value should be at least as large as
    the value of the "User" entry in the TQEvent::Type enum.

    TQCustomEvent tqcontains a generic void* data member that may be used
    for transferring event-specific data to the receiver. Note that
    since events are normally delivered asynchronously, the data
    pointer, if used, must remain valid until the event has been
    received and processed.

    TQCustomEvent can be used as-is for simple user-defined event
    types, but normally you will want to make a subclass of it for
    your event types. In a subclass, you can add data members that are
    suitable for your event type.

    Example:
    \code
    class ColorChangeEvent : public TQCustomEvent
    {
    public:
	ColorChangeEvent( TQColor color )
	    : TQCustomEvent( 65432 ), c( color ) {}
	TQColor color() const { return c; }
    private:
	TQColor c;
    };

    // To send an event of this custom event type:

    ColorChangeEvent* ce = new ColorChangeEvent( blue );
    TQApplication::postEvent( receiver, ce );  // TQt will delete it when done

    // To receive an event of this custom event type:

    void MyWidget::customEvent( TQCustomEvent * e )
    {
	if ( e->type() == 65432 ) {  // It must be a ColorChangeEvent
	    ColorChangeEvent* ce = (ColorChangeEvent*)e;
	    newColor = ce->color();
	}
    }
    \endcode

    \sa TQWidget::customEvent(), TQApplication::notify()
*/


/*!
    Constructs a custom event object with event type \a type. The
    value of \a type must be at least as large as TQEvent::User. The
    data pointer is set to 0.
*/

TQCustomEvent::TQCustomEvent( int type )
    : TQEvent( (TQEvent::Type)type ), d( 0 )
{
}


/*!
    \fn TQCustomEvent::TQCustomEvent( Type type, void *data )

    Constructs a custom event object with the event type \a type and a
    pointer to \a data. (Note that any int value may safely be cast to
    TQEvent::Type).
*/


/*!
    \fn void TQCustomEvent::setData( void* data )

    Sets the generic data pointer to \a data.

    \sa data()
*/

/*!
    \fn void *TQCustomEvent::data() const

    Returns a pointer to the generic event data.

    \sa setData()
*/

#else // USE_QT4

/*!
    \class TQEvent tqevent.h
    \brief The TQEvent class is the base class of all
    event classes. Event objects contain event parameters.

    \ingroup events
    \ingroup environment

    TQt's main event loop (TQApplication::exec()) fetches native window
    system events from the event queue, translates them into TQEvents
    and sends the translated events to TQObjects.

    In general, events come from the underlying window system
    (spontaneous() returns TRUE) but it is also possible to manually
    send events using TQApplication::sendEvent() and
    TQApplication::postEvent() (spontaneous() returns FALSE).

    TQObjects receive events by having their TQObject::event() function
    called. The function can be reimplemented in subclasses to
    customize event handling and add additional event types;
    TQWidget::event() is a notable example. By default, events are
    dispatched to event handlers like TQObject::timerEvent() and
    TQWidget::mouseMoveEvent(). TQObject::installEventFilter() allows an
    object to intercept events destined for another object.

    The basic TQEvent tqcontains only an event type parameter.
    Subclasses of TQEvent contain additional parameters that describe
    the particular event.

    \sa TQObject::event() TQObject::installEventFilter()
    TQWidget::event() TQApplication::sendEvent()
    TQApplication::postEvent() TQApplication::processEvents()
*/


/*!
    \enum TQt::ButtonState

    This enum type describes the state of the mouse and the modifier
    buttons.

    \value NoButton  used when the button state does not refer to any
    button (see TQMouseEvent::button()).
    \value LeftButton  set if the left button is pressed, or if this
    event refers to the left button. (The left button may be
    the right button on left-handed mice.)
    \value RightButton  the right button.
    \value MidButton  the middle button.
    \value ShiftButton  a Shift key on the keyboard is also pressed.
    \value ControlButton  a Ctrl key on the keyboard is also pressed.
    \value AltButton  an Alt key on the keyboard is also pressed.
    \value MetaButton a Meta key on the keyboard is also pressed.
    \value Keypad  a keypad button is pressed.
    \value KeyButtonMask a tqmask for ShiftButton, ControlButton,
    AltButton and MetaButton.
    \value MouseButtonMask a tqmask for LeftButton, RightButton and MidButton.
*/

/*!
    \enum TQEvent::Type

    This enum type defines the valid event types in TQt. The event
    types and the specialized classes for each type are these:

    \value None  Not an event.
    \value Accessibility  Accessibility information is requested
    \value Timer  Regular timer events, \l{TQTimerEvent}.
    \value MouseButtonPress  Mouse press, \l{TQMouseEvent}.
    \value MouseButtonRelease  Mouse release, \l{TQMouseEvent}.
    \value MouseButtonDblClick  Mouse press again, \l{TQMouseEvent}.
    \value MouseMove  Mouse move, \l{TQMouseEvent}.
    \value KeyPress  Key press (including Shift, for example), \l{TQKeyEvent}.
    \value KeyRelease  Key release, \l{TQKeyEvent}.
    \value IMStart  The start of input method composition, \l{TQIMEvent}.
    \value IMCompose  Input method composition is taking place, \l{TQIMEvent}.
    \value IMEnd  The end of input method composition, \l{TQIMEvent}.
    \value FocusIn  Widget gains keyboard focus, \l{TQFocusEvent}.
    \value FocusOut  Widget loses keyboard focus, \l{TQFocusEvent}.
    \value Enter  Mouse enters widget's boundaries.
    \value Leave  Mouse leaves widget's boundaries.
    \value Paint  Screen update necessary, \l{TQPaintEvent}.
    \value Move  Widget's position changed, \l{TQMoveEvent}.
    \value Resize  Widget's size changed, \l{TQResizeEvent}.
    \value Show  Widget was shown on screen, \l{TQShowEvent}.
    \value Hide  Widget was hidden, \l{TQHideEvent}.
    \value ShowToParent  A child widget has been shown.
    \value HideToParent  A child widget has been hidden.
    \value Close  Widget was closed (permanently), \l{TQCloseEvent}.
    \value ShowNormal  Widget should be shown normally (obsolete).
    \value ShowMaximized  Widget should be shown maximized (obsolete).
    \value ShowMinimized  Widget should be shown minimized (obsolete).
    \value ShowFullScreen  Widget should be shown full-screen (obsolete).
    \value ShowWindowRequest  Widget's window should be shown (obsolete).
    \value DeferredDelete  The object will be deleted after it has
    cleaned up.
    \value Accel  Key press in child for shortcut key handling, \l{TQKeyEvent}.
    \value Wheel  Mouse wheel rolled, \l{TQWheelEvent}.
    \value ContextMenu  Context popup menu, \l{TQContextMenuEvent}
    \value AccelOverride  Key press in child, for overriding shortcut key handling, \l{TQKeyEvent}.
    \value AccelAvailable internal.
    \value WindowActivate  Window was activated.
    \value WindowDeactivate  Window was deactivated.
    \value CaptionChange  Widget's caption changed.
    \value IconChange  Widget's icon changed.
    \value ParentFontChange  Font of the tqparent widget changed.
    \value ApplicationFontChange  Default application font changed.
    \value PaletteChange  Palette of the widget changed.
    \value ParentPaletteChange  Palette of the tqparent widget changed.
    \value ApplicationPaletteChange  Default application palette changed.
    \value Clipboard  Clipboard contents have changed.
    \value SockAct  Socket activated, used to implement \l{TQSocketNotifier}.
    \value DragEnter  A drag-and-drop enters widget, \l{TQDragEnterEvent}.
    \value DragMove  A drag-and-drop is in progress, \l{TQDragMoveEvent}.
    \value DragLeave  A drag-and-drop leaves widget, \l{TQDragLeaveEvent}.
    \value Drop  A drag-and-drop is completed, \l{TQDropEvent}.
    \value DragResponse  Internal event used by TQt on some platforms.
    \value ChildInserted  Object gets a child, \l{TQChildEvent}.
    \value ChildRemoved  Object loses a child, \l{TQChildEvent}.
    \value LayoutHint  Widget child has changed tqlayout properties.
    \value ActivateControl  Internal event used by TQt on some platforms.
    \value DeactivateControl  Internal event used by TQt on some platforms.
    \value LanguageChange  The application translation changed, \l{TQTranslator}
    \value LayoutDirectionChange  The direction of layouts changed
    \value LocaleChange  The system locale changed
    \value Quit  Reserved.
    \value Create  Reserved.
    \value Destroy  Reserved.
    \value Retqparent  Reserved.
    \value Speech  Reserved for speech input.
    \value TabletMove  A Wacom Tablet Move Event.
    \value Style  Internal use only
    \value TabletPress  A Wacom Tablet Press Event
    \value TabletRelease  A Wacom Tablet Release Event
    \value OkRequest  Internal event used by TQt on some platforms.
    \value HelpRequest  Internal event used by TQt on some platforms.
    \value IconDrag     Internal event used by TQt on some platforms when proxy icon is dragged.
    \value WindowStateChange The window's state, i.e. minimized,
    maximized or full-screen, has changed. See \l{TQWidget::windowState()}.
    \value WindowBlocked The window is modally blocked
    \value WindowUnblocked The window leaves modal blocking

    \value User  User defined event.
    \value MaxUser  Last user event id.

    User events should have values between User and MaxUser inclusive.
*/
/*!
    \fn TQEvent::TQEvent( Type type )

    Contructs an event object of type \a type.
*/

/*!
    \fn TQEvent::Type TQEvent::type() const

    Returns the event type.
*/

/*!
    \fn bool TQEvent::spontaneous() const

    Returns TRUE if the event originated outside the application, i.e.
    it is a system event; otherwise returns FALSE.
*/


/*!
    \class TQTimerEvent tqevent.h
    \brief The TQTimerEvent class tqcontains parameters that describe a
    timer event.

    \ingroup events

    Timer events are sent at regular intervals to objects that have
    started one or more timers. Each timer has a unique identifier. A
    timer is started with TQObject::startTimer().

    The TQTimer class provides a high-level programming interface that
    uses Q_SIGNALS instead of events. It also provides one-shot timers.

    The event handler TQObject::timerEvent() receives timer events.

    \sa TQTimer, TQObject::timerEvent(), TQObject::startTimer(),
    TQObject::killTimer(), TQObject::killTimers()
*/

/*!
    \fn TQTimerEvent::TQTimerEvent( int timerId )

    Constructs a timer event object with the timer identifier set to
    \a timerId.
*/

/*!
    \fn int TQTimerEvent::timerId() const

    Returns the unique timer identifier, which is the same identifier
    as returned from TQObject::startTimer().
*/


/*!
    \class TQMouseEvent tqevent.h
    \ingroup events

    \brief The TQMouseEvent class tqcontains parameters that describe a mouse event.

    Mouse events occur when a mouse button is pressed or released
    inside a widget or when the mouse cursor is moved.

    Mouse move events will occur only when a mouse button is pressed
    down, unless mouse tracking has been enabled with
    TQWidget::setMouseTracking().

    TQt automatically grabs the mouse when a mouse button is pressed
    inside a widget; the widget will continue to receive mouse events
    until the last mouse button is released.

    A mouse event tqcontains a special accept flag that indicates
    whether the receiver wants the event. You should call
    TQMouseEvent::ignore() if the mouse event is not handled by your
    widget. A mouse event is propagated up the tqparent widget chain
    until a widget accepts it with TQMouseEvent::accept() or an event
    filter consumes it.

    The functions pos(), x() and y() give the cursor position relative
    to the widget that receives the mouse event. If you move the
    widget as a result of the mouse event, use the global position
    returned by globalPos() to avoid a shaking motion.

    The TQWidget::setEnabled() function can be used to enable or
    disable mouse and keyboard events for a widget.

    The event handlers TQWidget::mousePressEvent(),
    TQWidget::mouseReleaseEvent(), TQWidget::mouseDoubleClickEvent() and
    TQWidget::mouseMoveEvent() receive mouse events.

    \sa TQWidget::setMouseTracking(), TQWidget::grabMouse(),
    TQCursor::pos()
*/

/*!
    \fn TQMouseEvent::TQMouseEvent( Type type, const TQPoint &pos, int button, int state )

    Constructs a mouse event object.

    The \a type parameter must be one of \c TQEvent::MouseButtonPress,
    \c TQEvent::MouseButtonRelease, \c TQEvent::MouseButtonDblClick or
    \c TQEvent::MouseMove.

    The \a pos parameter specifies the position relative to the
    receiving widget. \a button specifies the \link TQt::ButtonState
    button\endlink that caused the event, which should be \c
    TQt::NoButton (0), if \a type is \c MouseMove. \a state is the
    \link TQt::ButtonState ButtonState\endlink at the time of the
    event.

    The globalPos() is initialized to TQCursor::pos(), which may not be
    appropriate. Use the other constructor to specify the global
    position explicitly.
*/

TQMouseEvent::TQMouseEvent( Type type, const TQPoint &pos, int button, int state )
    : TQEvent(type), p(pos), b(button),s((ushort)state), accpt(TRUE){
	g = TQCursor::pos();
}


/*!
    \fn TQMouseEvent::TQMouseEvent( Type type, const TQPoint &pos, const TQPoint &globalPos,  int button, int state )

    Constructs a mouse event object.

    The \a type parameter must be \c TQEvent::MouseButtonPress, \c
    TQEvent::MouseButtonRelease, \c TQEvent::MouseButtonDblClick or \c
    TQEvent::MouseMove.

    The \a pos parameter specifies the position relative to the
    receiving widget. \a globalPos is the position in absolute
    coordinates. \a button specifies the \link TQt::ButtonState
    button\endlink that caused the event, which should be \c
    TQt::NoButton (0), if \a type is \c MouseMove. \a state is the
    \link TQt::ButtonState ButtonState\endlink at the time of the
    event.

*/

/*!
    \fn const TQPoint &TQMouseEvent::pos() const

    Returns the position of the mouse pointer relative to the widget
    that received the event.

    If you move the widget as a result of the mouse event, use the
    global position returned by globalPos() to avoid a shaking motion.

    \sa x(), y(), globalPos()
*/

/*!
    \fn const TQPoint &TQMouseEvent::globalPos() const

    Returns the global position of the mouse pointer \e{at the time
    of the event}. This is important on asynchronous window systems
    like X11. Whenever you move your widgets around in response to
    mouse events, globalPos() may differ a lot from the current
    pointer position TQCursor::pos(), and from TQWidget::mapToGlobal(
    pos() ).

    \sa globalX(), globalY()
*/

/*!
    \fn int TQMouseEvent::x() const

    Returns the x-position of the mouse pointer, relative to the
    widget that received the event.

    \sa y(), pos()
*/

/*!
    \fn int TQMouseEvent::y() const

    Returns the y-position of the mouse pointer, relative to the
    widget that received the event.

    \sa x(), pos()
*/

/*!
    \fn int TQMouseEvent::globalX() const

    Returns the global x-position of the mouse pointer at the time of
    the event.

    \sa globalY(), globalPos()
*/

/*!
    \fn int TQMouseEvent::globalY() const

    Returns the global y-position of the mouse pointer at the time of
    the event.

    \sa globalX(), globalPos()
*/

/*!
    \fn ButtonState TQMouseEvent::button() const

    Returns the button that caused the event.

    Possible return values are \c LeftButton, \c RightButton, \c
    MidButton and \c NoButton.

    Note that the returned value is always \c NoButton for mouse move
    events.

    \sa state() TQt::ButtonState
*/


/*!
    \fn ButtonState TQMouseEvent::state() const

    Returns the button state (a combination of mouse buttons and
    keyboard modifiers), i.e. what buttons and keys were being pressed
    immediately before the event was generated.

    This means that if you have a \c TQEvent::MouseButtonPress or a \c
    TQEvent::MouseButtonDblClick state() will \e not include the mouse
    button that's pressed. But once the mouse button has been
    released, the \c TQEvent::MouseButtonRelease event will have the
    button() that was pressed.

    This value is mainly interesting for \c TQEvent::MouseMove; for the
    other cases, button() is more useful.

    The returned value is \c LeftButton, \c RightButton, \c MidButton,
    \c ShiftButton, \c ControlButton and \c AltButton OR'ed together.

    \sa button() stateAfter() TQt::ButtonState
*/

/*!
    \fn ButtonState TQMouseEvent::stateAfter() const

    Returns the state of buttons after the event.

    \sa state() TQt::ButtonState
*/
TQt::ButtonState TQMouseEvent::stateAfter() const
{
    return TQt::ButtonState(state()^button());
}



/*!
    \fn bool TQMouseEvent::isAccepted() const

    Returns TRUE if the receiver of the event wants to keep the key;
    otherwise returns FALSE.
*/

/*!
    \fn void TQMouseEvent::accept()

    Sets the accept flag of the mouse event object.

    Setting the accept parameter indicates that the receiver of the
    event wants the mouse event. Unwanted mouse events are sent to the
    tqparent widget.

    The accept flag is set by default.

    \sa ignore()
*/


/*!
    \fn void TQMouseEvent::ignore()

    Clears the accept flag parameter of the mouse event object.

    Clearing the accept parameter indicates that the event receiver
    does not want the mouse event. Unwanted mouse events are sent to
    the tqparent widget.

    The accept flag is set by default.

    \sa accept()
*/


/*!
    \class TQWheelEvent tqevent.h
    \brief The TQWheelEvent class tqcontains parameters that describe a wheel event.

    \ingroup events

    Wheel events are sent to the widget under the mouse, and if that widget
    does not handle the event they are sent to the focus widget. The rotation
    distance is provided by delta(). The functions pos() and globalPos() return
    the mouse pointer location at the time of the event.

    A wheel event tqcontains a special accept flag that indicates
    whether the receiver wants the event. You should call
    TQWheelEvent::accept() if you handle the wheel event; otherwise it
    will be sent to the tqparent widget.

    The TQWidget::setEnable() function can be used to enable or disable
    mouse and keyboard events for a widget.

    The event handler TQWidget::wheelEvent() receives wheel events.

    \sa TQMouseEvent, TQWidget::grabMouse()
*/

/*!
    \fn Orientation TQWheelEvent::orientation() const

    Returns the wheel's orientation.
*/

/*!
    \fn TQWheelEvent::TQWheelEvent( const TQPoint &pos, int delta, int state, Orientation orient = Vertical );

    Constructs a wheel event object.

    The globalPos() is initialized to TQCursor::pos(), i.e. \a pos,
    which is usually (but not always) right. Use the other constructor
    if you need to specify the global position explicitly. \a delta
    tqcontains the rotation distance, \a state holds the keyboard
    modifier flags at the time of the event and \a orient holds the
    wheel's orientation.

    \sa pos(), delta(), state()
*/
#ifndef TQT_NO_WHEELEVENT
TQWheelEvent::TQWheelEvent( const TQPoint &pos, int delta, int state, Orientation orient )
    : TQEvent(Wheel), p(pos), d(delta), s((ushort)state),
      accpt(TRUE), o(orient)
{
    g = TQCursor::pos();
}
#endif
/*!
    \fn TQWheelEvent::TQWheelEvent( const TQPoint &pos, const TQPoint& globalPos, int delta, int state, Orientation orient = Vertical  )

    Constructs a wheel event object. The position when the event
    occurred is given in \a pos and \a globalPos. \a delta tqcontains
    the rotation distance, \a state holds the keyboard modifier flags
    at the time of the event and \a orient holds the wheel's
    orientation.

    \sa pos(), globalPos(), delta(), state()
*/

/*!
    \fn int TQWheelEvent::delta() const

    Returns the distance that the wheel is rotated expressed in
    multiples or divisions of the \e{wheel delta}, which is currently
    defined to be 120. A positive value indicates that the wheel was
    rotated forwards away from the user; a negative value indicates
    that the wheel was rotated backwards toward the user.

    The \e{wheel delta} constant was defined to be 120 by wheel mouse
    vendors to allow building finer-resolution wheels in the future,
    including perhaps a freely rotating wheel with no notches. The
    expectation is that such a tqdevice would send more messages per
    rotation but with a smaller value in each message.
*/

/*!
    \fn const TQPoint &TQWheelEvent::pos() const

    Returns the position of the mouse pointer, relative to the widget
    that received the event.

    If you move your widgets around in response to mouse
    events, use globalPos() instead of this function.

    \sa x(), y(), globalPos()
*/

/*!
    \fn int TQWheelEvent::x() const

    Returns the x-position of the mouse pointer, relative to the
    widget that received the event.

    \sa y(), pos()
*/

/*!
    \fn int TQWheelEvent::y() const

    Returns the y-position of the mouse pointer, relative to the
    widget that received the event.

    \sa x(), pos()
*/


/*!
    \fn const TQPoint &TQWheelEvent::globalPos() const

    Returns the global position of the mouse pointer \e{at the time
    of the event}. This is important on asynchronous window systems
    such as X11; whenever you move your widgets around in response to
    mouse events, globalPos() can differ a lot from the current
    pointer position TQCursor::pos().

    \sa globalX(), globalY()
*/

/*!
    \fn int TQWheelEvent::globalX() const

    Returns the global x-position of the mouse pointer at the time of
    the event.

    \sa globalY(), globalPos()
*/

/*!
    \fn int TQWheelEvent::globalY() const

    Returns the global y-position of the mouse pointer at the time of
    the event.

    \sa globalX(), globalPos()
*/


/*!
    \fn ButtonState TQWheelEvent::state() const

    Returns the keyboard modifier flags of the event.

    The returned value is \c ShiftButton, \c ControlButton, and \c
    AltButton OR'ed together.
*/

/*!
    \fn bool TQWheelEvent::isAccepted() const

    Returns TRUE if the receiver of the event handles the wheel event;
    otherwise returns FALSE.
*/

/*!
    \fn void TQWheelEvent::accept()

    Sets the accept flag of the wheel event object.

    Setting the accept parameter indicates that the receiver of the
    event wants the wheel event. Unwanted wheel events are sent to the
    tqparent widget.

    The accept flag is set by default.

    \sa ignore()
*/

/*!
    \fn void TQWheelEvent::ignore()

    Clears the accept flag parameter of the wheel event object.

    Clearing the accept parameter indicates that the event receiver
    does not want the wheel event. Unwanted wheel events are sent to
    the tqparent widget. The accept flag is set by default.

    \sa accept()
*/


/*!
    \enum TQt::Modifier

    This enum type describes the keyboard modifier keys supported by
    TQt.

    \value SHIFT the Shift keys provided on all standard keyboards.
    \value META the Meta keys.
    \value CTRL the Ctrl keys.
    \value ALT the normal Alt keys, but not e.g. AltGr.
    \value MODIFIER_MASK is a tqmask of Shift, Ctrl, Alt and Meta.
    \value UNICODE_ACCEL the accelerator is specified as a Unicode code
    point, not as a TQt Key.
*/

/*!
    \class TQKeyEvent tqevent.h
    \brief The TQKeyEvent class tqcontains describes a key event.

    \ingroup events

    Key events occur when a key is pressed or released when a widget
    has keyboard input focus.

  A key event tqcontains a special accept flag that indicates whether the
  receiver wants the key event.  You should call TQKeyEvent::ignore() if the
  key press or release event is not handled by your widget. A key event is
  propagated up the tqparent widget chain until a widget accepts it with
  TQKeyEvent::accept() or an event filter consumes it.
  Key events for multi media keys are ignored by default. You should call
  TQKeyEvent::accept() if your widget handles those events.

    The TQWidget::setEnable() function can be used to enable or disable
    mouse and keyboard events for a widget.

    The event handlers TQWidget::keyPressEvent() and
    TQWidget::keyReleaseEvent() receive key events.

    \sa TQFocusEvent, TQWidget::grabKeyboard()
*/

/*!
    \fn TQKeyEvent::TQKeyEvent( Type type, int key, int ascii, int state,
			      const TQString& text, bool autorep, ushort count )

    Constructs a key event object.

    The \a type parameter must be \c TQEvent::KeyPress or \c
    TQEvent::KeyRelease. If \a key is 0 the event is not a result of a
    known key (e.g. it may be the result of a compose sequence or
    keyboard macro). \a ascii is the ASCII code of the key that was
    pressed or released. \a state holds the keyboard modifiers. \a
    text is the Unicode text that the key generated. If \a autorep is
    TRUE, isAutoRepeat() will be TRUE. \a count is the number of
    single keys.

    The accept flag is set to TRUE.
*/

/*!
    \fn int TQKeyEvent::key() const

    Returns the code of the key that was pressed or released.

    See \l TQt::Key for the list of keyboard codes. These codes are
    independent of the underlying window system.

    A value of either 0 or Key_unknown means that the event is not
    the result of a known key (e.g. it may be the result of a compose
    sequence or a keyboard macro, or due to key event compression).

    Applications should not use the TQt latin 1 keycodes between 128
    and 255, but should rather use the TQKeyEvent::text(). This is
    mainly for compatibility.

    \sa TQWidget::setKeyCompression()
*/

/*!
    \fn int TQKeyEvent::ascii() const

    Returns the ASCII code of the key that was pressed or released. We
    recommend using text() instead.

    \sa text()
*/

/*!
    \fn TQString TQKeyEvent::text() const

    Returns the Unicode text that this key generated. The text returned
    migth be empty, which is the case when pressing or
    releasing modifying keys as Shift, Control, Alt and Meta. In these
    cases key() will contain a valid value.

    \sa TQWidget::setKeyCompression()
*/

/*!
    \fn ButtonState TQKeyEvent::state() const

    Returns the keyboard modifier flags that existed immediately
    before the event occurred.

    The returned value is \c ShiftButton, \c ControlButton, \c AltButton
    and \c MetaButton OR'ed together.

    \sa stateAfter()
*/

/*!
    \fn ButtonState TQKeyEvent::stateAfter() const

    Returns the keyboard modifier flags that existed immediately after
    the event occurred.

    \warning This function cannot be trusted.

    \sa state()
*/
//###### We must check with XGetModifierMapping
TQt::ButtonState TQKeyEvent::stateAfter() const
{
    if ( key() == Key_Shift )
	return TQt::ButtonState(state()^ShiftButton);
    if ( key() == Key_Control )
	return TQt::ButtonState(state()^ControlButton);
    if ( key() == Key_Alt )
	return TQt::ButtonState(state()^AltButton);
    if ( key() == Key_Meta )
	return TQt::ButtonState(state()^MetaButton);
    return state();
}

/*!
    \fn bool TQKeyEvent::isAccepted() const

    Returns TRUE if the receiver of the event wants to keep the key;
    otherwise returns FALSE
*/

/*!
    \fn void TQKeyEvent::accept()

    Sets the accept flag of the key event object.

    Setting the accept parameter indicates that the receiver of the
    event wants the key event. Unwanted key events are sent to the
    tqparent widget.

    The accept flag is set by default.

    \sa ignore()
*/

/*!
    \fn bool TQKeyEvent::isAutoRepeat() const

    Returns TRUE if this event comes from an auto-repeating key and
    FALSE if it comes from an initial key press.

    Note that if the event is a multiple-key compressed event that is
    partly due to auto-repeat, this function could return either TRUE
    or FALSE indeterminately.
*/

/*!
    \fn int TQKeyEvent::count() const

    Returns the number of single keys for this event. If text() is not
    empty, this is simply the length of the string.

    \sa TQWidget::setKeyCompression()
*/

/*!
    \fn void TQKeyEvent::ignore()

    Clears the accept flag parameter of the key event object.

    Clearing the accept parameter indicates that the event receiver
    does not want the key event. Unwanted key events are sent to the
    tqparent widget.

    The accept flag is set by default.

    \sa accept()
*/

/*!
    \enum TQt::Key

    The key names used by TQt.

    \value Key_Escape
    \value Key_Tab
    \value Key_Backtab
    \value Key_Backspace
    \value Key_Return
    \value Key_Enter
    \value Key_Insert
    \value Key_Delete
    \value Key_Pause
    \value Key_Print
    \value Key_SysReq
    \value Key_Home
    \value Key_End
    \value Key_Left
    \value Key_Up
    \value Key_Right
    \value Key_Down
    \value Key_Prior
    \value Key_Next
    \value Key_Shift
    \value Key_Control
    \value Key_Meta
    \value Key_Alt
    \value Key_CapsLock
    \value Key_NumLock
    \value Key_ScrollLock
    \value Key_Clear
    \value Key_F1
    \value Key_F2
    \value Key_F3
    \value Key_F4
    \value Key_F5
    \value Key_F6
    \value Key_F7
    \value Key_F8
    \value Key_F9
    \value Key_F10
    \value Key_F11
    \value Key_F12
    \value Key_F13
    \value Key_F14
    \value Key_F15
    \value Key_F16
    \value Key_F17
    \value Key_F18
    \value Key_F19
    \value Key_F20
    \value Key_F21
    \value Key_F22
    \value Key_F23
    \value Key_F24
    \value Key_F25
    \value Key_F26
    \value Key_F27
    \value Key_F28
    \value Key_F29
    \value Key_F30
    \value Key_F31
    \value Key_F32
    \value Key_F33
    \value Key_F34
    \value Key_F35
    \value Key_Super_L
    \value Key_Super_R
    \value Key_Menu
    \value Key_Hyper_L
    \value Key_Hyper_R
    \value Key_Help
    \value Key_Space
    \value Key_Any
    \value Key_Exclam
    \value Key_QuoteDbl
    \value Key_NumberSign
    \value Key_Dollar
    \value Key_Percent
    \value Key_Ampersand
    \value Key_Apostrophe
    \value Key_ParenLeft
    \value Key_ParenRight
    \value Key_Asterisk
    \value Key_Plus
    \value Key_Comma
    \value Key_Minus
    \value Key_Period
    \value Key_Slash
    \value Key_0
    \value Key_1
    \value Key_2
    \value Key_3
    \value Key_4
    \value Key_5
    \value Key_6
    \value Key_7
    \value Key_8
    \value Key_9
    \value Key_Colon
    \value Key_Semicolon
    \value Key_Less
    \value Key_Equal
    \value Key_Greater
    \value Key_Question
    \value Key_At
    \value Key_A
    \value Key_B
    \value Key_C
    \value Key_D
    \value Key_E
    \value Key_F
    \value Key_G
    \value Key_H
    \value Key_I
    \value Key_J
    \value Key_K
    \value Key_L
    \value Key_M
    \value Key_N
    \value Key_O
    \value Key_P
    \value Key_Q
    \value Key_R
    \value Key_S
    \value Key_T
    \value Key_U
    \value Key_V
    \value Key_W
    \value Key_X
    \value Key_Y
    \value Key_Z
    \value Key_BracketLeft
    \value Key_Backslash
    \value Key_BracketRight
    \value Key_AsciiCircum
    \value Key_Underscore
    \value Key_QuoteLeft
    \value Key_BraceLeft
    \value Key_Bar
    \value Key_BraceRight
    \value Key_AsciiTilde

    \value Key_nobreakspace
    \value Key_exclamdown
    \value Key_cent
    \value Key_sterling
    \value Key_currency
    \value Key_yen
    \value Key_brokenbar
    \value Key_section
    \value Key_diaeresis
    \value Key_copyright
    \value Key_ordfeminine
    \value Key_guillemotleft
    \value Key_notsign
    \value Key_hyphen
    \value Key_registered
    \value Key_macron
    \value Key_degree
    \value Key_plusminus
    \value Key_twosuperior
    \value Key_threesuperior
    \value Key_acute
    \value Key_mu
    \value Key_paragraph
    \value Key_periodcentered
    \value Key_cedilla
    \value Key_onesuperior
    \value Key_masculine
    \value Key_guillemotright
    \value Key_onequarter
    \value Key_onehalf
    \value Key_threequarters
    \value Key_questiondown
    \value Key_Agrave
    \value Key_Aacute
    \value Key_Acircumflex
    \value Key_Atilde
    \value Key_Adiaeresis
    \value Key_Aring
    \value Key_AE
    \value Key_Ccedilla
    \value Key_Egrave
    \value Key_Eacute
    \value Key_Ecircumflex
    \value Key_Ediaeresis
    \value Key_Igrave
    \value Key_Iacute
    \value Key_Icircumflex
    \value Key_Idiaeresis
    \value Key_ETH
    \value Key_Ntilde
    \value Key_Ograve
    \value Key_Oacute
    \value Key_Ocircumflex
    \value Key_Otilde
    \value Key_Odiaeresis
    \value Key_multiply
    \value Key_Ooblique
    \value Key_Ugrave
    \value Key_Uacute
    \value Key_Ucircumflex
    \value Key_Udiaeresis
    \value Key_Yacute
    \value Key_THORN
    \value Key_ssharp
    \value Key_agrave
    \value Key_aacute
    \value Key_acircumflex
    \value Key_atilde
    \value Key_adiaeresis
    \value Key_aring
    \value Key_ae
    \value Key_ccedilla
    \value Key_egrave
    \value Key_eacute
    \value Key_ecircumflex
    \value Key_ediaeresis
    \value Key_igrave
    \value Key_iacute
    \value Key_icircumflex
    \value Key_idiaeresis
    \value Key_eth
    \value Key_ntilde
    \value Key_ograve
    \value Key_oacute
    \value Key_ocircumflex
    \value Key_otilde
    \value Key_odiaeresis
    \value Key_division
    \value Key_oslash
    \value Key_ugrave
    \value Key_uacute
    \value Key_ucircumflex
    \value Key_udiaeresis
    \value Key_yacute
    \value Key_thorn
    \value Key_ydiaeresis

    Multimedia keys

    \value Key_Back
    \value Key_Forward
    \value Key_Stop
    \value Key_Refresh

    \value Key_VolumeDown
    \value Key_VolumeMute
    \value Key_VolumeUp
    \value Key_BassBoost
    \value Key_BassUp
    \value Key_BassDown
    \value Key_TrebleUp
    \value Key_TrebleDown

    \value Key_MediaPlay
    \value Key_MediaStop
    \value Key_MediaPrev
    \value Key_MediaNext
    \value Key_MediaRecord

    \value Key_HomePage
    \value Key_Favorites
    \value Key_Search
    \value Key_Standby
    \value Key_OpenUrl

    \value Key_LaunchMail
    \value Key_LaunchMedia
    \value Key_Launch0
    \value Key_Launch1
    \value Key_Launch2
    \value Key_Launch3
    \value Key_Launch4
    \value Key_Launch5
    \value Key_Launch6
    \value Key_Launch7
    \value Key_Launch8
    \value Key_Launch9
    \value Key_LaunchA
    \value Key_LaunchB
    \value Key_LaunchC
    \value Key_LaunchD
    \value Key_LaunchE
    \value Key_LaunchF

    \value Key_MediaLast

    \value Key_unknown

    \value Key_Direction_L internal use only
    \value Key_Direction_R internal use only

*/


/*!
    \class TQFocusEvent tqevent.h
    \brief The TQFocusEvent class tqcontains event parameters for widget focus
    events.

    \ingroup events

    Focus events are sent to widgets when the keyboard input focus
    changes. Focus events occur due to mouse actions, keypresses (e.g.
    Tab or Backtab), the window system, popup menus, keyboard
    shortcuts or other application specific reasons. The reason for a
    particular focus event is returned by reason() in the appropriate
    event handler.

    The event handlers TQWidget::focusInEvent() and
    TQWidget::focusOutEvent() receive focus events.

    Use setReason() to set the reason for all focus events, and
    resetReason() to set the reason for all focus events to the reason
    in force before the last setReason() call.

    \sa TQWidget::setFocus(), TQWidget::setFocusPolicy()
*/

/*!
    \fn TQFocusEvent::TQFocusEvent( Type type )

    Constructs a focus event object.

    The \a type parameter must be either \c TQEvent::FocusIn or \c
    TQEvent::FocusOut.
*/



TQFocusEvent::Reason TQFocusEvent::m_reason = TQFocusEvent::Other;
TQFocusEvent::Reason TQFocusEvent::prev_reason = TQFocusEvent::Other;


/*!
    \enum TQFocusEvent::Reason

    This enum specifies why the focus changed.

    \value Mouse  because of a mouse action.
    \value Tab  because of a Tab press.
    \value Backtab  because of a Backtab press
	    (possibly including Shift/Control, e.g. Shift+Tab).
    \value ActiveWindow  because the window system made this window (in)active.
    \value Popup  because the application opened/closed a popup that grabbed/released focus.
    \value Shortcut  because of a keyboard shortcut.
    \value Other  any other reason, usually application-specific.

    See the \link focus.html keyboard focus overview\endlink for more
    about focus.
*/

/*!
    Returns the reason for this focus event.

    \sa setReason()
 */
TQFocusEvent::Reason TQFocusEvent::reason()
{
    return m_reason;
}

/*!
    Sets the reason for all future focus events to \a reason.

    \sa reason(), resetReason()
 */
void TQFocusEvent::setReason( Reason reason )
{
    prev_reason = m_reason;
    m_reason = reason;
}

/*!
    Resets the reason for all future focus events to the value before
    the last setReason() call.

    \sa reason(), setReason()
 */
void TQFocusEvent::resetReason()
{
    m_reason = prev_reason;
}

/*!
    \fn bool TQFocusEvent::gotFocus() const

    Returns TRUE if the widget received the text input focus;
    otherwise returns FALSE.
*/

/*!
    \fn bool TQFocusEvent::lostFocus() const

    Returns TRUE if the widget lost the text input focus; otherwise
    returns FALSE.
*/


/*!
    \class TQPaintEvent tqevent.h
    \brief The TQPaintEvent class tqcontains event parameters for paint events.

    \ingroup events

    Paint events are sent to widgets that need to update themselves,
    for instance when part of a widget is exposed because a covering
    widget is moved.

    The event tqcontains a region() that needs to be updated, and a
    rect() that is the bounding rectangle of that region. Both are
    provided because many widgets can't make much use of region(), and
    rect() can be much faster than region().boundingRect(). Painting
    is clipped to region() during processing of a paint event.

    The erased() function returns TRUE if the region() has been
    cleared to the widget's background (see
    TQWidget::backgroundMode()), and FALSE if the region's contents are
    arbitrary.

    \sa TQPainter TQWidget::update() TQWidget::tqrepaint()
    TQWidget::paintEvent() TQWidget::backgroundMode() TQRegion
*/

/*!
    \fn TQPaintEvent::TQPaintEvent( const TQRegion &paintRegion, bool erased=TRUE )

    Constructs a paint event object with the region that should be
    updated. The region is given by \a paintRegion. If \a erased is
    TRUE the region will be cleared before repainting.
*/

/*!
    \fn TQPaintEvent::TQPaintEvent( const TQRect &paintRect, bool erased=TRUE )

    Constructs a paint event object with the rectangle that should be
    updated. The region is also given by \a paintRect. If \a erased is
    TRUE the region will be cleared before repainting.
*/

/*!
    \fn TQPaintEvent::TQPaintEvent( const TQRegion &paintRegion, const TQRect &paintRect, bool erased=TRUE )

    Constructs a paint event object with the rectangle \a paintRect
    that should be updated. The region is given by \a paintRegion. If
    \a erased is TRUE the region will be cleared before repainting.
*/

/*!
    \fn const TQRect &TQPaintEvent::rect() const

    Returns the rectangle that should be updated.

    \sa region(), TQPainter::setClipRect()
*/

/*!
    \fn const TQRegion &TQPaintEvent::region() const

    Returns the region that should be updated.

    \sa rect(), TQPainter::setClipRegion()
*/

/*!
    \fn bool TQPaintEvent::erased() const

    Returns TRUE if the paint event region (or rectangle) has been
    erased with the widget's background; otherwise returns FALSE.
*/

/*!
    \class TQMoveEvent tqevent.h
    \brief The TQMoveEvent class tqcontains event parameters for move events.

    \ingroup events

    Move events are sent to widgets that have been moved to a new position
    relative to their tqparent.

    The event handler TQWidget::moveEvent() receives move events.

    \sa TQWidget::move(), TQWidget::setGeometry()
*/

/*!
    \fn TQMoveEvent::TQMoveEvent( const TQPoint &pos, const TQPoint &oldPos )

    Constructs a move event with the new and old widget positions, \a
    pos and \a oldPos respectively.
*/

/*!
    \fn const TQPoint &TQMoveEvent::pos() const

    Returns the new position of the widget. This excludes the window
    frame for top level widgets.
*/

/*!
    \fn const TQPoint &TQMoveEvent::oldPos() const

    Returns the old position of the widget.
*/


/*!
    \class TQResizeEvent tqevent.h
    \brief The TQResizeEvent class tqcontains event parameters for resize events.

    \ingroup events

    Resize events are sent to widgets that have been resized.

    The event handler TQWidget::resizeEvent() receives resize events.

    \sa TQWidget::resize(), TQWidget::setGeometry()
*/

/*!
    \fn TQResizeEvent::TQResizeEvent( const TQSize &size, const TQSize &oldSize )

    Constructs a resize event with the new and old widget sizes, \a
    size and \a oldSize respectively.
*/

/*!
    \fn const TQSize &TQResizeEvent::size() const

    Returns the new size of the widget, which is the same as
    TQWidget::size().
*/

/*!
    \fn const TQSize &TQResizeEvent::oldSize() const

    Returns the old size of the widget.
*/


/*!
    \class TQCloseEvent tqevent.h
    \brief The TQCloseEvent class tqcontains parameters that describe a close event.

    \ingroup events

    Close events are sent to widgets that the user wants to close,
    usually by choosing "Close" from the window menu, or by clicking
    the `X' titlebar button. They are also sent when you call
    TQWidget::close() to close a widget programmatically.

    Close events contain a flag that indicates whether the receiver
    wants the widget to be closed or not. When a widget accepts the
    close event, it is hidden (and destroyed if it was created with
    the \c WDestructiveClose flag). If it refuses to accept the close
    event nothing happens. (Under X11 it is possible that the window
    manager will forcibly close the window; but at the time of writing
    we are not aware of any window manager that does this.)

    The application's main widget -- TQApplication::mainWidget() --
    is a special case. When it accepts the close event, TQt leaves the
    main event loop and the application is immediately terminated
    (i.e. it returns from the call to TQApplication::exec() in the
    main() function).

    The event handler TQWidget::closeEvent() receives close events. The
    default implementation of this event handler accepts the close
    event. If you do not want your widget to be hidden, or want some
    special handing, you should reimplement the event handler.

    The \link simple-application.html#closeEvent closeEvent() in the
    Application Walkthrough\endlink shows a close event handler that
    asks whether to save a document before closing.

    If you want the widget to be deleted when it is closed, create it
    with the \c WDestructiveClose widget flag. This is very useful for
    independent top-level windows in a multi-window application.

    \l{TQObject}s emits the \link TQObject::destroyed()
    destroyed()\endlink signal when they are deleted.

    If the last top-level window is closed, the
    TQApplication::lastWindowClosed() signal is emitted.

    The isAccepted() function returns TRUE if the event's receiver has
    agreed to close the widget; call accept() to agree to close the
    widget and call ignore() if the receiver of this event does not
    want the widget to be closed.

    \sa TQWidget::close(), TQWidget::hide(), TQObject::destroyed(),
    TQApplication::setMainWidget(), TQApplication::lastWindowClosed(),
    TQApplication::exec(), TQApplication::quit()
*/

/*!
    \fn TQCloseEvent::TQCloseEvent()

    Constructs a close event object with the accept parameter flag set
    to FALSE.

    \sa accept()
*/

/*!
    \fn bool TQCloseEvent::isAccepted() const

    Returns TRUE if the receiver of the event has agreed to close the
    widget; otherwise returns FALSE.

    \sa accept(), ignore()
*/

/*!
    \fn void TQCloseEvent::accept()

    Sets the accept flag of the close event object.

    Setting the accept flag indicates that the receiver of this event
    agrees to close the widget.

    The accept flag is \e not set by default.

    If you choose to accept in TQWidget::closeEvent(), the widget will
    be hidden. If the widget's \c WDestructiveClose flag is set, it
    will also be destroyed.

    \sa ignore(), TQWidget::hide()
*/

/*!
    \fn void TQCloseEvent::ignore()

    Clears the accept flag of the close event object.

    Clearing the accept flag indicates that the receiver of this event
    does not want the widget to be closed.

    The close event is constructed with the accept flag cleared.

    \sa accept()
*/

/*!
   \class TQIconDragEvent tqevent.h
   \brief The TQIconDragEvent class Q_SIGNALS that a main icon drag has begun.

    \ingroup events

    Icon drag events are sent to widgets when the main icon of a window has been dragged away.
    On Mac OS X this is fired when the proxy icon of a window is dragged off titlebar, in response to
    this event is is normal to begin using drag and drop.
*/

/*!
    \fn TQIconDragEvent::TQIconDragEvent()

    Constructs an icon drag event object with the accept parameter
    flag set to FALSE.

    \sa accept()
*/

/*!
    \fn bool TQIconDragEvent::isAccepted() const

    Returns TRUE if the receiver of the event has started a drag and
    drop operation; otherwise returns FALSE.

    \sa accept(), ignore()
*/

/*!
    \fn void TQIconDragEvent::accept()

    Sets the accept flag of the icon drag event object.

    Setting the accept flag indicates that the receiver of this event
    has started a drag and drop oeration.

    The accept flag is \e not set by default.

    \sa ignore(), TQWidget::hide()
*/

/*!
    \fn void TQIconDragEvent::ignore()

    Clears the accept flag of the icon drag object.

    Clearing the accept flag indicates that the receiver of this event
    has not handled the icon drag as a result other events can be sent.

    The icon drag event is constructed with the accept flag cleared.

    \sa accept()
*/

/*!
    \class TQContextMenuEvent tqevent.h
    \brief The TQContextMenuEvent class tqcontains parameters that describe a context menu event.

    \ingroup events

    Context menu events are sent to widgets when a user triggers a
    context menu. What triggers this is platform dependent. For
    example, on Windows, pressing the menu button or releasing the
    right mouse button will cause this event to be sent.

    When this event occurs it is customary to show a TQPopupMenu with a
    context menu, if this is relevant to the context.

    Context menu events contain a special accept flag that indicates
    whether the receiver accepted the event. If the event handler does
    not accept the event, then whatever triggered the event will be
    handled as a regular input event if possible.

    \sa TQPopupMenu
*/

/*!
    \fn TQContextMenuEvent::TQContextMenuEvent( Reason reason, const TQPoint &pos, const TQPoint &globalPos, int state )

    Constructs a context menu event object with the accept parameter
    flag set to FALSE.

    The \a reason parameter must be \c TQContextMenuEvent::Mouse or \c
    TQContextMenuEvent::Keyboard.

    The \a pos parameter specifies the mouse position relative to the
    receiving widget. \a globalPos is the mouse position in absolute
    coordinates. \a state is the ButtonState at the time of the event.
*/


/*!
    \fn TQContextMenuEvent::TQContextMenuEvent( Reason reason, const TQPoint &pos, int state )

    Constructs a context menu event object with the accept parameter
    flag set to FALSE.

    The \a reason parameter must be \c TQContextMenuEvent::Mouse or \c
    TQContextMenuEvent::Keyboard.

    The \a pos parameter specifies the mouse position relative to the
    receiving widget. \a state is the ButtonState at the time of the
    event.

    The globalPos() is initialized to TQCursor::pos(), which may not be
    appropriate. Use the other constructor to specify the global
    position explicitly.
*/

TQContextMenuEvent::TQContextMenuEvent( Reason reason, const TQPoint &pos, int state )
    : TQEvent( ContextMenu ), p( pos ), accpt(TRUE), consum(TRUE),
    reas( reason ), s((ushort)state)
{
    gp = TQCursor::pos();
}

/*!
    \fn const TQPoint &TQContextMenuEvent::pos() const

    Returns the position of the mouse pointer relative to the widget
    that received the event.

    \sa x(), y(), globalPos()
*/

/*!
    \fn int TQContextMenuEvent::x() const

    Returns the x-position of the mouse pointer, relative to the
    widget that received the event.

    \sa y(), pos()
*/

/*!
    \fn int TQContextMenuEvent::y() const

    Returns the y-position of the mouse pointer, relative to the
    widget that received the event.

    \sa x(), pos()
*/

/*!
    \fn const TQPoint &TQContextMenuEvent::globalPos() const

    Returns the global position of the mouse pointer at the time of
    the event.

    \sa x(), y(), pos()
*/

/*!
    \fn int TQContextMenuEvent::globalX() const

    Returns the global x-position of the mouse pointer at the time of
    the event.

    \sa globalY(), globalPos()
*/

/*!
    \fn int TQContextMenuEvent::globalY() const

    Returns the global y-position of the mouse pointer at the time of
    the event.

    \sa globalX(), globalPos()
*/

/*!
    \fn ButtonState TQContextMenuEvent::state() const

    Returns the button state (a combination of mouse buttons and
    keyboard modifiers), i.e. what buttons and keys were being
    pressed immediately before the event was generated.

    The returned value is \c LeftButton, \c RightButton, \c MidButton,
    \c ShiftButton, \c ControlButton and \c AltButton OR'ed together.
*/

/*!
    \fn bool TQContextMenuEvent::isConsumed() const

    Returns TRUE (which stops propagation of the event) if the
    receiver has blocked the event; otherwise returns FALSE.

    \sa accept(), ignore(), consume()
*/

/*!
    \fn void TQContextMenuEvent::consume()

    Sets the consume flag of the context event object.

    Setting the consume flag indicates that the receiver of this event
    does not want the event to be propagated further (i.e. not sent to
    tqparent classes.)

    The consumed flag is not set by default.

    \sa ignore() accept()
*/

/*!
    \fn bool TQContextMenuEvent::isAccepted() const

    Returns TRUE if the receiver has processed the event; otherwise
    returns FALSE.

    \sa accept(), ignore(), consume()
*/

/*!
    \fn void TQContextMenuEvent::accept()

    Sets the accept flag of the context event object.

    Setting the accept flag indicates that the receiver of this event
    has processed the event. Processing the event means you did
    something with it and it will be implicitly consumed.

    The accept flag is not set by default.

    \sa ignore() consume()
*/

/*!
    \fn void TQContextMenuEvent::ignore()

    Clears the accept flag of the context event object.

    Clearing the accept flag indicates that the receiver of this event
    does not need to show a context menu. This will implicitly remove
    the consumed flag as well.

    The accept flag is not set by default.

    \sa accept() consume()
*/

/*!
    \enum TQContextMenuEvent::Reason

    This enum describes the reason the ContextMenuEvent was sent. The
    values are:

    \value Mouse The mouse caused the event to be sent. Normally this
    means the right mouse button was clicked, but this is platform
    specific.

    \value Keyboard The keyboard caused this event to be sent. On
    Windows this means the menu button was pressed.

    \value Other The event was sent by some other means (i.e. not by
    the mouse or keyboard).
*/


/*!
    \fn TQContextMenuEvent::Reason TQContextMenuEvent::reason() const

    Returns the reason for this context event.
*/


/*!
    \class TQIMEvent tqevent.h
    \brief The TQIMEvent class provides parameters for input method events.

    \ingroup events

    Input method events are sent to widgets when an input method is
    used to enter text into a widget. Input methods are widely used to
    enter text in Asian and other complex languages.

    The events are of interest to widgets that accept keyboard input
    and want to be able to correctly handle complex languages. Text
    input in such languages is usually a three step process.

    \list 1
    \i <b>Starting to Compose</b><br>
    When the user presses the first key on a keyboard an input context
    is created. This input context will contain a string with the
    typed characters.

    \i <b>Composing</b><br>
    With every new key pressed, the input method will try to create a
    matching string for the text typed so far. While the input context
    is active, the user can only move the cursor inside the string
    belonging to this input context.

    \i <b>Completing</b><br>
    At some point, e.g. when the user presses the Spacebar, they get
    to this stage, where they can choose from a number of strings that
    match the text they have typed so far. The user can press Enter to
    confirm their choice or Escape to cancel the input; in either case
    the input context will be closed.
    \endlist

    Note that the particular key presses used for a given input
    context may differ from those we've mentioned here, i.e. they may
    not be Spacebar, Enter and Escape.

    These three stages are represented by three different types of
    events. The IMStartEvent, IMComposeEvent and IMEndEvent. When a
    new input context is created, an IMStartEvent will be sent to the
    widget and delivered to the \l TQWidget::imStartEvent() function.
    The widget can then update internal data structures to reflect
    this.

    After this, an IMComposeEvent will be sent to the widget for
    every key the user presses. It will contain the current
    composition string the widget has to show and the current cursor
    position within the composition string. This string is temporary
    and can change with every key the user types, so the widget will
    need to store the state before the composition started (the state
    it had when it received the IMStartEvent). IMComposeEvents will be
    delivered to the \l TQWidget::imComposeEvent() function.

    Usually, widgets try to mark the part of the text that is part of
    the current composition in a way that is visible to the user. A
    commonly used visual cue is to use a dotted underline.

    After the user has selected the final string, an IMEndEvent will
    be sent to the widget. The event tqcontains the final string the
    user selected, and could be empty if they canceled the
    composition. This string should be accepted as the final text the
    user entered, and the intermediate composition string should be
    cleared. These events are delivered to \l TQWidget::imEndEvent().

    If the user clicks another widget, taking the focus out of the
    widget where the composition is taking place the IMEndEvent will
    be sent and the string it holds will be the result of the
    composition up to that point (which may be an empty string).
*/

/*!
    \fn  TQIMEvent::TQIMEvent( Type type, const TQString &text, int cursorPosition )

    Constructs a new TQIMEvent with the accept flag set to FALSE. \a
    type can be one of TQEvent::IMStartEvent, TQEvent::IMComposeEvent
    or TQEvent::IMEndEvent. \a text tqcontains the current compostion
    string and \a cursorPosition the current position of the cursor
    inside \a text.
*/

/*!
    \fn const TQString &TQIMEvent::text() const

    Returns the composition text. This is a null string for an
    IMStartEvent, and tqcontains the final accepted string (which may be
    empty) in the IMEndEvent.
*/

/*!
    \fn int TQIMEvent::cursorPos() const

    Returns the current cursor position inside the composition string.
    Will return -1 for IMStartEvent and IMEndEvent.
*/

/*!
    \fn int TQIMEvent::selectionLength() const

    Returns the number of characters in the composition string (
    starting at cursorPos() ) that should be marked as selected by the
    input widget receiving the event.
    Will return 0 for IMStartEvent and IMEndEvent.
*/

/*!
    \fn bool TQIMEvent::isAccepted() const

    Returns TRUE if the receiver of the event processed the event;
    otherwise returns FALSE.
*/

/*!
    \fn void TQIMEvent::accept()

    Sets the accept flag of the input method event object.

    Setting the accept parameter indicates that the receiver of the
    event processed the input method event.

    The accept flag is not set by default.

    \sa ignore()
*/


/*!
    \fn void TQIMEvent::ignore()

    Clears the accept flag parameter of the input method event object.

    Clearing the accept parameter indicates that the event receiver
    does not want the input method event.

    The accept flag is cleared by default.

    \sa accept()
*/

/*!
    \class TQTabletEvent tqevent.h
    \brief The TQTabletEvent class tqcontains parameters that describe a Tablet
    event.

    \ingroup events

    Tablet Events are generated from a Wacom&copy; tablet. Most of
    the time you will want to deal with events from the tablet as if
    they were events from a mouse, for example retrieving the position
    with x(), y(), pos(), globalX(), globalY() and globalPos(). In
    some situations you may wish to retrieve the extra information
    provided by the tablet tqdevice driver, for example, you might want
    to adjust color brightness based on pressure. TQTabletEvent allows
    you to get the pressure(), the xTilt() and yTilt(), as well as the
    type of tqdevice being used with tqdevice() (see \l{TabletDevice}).

    A tablet event tqcontains a special accept flag that indicates
    whether the receiver wants the event. You should call
    TQTabletEvent::accept() if you handle the tablet event; otherwise
    it will be sent to the tqparent widget.

    The TQWidget::setEnabled() function can be used to enable or
    disable mouse and keyboard events for a widget.

  The event handler TQWidget::tabletEvent() receives all three types of tablet
  events.  TQt will first send a tabletEvent and then, if it is not accepted,
  it will send a mouse event.  This allows applications that don't utilize
  tablets to use a tablet like a mouse while also enabling those who want to
  use both tablets and mouses differently.

*/

/*!
    \enum TQTabletEvent::TabletDevice

    This enum defines what type of tqdevice is generating the event.

    \value NoDevice    No tqdevice, or an unknown tqdevice.
    \value Puck    A Puck (a tqdevice that is similar to a flat mouse with
    a transtqparent circle with cross-hairs).
    \value Stylus  A Stylus (the narrow end of the pen).
    \value Eraser  An Eraser (the broad end of the pen).
    \omit
    \value Menu  A menu button was pressed (currently unimplemented).
*/

/*!
  \fn TQTabletEvent::TQTabletEvent( Type t, const TQPoint &pos,
                                  const TQPoint &globalPos, int tqdevice,
                                  int pressure, int xTilt, int yTilt,
				  const TQPair<int,int> &uId )
  Construct a tablet event of type \a t.  The position of when the event occurred is given
  int \a pos and \a globalPos.  \a tqdevice tqcontains the \link TabletDevice tqdevice type\endlink,
  \a pressure tqcontains the pressure exerted on the \a tqdevice, \a xTilt and \a yTilt contain
  \a tqdevice's degree of tilt from the X and Y axis respectively.  The \a uId tqcontains an
  event id.

  On Irix, \a globalPos will contain the high-resolution coordinates received from the
  tablet tqdevice driver, instead of from the windowing system.

  \sa pos(), globalPos(), tqdevice(), pressure(), xTilt(), yTilt()
*/

TQTabletEvent::TQTabletEvent( Type t, const TQPoint &pos, const TQPoint &globalPos, int tqdevice,
			    int pressure, int xTilt, int yTilt,
			    const TQPair<int, int> &uId )
    : TQEvent( t ),
      mPos( pos ),
      mGPos( globalPos ),
      mDev( tqdevice ),
      mPress( pressure ),
      mXT( xTilt ),
      mYT( yTilt ),
      mType( uId.first ),
      mPhy( uId.second ),
      mbAcc(TRUE)
{}

/*!
  \obsolete
  \fn TQTabletEvent::TQTabletEvent( const TQPoint &pos, const TQPoint &globalPos, int tqdevice, int pressure, int xTilt, int yTilt, const TQPair<int,int> &uId )

    Constructs a tablet event object. The position when the event
    occurred is is given in \a pos and \a globalPos. \a tqdevice
    tqcontains the \link TabletDevice tqdevice type\endlink, \a pressure
    tqcontains the pressure exerted on the \a tqdevice, \a xTilt and \a
    yTilt contain the \a tqdevice's degrees of tilt from the X and Y
    axis respectively. The \a uId tqcontains an event id.

    On Irix, \a globalPos will contain the high-resolution coordinates
    received from the tablet tqdevice driver, instead of from the
    windowing system.

  \sa pos(), globalPos(), tqdevice(), pressure(), xTilt(), yTilt()
*/

/*!
    \fn TabletDevices TQTabletEvent::tqdevice() const

    Returns the type of tqdevice that generated the event. Useful if you
    want one end of the pen to do something different than the other.

    \sa TabletDevice
*/

/*!
    \fn int TQTabletEvent::pressure() const

    Returns the pressure that is exerted on the tqdevice. This number is
    a value from 0 (no pressure) to 255 (maximum pressure). The
    pressure is always scaled to be within this range no matter how
    many pressure levels the underlying hardware supports.
*/

/*!
    \fn int TQTabletEvent::xTilt() const

    Returns the difference from the perpendicular in the X Axis.
    Positive values are towards the tablet's physical right. The angle
    is in the range -60 to +60 degrees.

    \sa yTilt()
*/

/*!
    \fn int TQTabletEvent::yTilt() const

    Returns the difference from the perpendicular in the Y Axis.
    Positive values are towards the bottom of the tablet. The angle is
    within the range -60 to +60 degrees.

    \sa xTilt()
*/

/*!
    \fn const TQPoint &TQTabletEvent::pos() const

    Returns the position of the tqdevice, relative to the widget that
    received the event.

    If you move widgets around in response to mouse events, use
    globalPos() instead of this function.

    \sa x(), y(), globalPos()
*/

/*!
    \fn int TQTabletEvent::x() const

    Returns the x-position of the tqdevice, relative to the widget that
    received the event.

    \sa y(), pos()
*/

/*!
    \fn int TQTabletEvent::y() const

    Returns the y-position of the tqdevice, relative to the widget that
    received the event.

    \sa x(), pos()
*/

/*!
    \fn const TQPoint &TQTabletEvent::globalPos() const

    Returns the global position of the tqdevice \e{at the time of the
    event}. This is important on asynchronous windows systems like X11;
    whenever you move your widgets around in response to mouse events,
    globalPos() can differ significantly from the current position
    TQCursor::pos().

    \sa globalX(), globalY()
*/

/*!
    \fn int TQTabletEvent::globalX() const

    Returns the global x-position of the mouse pointer at the time of
    the event.

    \sa globalY(), globalPos()
*/

/*!
    \fn int TQTabletEvent::globalY() const

    Returns the global y-position of the mouse pointer at the time of
    the event.

    \sa globalX(), globalPos()
*/

/*!
    \fn bool TQTabletEvent::isAccepted() const

    Returns TRUE if the receiver of the event handles the tablet
    event; otherwise returns FALSE.
*/

/*!
    \fn void TQTabletEvent::accept()

    Sets the accept flag of the tablet event object.

    Setting the accept flag indicates that the receiver of the event
    wants the tablet event. Unwanted tablet events are sent to the
    tqparent widget.

    The accept flag is set by default.

    \sa ignore()
*/

/*!
    \fn void TQTabletEvent::ignore()

    Clears the accept flag parameter of the tablet event object.

    Clearing the accept flag indicates that the event receiver does
    not want the tablet event. Unwanted tablet events are sent to the
    tqparent widget.

    The accept flag is set by default.

    \sa accept()
*/

/*!
    \fn TQPair<int, int> TQTabletEvent::uniqueId()

    Returns a unique ID for the current tqdevice. It is possible to
    generate a unique ID for any Wacom&copy; tqdevice. This makes it
    possible to differentiate between multiple tqdevices being used at
    the same time on the tablet. The \c first member tqcontains a value
    for the type, the \c second member tqcontains a physical ID obtained
    from the tqdevice. Each combination of these values is unique. Note:
    for different platforms, the \c first value is different due to
    different driver implementations.
*/

/*!
    \class TQChildEvent tqevent.h
    \brief The TQChildEvent class tqcontains event parameters for child object
    events.

    \ingroup events

    Child events are sent to objects when tqchildren are inserted or
    removed.

    A \c ChildRemoved event is sent immediately, but a \c
    ChildInserted event is \e posted (with TQApplication::postEvent()).

    Note that if a child is removed immediately after it is inserted,
    the \c ChildInserted event may be suppressed, but the \c
    ChildRemoved event will always be sent. In this case there will be
    a \c ChildRemoved event without a corresponding \c ChildInserted
    event.

    The handler for these events is TQObject::childEvent().
*/

/*!
    \fn TQChildEvent::TQChildEvent( Type type, TQObject *child )

    Constructs a child event object. The \a child is the object that
    is to be removed or inserted.

    The \a type parameter must be either \c TQEvent::ChildInserted or
    \c TQEvent::ChildRemoved.
*/

/*!
    \fn TQObject *TQChildEvent::child() const

    Returns the child widget that was inserted or removed.
*/

/*!
    \fn bool TQChildEvent::inserted() const

    Returns TRUE if the widget received a new child; otherwise returns
    FALSE.
*/

/*!
    \fn bool TQChildEvent::removed() const

    Returns TRUE if the object lost a child; otherwise returns FALSE.
*/




/*!
    \class TQCustomEvent tqevent.h
    \brief The TQCustomEvent class provides support for custom events.

    \ingroup events

    TQCustomEvent is a generic event class for user-defined events.
    User defined events can be sent to widgets or other TQObject
    instances using TQApplication::postEvent() or
    TQApplication::sendEvent(). Subclasses of TQObject can easily
    receive custom events by implementing the TQObject::customEvent()
    event handler function.

    TQCustomEvent objects should be created with a type ID that
    uniquely identifies the event type. To avoid clashes with the
    TQt-defined events types, the value should be at least as large as
    the value of the "User" entry in the TQEvent::Type enum.

    TQCustomEvent tqcontains a generic void* data member that may be used
    for transferring event-specific data to the receiver. Note that
    since events are normally delivered asynchronously, the data
    pointer, if used, must remain valid until the event has been
    received and processed.

    TQCustomEvent can be used as-is for simple user-defined event
    types, but normally you will want to make a subclass of it for
    your event types. In a subclass, you can add data members that are
    suitable for your event type.

    Example:
    \code
    class ColorChangeEvent : public TQCustomEvent
    {
    public:
	ColorChangeEvent( TQColor color )
	    : TQCustomEvent( 65432 ), c( color ) {}
	TQColor color() const { return c; }
    private:
	TQColor c;
    };

    // To send an event of this custom event type:

    ColorChangeEvent* ce = new ColorChangeEvent( blue );
    TQApplication::postEvent( receiver, ce );  // TQt will delete it when done

    // To receive an event of this custom event type:

    void MyWidget::customEvent( TQCustomEvent * e )
    {
	if ( e->type() == 65432 ) {  // It must be a ColorChangeEvent
	    ColorChangeEvent* ce = (ColorChangeEvent*)e;
	    newColor = ce->color();
	}
    }
    \endcode

    \sa TQWidget::customEvent(), TQApplication::notify()
*/


/*!
    Constructs a custom event object with event type \a type. The
    value of \a type must be at least as large as TQEvent::User. The
    data pointer is set to 0.
*/

TQCustomEvent::TQCustomEvent( int type )
    : TQEvent( (TQEvent::Type)type ), d( 0 )
{
}


/*!
    \fn TQCustomEvent::TQCustomEvent( Type type, void *data )

    Constructs a custom event object with the event type \a type and a
    pointer to \a data. (Note that any int value may safely be cast to
    TQEvent::Type).
*/


/*!
    \fn void TQCustomEvent::setData( void* data )

    Sets the generic data pointer to \a data.

    \sa data()
*/

/*!
    \fn void *TQCustomEvent::data() const

    Returns a pointer to the generic event data.

    \sa setData()
*/



/*!
    \fn TQDragMoveEvent::TQDragMoveEvent( const TQPoint& pos, Type type )

    Creates a TQDragMoveEvent for which the mouse is at point \a pos,
    and the event is of type \a type.

    \warning Do not create a TQDragMoveEvent yourself since these
    objects rely on TQt's internal state.
*/

/*!
    \fn void TQDragMoveEvent::accept( const TQRect & r )

    The same as accept(), but also notifies that future moves will
    also be acceptable if they remain within the rectangle \a r on the
    widget: this can improve performance, but may also be ignored by
    the underlying system.

    If the rectangle is \link TQRect::isEmpty() empty\endlink, then
    drag move events will be sent continuously. This is useful if the
    source is scrolling in a timer event.
*/

/*!
    \fn void TQDragMoveEvent::ignore( const TQRect & r)

    The opposite of accept(const TQRect&), i.e. says that moves within
    rectangle \a r are not acceptable (will be ignored).
*/

/*!
    \fn TQRect TQDragMoveEvent::answerRect() const

    Returns the rectangle for which the acceptance of the move event
    applies.
*/



/*!
    \fn const TQPoint& TQDropEvent::pos() const

    Returns the position where the drop was made.
*/

/*!
    \fn bool TQDropEvent::isAccepted () const

    Returns TRUE if the drop target accepts the event; otherwise
    returns FALSE.
*/

/*!
    \fn void TQDropEvent::accept(bool y=TRUE)

    Call this function to indicate whether the event provided data
    which your widget processed. Set \a y to TRUE (the default) if
    your widget could process the data, otherwise set \a y to FALSE.
    To get the data, use tqencodedData(), or preferably, the decode()
    methods of existing TQDragObject subclasses, such as
    TQTextDrag::decode(), or your own subclasses.

    \sa acceptAction()
*/

/*!
    \fn void TQDropEvent::acceptAction(bool y=TRUE)

    Call this to indicate that the action described by action() is
    accepted (i.e. if \a y is TRUE, which is the default), not merely
    the default copy action. If you call acceptAction(TRUE), there is
    no need to also call accept(TRUE).
*/

/*!
  \fn void TQDragMoveEvent::accept( bool y )
  \reimp
  \internal
  Remove in 3.0
*/

/*!
  \fn void TQDragMoveEvent::ignore()
  \reimp
  \internal
  Remove in 3.0
*/


/*!
    \enum TQDropEvent::Action

    This enum describes the action which a source requests that a
    target perform with dropped data.

    \value Copy The default action. The source simply uses the data
		provided in the operation.
    \value Link The source should somehow create a link to the
		location specified by the data.
    \value Move The source should somehow move the object from the
		location specified by the data to a new location.
    \value Private  The target has special knowledge of the MIME type,
		which the source should respond to in a similar way to
		a Copy.
    \value UserAction  The source and target can co-operate using
		special actions. This feature is not currently
		supported.

    The Link and Move actions only makes sense if the data is a
    reference, for example, text/uri-list file lists (see TQUriDrag).
*/

/*!
    \fn void TQDropEvent::setAction( Action a )

    Sets the action to \a a. This is used internally, you should not
    need to call this in your code: the \e source decides the action,
    not the target.
*/

/*!
    \fn Action TQDropEvent::action() const

    Returns the Action which the target is requesting to be performed
    with the data. If your application understands the action and can
    process the supplied data, call acceptAction(); if your
    application can process the supplied data but can only perform the
    Copy action, call accept().
*/

/*!
    \fn void TQDropEvent::ignore()

    The opposite of accept(), i.e. you have ignored the drop event.
*/

/*!
    \fn bool TQDropEvent::isActionAccepted () const

    Returns TRUE if the drop action was accepted by the drop site;
    otherwise returns FALSE.
*/


/*!
    \fn void TQDropEvent::setPoint (const TQPoint & np)

    Sets the drop to happen at point \a np. You do not normally need
    to use this as it will be set internally before your widget
    receives the drop event.
*/ // ### here too - what coordinate system?


/*!
    \class TQDragEnterEvent tqevent.h
    \brief The TQDragEnterEvent class provides an event which is sent to the widget when a drag and drop first drags onto the widget.

    \ingroup events
    \ingroup draganddrop

    This event is always immediately followed by a TQDragMoveEvent, so
    you only need to respond to one or the other event. This class
    inherits most of its functionality from TQDragMoveEvent, which in
    turn inherits most of its functionality from TQDropEvent.

    \sa TQDragLeaveEvent, TQDragMoveEvent, TQDropEvent
*/

/*!
    \fn TQDragEnterEvent::TQDragEnterEvent (const TQPoint & pos)

    Constructs a TQDragEnterEvent entering at the given point, \a pos.

    \warning Do not create a TQDragEnterEvent yourself since these
    objects rely on TQt's internal state.
*/

/*!
    \class TQDragLeaveEvent tqevent.h
    \brief The TQDragLeaveEvent class provides an event which is sent to the widget when a drag and drop leaves the widget.

    \ingroup events
    \ingroup draganddrop

    This event is always preceded by a TQDragEnterEvent and a series of
    \l{TQDragMoveEvent}s. It is not sent if a TQDropEvent is sent
    instead.

    \sa TQDragEnterEvent, TQDragMoveEvent, TQDropEvent
*/

/*!
    \fn TQDragLeaveEvent::TQDragLeaveEvent()

    Constructs a TQDragLeaveEvent.

    \warning Do not create a TQDragLeaveEvent yourself since these
    objects rely on TQt's internal state.
*/

/*!
    \class TQHideEvent tqevent.h
    \brief The TQHideEvent class provides an event which is sent after a widget is hidden.

    \ingroup events

    This event is sent just before TQWidget::hide() returns, and also
    when a top-level window has been hidden (iconified) by the user.

    If spontaneous() is TRUE the event originated outside the
    application, i.e. the user hid the window using the window manager
    controls, either by iconifying the window or by switching to
    another virtual desktop where the window isn't visible. The window
    will become hidden but not withdrawn. If the window was iconified,
    TQWidget::isMinimized() returns TRUE.

    \sa TQShowEvent
*/

/*!
    \fn TQHideEvent::TQHideEvent()

    Constructs a TQHideEvent.
*/

/*!
    \class TQShowEvent tqevent.h
    \brief The TQShowEvent class provides an event which is sent when a widget is shown.

    \ingroup events

    There are two kinds of show events: show events caused by the
    window system (spontaneous) and internal show events. Spontaneous
    show events are sent just after the window system shows the
    window, including after a top-level window has been shown
    (un-iconified) by the user. Internal show events are delivered
    just before the widget becomes visible.

    \sa TQHideEvent
*/

/*!
    \fn TQShowEvent::TQShowEvent()

    Constructs a TQShowEvent.
*/


/*!
  \fn TQByteArray TQDropEvent::data(const char* f) const

  \obsolete

  Use TQDropEvent::tqencodedData().
*/


/*!
  Destroys the event. If it was \link
  TQApplication::postEvent() posted \endlink,
  it will be removed from the list of events to be posted.
*/

TQEvent::~TQEvent()
{
    if ( posted && tqApp )
	TQApplication::removePostedEvent( this );
}

#endif // USE_QT4