summaryrefslogtreecommitdiffstats
path: root/kchart/kdchart/KDChartParams.h
blob: 32afd1fc80f4dfc8f7f563fd5f71d9c909b6833e (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
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
/* -*- Mode: C++ -*-
   KDChart - a multi-platform charting engine
*/

/****************************************************************************
 ** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB.  All rights reserved.
 **
 ** This file is part of the KDChart library.
 **
 ** This file may be distributed and/or modified under the terms of the
 ** GNU General Public License version 2 as published by the Free Software
 ** Foundation and appearing in the file LICENSE.GPL included in the
 ** packaging of this file.
 **
 ** Licensees holding valid commercial KDChart licenses may use this file in
 ** accordance with the KDChart Commercial License Agreement provided with
 ** the Software.
 **
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 **
 ** See http://www.klaralvdalens-datakonsult.se/?page=products for
 **   information about KDChart Commercial License Agreements.
 **
 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
 ** licensing are not clear to you.
 **
 **********************************************************************/
#ifndef __KDCHARTPARAMS_H__
#define __KDCHARTPARAMS_H__

#include <tqapplication.h>
#include <tqfont.h>
#include <tqcolor.h>
#include <tqpen.h>
#include <tqmap.h>
#include <tqdict.h>
#include <tqintdict.h>
#include <tqobject.h>
#include <tqtextstream.h>
#include <tqsimplerichtext.h>
#include <tqdom.h>
#include <limits.h>

#include <math.h>
#ifdef TQ_WS_WIN
#define M_PI 3.14159265358979323846
#endif

#include "KDChartGlobal.h"
#include "KDChartEnums.h"
#include "KDChartCustomBox.h"
#include "KDFrame.h"
#include "KDChartAxisParams.h"
#include "KDChartPropertySet.h"

#if COMPAT_TQT_VERSION >= 0x030000
#include <tqvaluevector.h>
#else
#include <tqarray.h>
#endif

/** \file KDChartParams.h
    \brief Header for all common chart parameters.

    This file is used to access all chart parameters except of the
    axis settings which you will find in \c KDChartAxisParams.h

    \see KDChartAxisParams.h
*/


typedef TQIntDict<KDChartPropertySet> KDChartPropertySetList;

#define KDCHART_ALL_AXES UINT_MAX-1

// PENDING(blackie) KHZ, please clean up here. I guess this defined can be removed now.
// Note: The following specification matches the UINT_MAX value used
//       in KDChartAxisParams::KDChartAxisParams() to initialize the
//       axis' _axisIsoRefAxis member.
//       OK, this is a dirty hack but is avoids circular dependency
//       between KDChartParams and KDChartAxisParams
#define KDCHART_NO_AXIS UINT_MAX
#define KDCHART_ALL_DATASETS UINT_MAX - 1

#define KDCHART_NO_DATASET UINT_MAX
#define KDCHART_UNKNOWN_CHART UINT_MAX - 2
#define KDCHART_ALL_CHARTS UINT_MAX - 1
#define KDCHART_NO_CHART UINT_MAX
#define KDCHART_GLOBAL_LINE_STYLE UINT_MAX
#define KDCHART_AUTO_SIZE INT_MAX
#define KDCHART_DATA_VALUE_AUTO_DIGITS INT_MAX
#define KDCHART_SAGITTAL_ROTATION INT_MAX
#define KDCHART_TANGENTIAL_ROTATION INT_MAX - 1
#define KDCHART_PROPSET_NORMAL_DATA 0
#define KDCHART_PROPSET_TRANSPARENT_DATA 1
#define KDCHART_PROPSET_HORI_LINE  2
#define KDCHART_PROPSET_VERT_LINE  3

// #define KDCHART_DATA_VALUE_AUTO_COLOR KDChartAutoColor::instance()->color()

// PENDING(blackie) Can we delete this now?
/* we must keep this wrongly spelled value for backward compatibility reasons */
#define KDCHART_SAGGITAL_ROTATION INT_MAX

/**
  Our charts may have up to 4 ordinate axes:
  2 left ones and 2 right ones
  */
#define KDCHART_CNT_ORDINATES 4

#define KDCHART_MAX_POLAR_DELIMS_AND_LABELS_POS 8
#define KDCHART_MAX_AXES 12


#define KDCHART_DATA_VALUE_AUTO_COLOR (KDChartAutoColor::instance()->color())

class KDCHART_EXPORT KDChartAutoColor {
public:
    static const KDChartAutoColor* instance();
    static void freeInstance();
    const TQColor* color() const
    {
        return &mColor;
    }
private:
    KDChartAutoColor();
    KDChartAutoColor( KDChartAutoColor const& );
    ~KDChartAutoColor();
    TQColor mColor;
    static KDChartAutoColor *mInstance;
};

/*
// #define KDCHART_DATA_VALUE_AUTO_COLOR KDChartParams_KDChartAutoColor
*/


class KDCHART_EXPORT KDChartParams : public TQObject
{

    Q_OBJECT
  
    Q_ENUMS(ChartType)
    Q_ENUMS(SourceMode)
    Q_ENUMS(BarChartSubType)
    Q_ENUMS(LineChartSubType)
    Q_ENUMS(LineMarkerStyle)
    Q_ENUMS(AreaChartSubType)
    Q_ENUMS(AreaLocation)
    Q_ENUMS(PolarChartSubType)
    Q_ENUMS(PolarMarkerStyle)
    Q_ENUMS(HiLoChartSubType)
    Q_ENUMS(BWChartSubType)
    Q_ENUMS(BWStatVal)
    Q_ENUMS(LegendPosition)
    Q_ENUMS(LegendSource)
    Q_ENUMS(HdFtPos)

    // Needed for TQSA
    Q_ENUMS( BrushStyle )
    Q_ENUMS( PenStyle )
    Q_ENUMS( Orientation )


public slots: // PENDING(blackie) merge public slots into one section.
    void setOptimizeOutputForScreen( bool screenOutput )
        {
            _optimizeOutputForScreen = screenOutput;
        }


    bool optimizeOutputForScreen() const
        {
            return _optimizeOutputForScreen;
        }

    void setGlobalLeading( int left, int top, int right, int bottom );

    void setGlobalLeadingLeft( int leading )
        {
            _globalLeadingLeft = leading;
            emit changed();
        }
    void setGlobalLeadingTop( int leading )
        {
            _globalLeadingTop = leading;
            emit changed();
        }
    void setGlobalLeadingRight( int leading )
        {
            _globalLeadingRight = leading;
            emit changed();
        }
    void setGlobalLeadingBottom( int leading )
        {
            _globalLeadingBottom = leading;
            emit changed();
        }
    int globalLeadingLeft() const
        {
            return _globalLeadingLeft;
        }
    int globalLeadingTop() const
        {
            return _globalLeadingTop;
        }
    int globalLeadingRight() const
        {
            return _globalLeadingRight;
        }
    int globalLeadingBottom() const
        {
            return _globalLeadingBottom;
        }

    int registerProperties( KDChartPropertySet& rSet );
    void setProperties( int id, KDChartPropertySet& rSet );
    bool removeProperties( int id );
    bool properties( int id, KDChartPropertySet& rSet ) const;
    KDChartPropertySet* properties( int id );
    bool calculateProperties( int startId, KDChartPropertySet& rSet ) const;

public:

// TQMOC_SKIP_BEGIN
    class KDCHART_EXPORT KDChartFrameSettings
    {
        // Q_OBJECT
        // 
    public:
        KDChartFrameSettings();
        KDChartFrameSettings( uint           dataRow,
                              uint           dataCol,
                              uint           data3rd,
                              const KDFrame& frame,
                              int            outerGapX,
                              int            outerGapY,
                              int            innerGapX,
                              int            innerGapY,
                              bool           addFrameWidthToLayout  = true,
                              bool           addFrameHeightToLayout = true );

        // public slots:
        uint dataRow() const
            {
                return _dataRow;
            }
        uint dataCol() const
            {
                return _dataCol;
            }
        uint data3rd() const
            {
                return _data3rd;
            }

        void setDataRow( uint dataRow )
            {
                _dataRow = dataRow;
            }
        void setDataCol( uint dataCol )
            {
                _dataCol = dataCol;
            }
        void setData3rd( uint data3rd )
            {
                _data3rd = data3rd;
            }


        void resetFrame()
        {
            if( _frame )
                delete _frame;
            _frame = new KDFrame();
        }


        const KDFrame* framePtr() const
            {
                return _frame;
            }


        const KDFrame& frame() const
            {
                return *_frame;
            }


        int innerGapX() const
            {
                return _innerGapX;
            }


        int innerGapY() const
            {
                return _innerGapY;
            }


        int outerGapX() const
            {
                return _outerGapX;
            }


        int outerGapY() const
            {
                return _outerGapY;
            }


        bool addFrameWidthToLayout() const
            {
                return _addFrameWidthToLayout;
            }


        bool addFrameHeightToLayout() const
            {
                return _addFrameHeightToLayout;
            }

        // public:
        virtual ~KDChartFrameSettings();


        static void createFrameSettingsNode( TQDomDocument& document,
                                             TQDomNode& parent,
                                             const TQString& elementName,
                                             const KDChartFrameSettings* settings,
                                             uint areaId );

        static bool readFrameSettingsNode( const TQDomElement& element,
                                           KDChartFrameSettings& settings,
                                           uint& areaId );


        static void deepCopy( KDChartFrameSettings& D, const KDChartFrameSettings& R ) {
            D._dataRow = R._dataRow;
            D._dataCol = R._dataCol;
            D._data3rd = R._data3rd;

            delete D._frame;
            if( R._frame ){
                D._frame = new KDFrame();
                KDFrame::deepCopy(*D._frame, *R._frame);
            }else{
                D._frame = 0;
            }

            D._outerGapX = R._outerGapX;
            D._outerGapY = R._outerGapY;
            D._innerGapX = R._innerGapX;
            D._innerGapY = R._innerGapY;
            D._addFrameWidthToLayout = R._addFrameWidthToLayout;
            D._addFrameHeightToLayout = R._addFrameHeightToLayout;
        }

    private:
        // KDChartFrameSettings( const KDChartFrameSettings& other ) :TQObject( 0 ) {
        KDChartFrameSettings( const KDChartFrameSettings& ) {}
        KDChartFrameSettings& operator=( const KDChartFrameSettings& ){return *this;}


    private:
        uint    _dataRow;
        uint    _dataCol;
        uint    _data3rd;
        KDFrame* _frame;
        int     _outerGapX;
        int     _outerGapY;
        int     _innerGapX;
        int     _innerGapY;
        bool    _addFrameWidthToLayout;
        bool    _addFrameHeightToLayout;
    };

// TQMOC_SKIP_END

public slots:

    void setFrame( uint           area,
                   const KDFrame& frame,
                   int            outerGapX,
                   int            outerGapY,
                   int            innerGapX,
                   int            innerGapY,
                   bool           addFrameWidthToLayout = true,
                   bool           addFrameHeightToLayout = true )
        {
            _areaDict.setAutoDelete( TRUE );
            _areaDict.replace( TQString( "%1/-----/-----/-----" ).arg( area, 5 ),
                              new KDChartFrameSettings(0,0,0,
                                                       frame,
                                                       outerGapX,
                                                       outerGapY,
                                                       innerGapX,
                                                       innerGapY,
                                                       addFrameWidthToLayout,
                                                       addFrameHeightToLayout ) );
            emit changed();
        }


    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setSimpleFrame( uint        area,
                         int         outerGapX = 0,
                         int         outerGapY = 0,
                         int         innerGapX = 0,
                         int         innerGapY = 0,
                         bool        addFrameWidthToLayout      = true,
                         bool        addFrameHeightToLayout     = true,
                         KDFrame::SimpleFrame    simpleFrame    = KDFrame::FrameFlat,
                         int                     lineWidth      = 1,
                         int                     midLineWidth   = 0,
                         TQPen                    pen            = TQPen(),
                         TQBrush                  background     = TQBrush( TQt::NoBrush ),
                         const TQPixmap*          backPixmap     = 0, // no pixmap
                         KDFrame::BackPixmapMode backPixmapMode = KDFrame::PixStretched,
                         int                     shadowWidth    = 0,
                         KDFrame::CornerName     sunPos         = KDFrame::CornerTopLeft )
        {
            _areaDict.setAutoDelete( TRUE );
            KDFrame frame( TQRect(0,0,0,0),
                     simpleFrame,
                     lineWidth,
                     midLineWidth,
                     pen,
                     background,
                     backPixmap,
                     backPixmapMode,
                     shadowWidth,
                           sunPos );

            _areaDict.replace( TQString( "%1/-----/-----/-----" ).arg( area, 5 ),
                              new KDChartFrameSettings( 0,0,0, frame,
                                                        outerGapX,
                                                        outerGapY,
                                                        innerGapX,
                                                        innerGapY,
                                                        addFrameWidthToLayout,
                                                        addFrameHeightToLayout ) );
            emit changed();
        }

    bool removeFrame( uint area );


    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setDataRegionFrame( uint dataRow,
                             uint dataCol,
                             uint, // important: we ignore the data3rd parameter for now!
                             int  innerGapX = 0,
                             int  innerGapY = 0,
                             bool addFrameWidthToLayout      = true,
                             bool addFrameHeightToLayout     = true,
                             KDFrame::SimpleFrame    simpleFrame    = KDFrame::FrameFlat,
                             int                     lineWidth      = 1,
                             int                     midLineWidth   = 0,
                             TQPen                    pen            = TQPen(),
                             int                     shadowWidth    = 0,
                             KDFrame::CornerName     sunPos         = KDFrame::CornerTopLeft )
        {
            _areaDict.setAutoDelete( TRUE );
            KDFrame frame( TQRect(0,0,0,0),
                           simpleFrame,
                           lineWidth,
                           midLineWidth,
                           pen,
                           TQBrush( TQt::NoBrush ),
                           0,
                           KDFrame::PixStretched,
                           shadowWidth,
                           sunPos );

            _areaDict.replace(
                dataRegionFrameAreaName( dataRow, dataCol, 0 ), //data3rd 5 ),
                new KDChartFrameSettings( dataRow,
                                          dataCol,
                                          0, // important: we ignore the data3rd parameter for now!
                                          frame,
                                          0,
                                          0,
                                          innerGapX,
                                          innerGapY,
                                          addFrameWidthToLayout,
                                          addFrameHeightToLayout ) );
            emit changed();
        }


    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    bool moveDataRegionFrame( uint oldDataRow,
                             uint oldDataCol,
                             uint, // important: we ignore the data3rd parameter for now!
                             uint newDataRow,
                             uint newDataCol,
                             uint // important: we ignore the data3rd parameter for now!
                             );


    const KDChartFrameSettings* frameSettings( uint area,
                                               bool& bFound,
                                               int* pIterIdx=0 ) const;

    const KDChartFrameSettings* nextFrameSettings( bool& bFound,
                                                   int* pIterIdx ) const;


public:
    typedef TQIntDict <KDChartCustomBox > CustomBoxDict;

public slots:
    uint insertCustomBox( const KDChartCustomBox & box );
    bool removeCustomBox( const uint & idx );

    void removeAllCustomBoxes()
    {
        emit changed();
        _customBoxDict.setAutoDelete( true );
        _customBoxDict.clear();
    }

    KDChartCustomBox* customBoxRef( uint box );
    const KDChartCustomBox* customBox( uint box ) const;
    uint maxCustomBoxIdx() const;


public:
    enum ChartType { NoType, Bar, Line, Area, Pie, HiLo, Ring, Polar, BoxWhisker };

public slots:
    void setChartType( ChartType chartType );
    ChartType chartType() const
        {
            return _chartType;
        }


    static TQString chartTypeToString( ChartType type );
    static ChartType stringToChartType( const TQString& string );

    void setAdditionalChartType( ChartType chartType );
    ChartType additionalChartType() const
        {
            return _additionalChartType;
        }
public:

    enum SourceMode {
        UnknownMode      = 0,
        DontUse          = 1,
        DataEntry        = 2,
        AxisLabel        = 3,
        LegendText       = 4,
        ExtraLinesAnchor = 5,
        Last_SourceMode  = ExtraLinesAnchor };

public slots:
    void setChartSourceMode( SourceMode mode,
                             uint dataset,
                             uint dataset2 = KDCHART_NO_DATASET,
                             uint chart = 0 );

    static TQString chartSourceModeToString( const SourceMode& mode );
    static SourceMode stringToChartSourceMode( const TQString& string );


    bool neverUsedSetChartSourceMode() const
        {
            return !_setChartSourceModeWasUsed;
        }

    SourceMode chartSourceMode( uint dataset,
                                uint dataset2 = KDCHART_NO_DATASET,
                                uint* chart = 0 ) const;

    bool findDataset( SourceMode mode,
                      uint& dataset,
                      uint& dataset2,
                      uint chart = 0 ) const;

    bool findDatasets( SourceMode mode1,
                       SourceMode mode2,
                       uint& dataset,
                       uint& dataset2,
                       uint chart = 0 ) const;

    uint maxDatasetSourceMode() const
        {
            return _maxDatasetSourceMode;
        }


    void setDefaultAxesTypes();
    void activateDefaultAxes();


    void setNumValues( uint numValues )
        {
            _numValues = numValues;
            emit changed();
        }


    int numValues() const
        {
            return _numValues;
        }


    void calculateShadowColors( TQColor color,
                                TQColor& shadow1,
                                TQColor& shadow2 ) const;

    void setDataColor( uint dataset, TQColor color );
    TQColor dataColor( uint dataset ) const;

    void setDataDefaultColors();
    void setDataRainbowColors();
    void setDataSubduedColors( bool ordered = false );


    void setShadowBrightnessFactor( double factor )
        {
            _shadowBrightnessFactor = factor;
            recomputeShadowColors();
            emit changed();
        }

    double shadowBrightnessFactor() const
        {
            return _shadowBrightnessFactor;
        }


    void setShadowPattern( Qt::BrushStyle style ) {
        _shadowPattern = style;
        emit changed();
    }

    Qt::BrushStyle shadowPattern() const {
        return _shadowPattern;
    }


    void setOutlineDataColor( TQColor color )
        {
            _outlineDataColor = color;
            emit changed();
        }


    TQColor outlineDataColor() const
        {
            return _outlineDataColor;
        }


    void setOutlineDataLineWidth( uint width )
        {
            _outlineDataLineWidth = width;
            emit changed();
        }

    uint outlineDataLineWidth() const
        {
            return _outlineDataLineWidth;
        }


    void setOutlineDataLineStyle( Qt::PenStyle style )
        {
            _outlineDataLineStyle = style;
            emit changed();
        }

    Qt::PenStyle outlineDataLineStyle() const
        {
            return _outlineDataLineStyle;
        }


    uint maxDataColor() const
        {
            return _maxDatasetColor;
        }


    void setThreeDShadowColors( bool shadow )
        {
            _threeDShadowColors = shadow;
            emit changed();
        }


    bool threeDShadowColors() const
        {
            return _threeDShadowColors;
        }


    static int roundVal( double d )
        {
            double fr;
            double i=0.0; // initialization necessary for Borland C++
            fr = modf( d, &i );
            int ret = static_cast < int > ( i );
            if( 0.49999 <= fabs( fr ) )
                ret += ( 0.0 < d ) ? 1 : -1;
            return ret;
        }

    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setPrintDataValues( bool active,
                             uint chart = KDCHART_ALL_CHARTS,
                             int divPow10 = 0,
                             int digitsBehindComma = KDCHART_DATA_VALUE_AUTO_DIGITS,
                             TQFont* font   = 0,
                             uint size     = UINT_MAX, //  <-- makes us use the *default* font params
                             //                                by IGNORING settings of
                             //                                the following parameters!
                             const TQColor* color = KDCHART_DATA_VALUE_AUTO_COLOR,
                             KDChartEnums::PositionFlag negativePosition = KDChartEnums::PosCenter,
                             uint negativeAlign    = TQt::AlignCenter,
                             int  negativeDeltaX   =    0,
                             int  negativeDeltaY   =    0,
                             int  negativeRotation =    0,
                             KDChartEnums::PositionFlag positivePosition = KDChartEnums::PosCenter,
                             uint positiveAlign    = TQt::AlignCenter,
                             int  positiveDeltaX   =    0,
                             int  positiveDeltaY   =    0,
                             int  positiveRotation =    0,
                             KDChartEnums::TextLayoutPolicy policy = KDChartEnums::LayoutPolicyRotate );

    void setDataValuesCalc( int divPow10 = 0,
                            int digitsBehindComma = KDCHART_DATA_VALUE_AUTO_DIGITS,
                            uint chart = KDCHART_ALL_CHARTS );
    void setDataValuesFont( TQFont* font,
                            uint size  = UINT_MAX,
                            uint chart = KDCHART_ALL_CHARTS );

    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setDataValuesPlacing( KDChartEnums::PositionFlag position,
                               uint align,
                               int  deltaX,
                               int  deltaY,
                               int  rotation,
                               bool specifyingPositiveValues = true,
                               uint chart = KDCHART_ALL_CHARTS );

    void setDataValuesColors( const TQColor* color = KDCHART_DATA_VALUE_AUTO_COLOR,
                              const TQBrush& background = TQBrush(Qt::NoBrush),
                              uint chart = KDCHART_ALL_CHARTS );

    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setDataValuesPolicy( KDChartEnums::TextLayoutPolicy policy = KDChartEnums::LayoutPolicyRotate,
                              uint chart = KDCHART_ALL_CHARTS );

    void setDataValuesShowInfinite( bool dataValuesShowInfinite = true,
                                    uint chart = KDCHART_ALL_CHARTS );

    void setPrintDataValuesWithDefaultFontParams( uint chart = KDCHART_ALL_CHARTS,
                                                  bool callSetPrintDataValues = true );

    void setAllowOverlappingDataValueTexts( bool allow )
        {
            _allowOverlappingDataValueTexts = allow;
        }


    bool allowOverlappingDataValueTexts() const
        {
            return _allowOverlappingDataValueTexts;
        }

    bool printDataValuesWithDefaultFontParams( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._useDefaultFontParams
                : _printDataValuesSettings._useDefaultFontParams;
        }

    bool printDataValues( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._printDataValues
                : _printDataValuesSettings._printDataValues;
        }


    int dataValuesDivPow10( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._divPow10
                : _printDataValuesSettings._divPow10;
        }


    int dataValuesDigitsBehindComma( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._digitsBehindComma
                : _printDataValuesSettings._digitsBehindComma;
        }


    TQFont dataValuesFont( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesFont
                : _printDataValuesSettings._dataValuesFont;
        }


    bool dataValuesUseFontRelSize( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesUseFontRelSize
                : _printDataValuesSettings._dataValuesUseFontRelSize;
        }


    int dataValuesFontRelSize( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesFontRelSize
                : _printDataValuesSettings._dataValuesFontRelSize;
        }


    TQColor dataValuesColor( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesColor
                : _printDataValuesSettings._dataValuesColor;
        }


    TQBrush dataValuesBackground( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesBrush
                : _printDataValuesSettings._dataValuesBrush;
        }


    bool dataValuesAutoColor( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesAutoColor
                : _printDataValuesSettings._dataValuesAutoColor;
        }


    KDChartEnums::PositionFlag dataValuesAnchorPosition( uint chart,
                                                         bool negative ) const;
    uint dataValuesAnchorAlign( uint chart, bool negative ) const;
    int dataValuesAnchorDeltaX( uint chart, bool negative ) const;
    int dataValuesAnchorDeltaY( uint chart, bool negative ) const;
    int dataValuesRotation( uint chart, bool negative ) const;

    KDChartEnums::TextLayoutPolicy dataValuesLayoutPolicy( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesLayoutPolicy
                : _printDataValuesSettings._dataValuesLayoutPolicy;
        }


    bool dataValuesShowInfinite( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesShowInfinite
                : _printDataValuesSettings._dataValuesShowInfinite;
        }


    // for backward compatibility we may NOT remove these functions:
    void setPrintDataValuesColor( uint chart = KDCHART_ALL_CHARTS,
                                  const TQColor* color = KDCHART_DATA_VALUE_AUTO_COLOR );
    void setPrintDataValuesFontRelSize( uint chart, uint size );


    static TQString markerStyleToString(   int style );
    static TQString markerStyleToStringTr( int style );
    static int stringToMarkerStyle(   const TQString& string );
    static int stringToMarkerStyleTr( const TQString& string );

    // END GENERAL


public:

    // BAR CHART-SPECIFIC
    enum BarChartSubType { BarNormal, BarStacked, BarPercent, BarMultiRows };

public slots:
    void setBarChartSubType( BarChartSubType barChartSubType )
        {
            _barChartSubType = barChartSubType;
            emit changed();
        }

    BarChartSubType barChartSubType() const
        {
            return _barChartSubType;
        }





    static TQString barChartSubTypeToString( BarChartSubType type );
    static BarChartSubType stringToBarChartSubType( const TQString& string );


    void setThreeDBars( bool threeDBars )
        {
            _threeDBars = threeDBars;
            emit changed();
        }

    bool threeDBars() const
        {
            return _threeDBars;
        }


    void setThreeDBarsShadowColors( bool shadow )
        {
            _threeDShadowColors = shadow;
            emit changed();
        }


    bool threeDBarsShadowColors() const
        {
            return _threeDShadowColors;
        }


    TQColor dataShadow1Color( uint dataset ) const;
    TQColor dataShadow2Color( uint dataset ) const;


    void setThreeDBarAngle( uint angle );
    uint threeDBarAngle() const
        {
            return _threeDBarAngle;
        }


    double cosThreeDBarAngle() const
        {
            return _cosThreeDBarAngle;
        }


    void setThreeDBarDepth( double depth )
        {
            _threeDBarDepth = depth;
            emit changed();
        }


    double threeDBarDepth() const
        {
            return _threeDBarDepth;
        }


    void setDatasetGap( int gap )
        {
            _datasetGap = gap;
            emit changed();
        }

    int datasetGap() const
        {
            return _datasetGap;
        }


    void setDatasetGapIsRelative( bool gapIsRelative )
        {
            _datasetGapIsRelative = gapIsRelative;
            emit changed();
        }

    bool datasetGapIsRelative() const
        {
            return _datasetGapIsRelative;
        }


    void setValueBlockGap( int gap )
        {
            _valueBlockGap = gap;
            emit changed();
        }

    int valueBlockGap() const
        {
            return _valueBlockGap;
        }


    void setValueBlockGapIsRelative( bool gapIsRelative )
        {
            _valueBlockGapIsRelative = gapIsRelative;
            emit changed();
        }

    bool valueBlockGapIsRelative() const
        {
            return _valueBlockGapIsRelative;
        }


    void setBarWidth( int width = KDCHART_AUTO_SIZE )
        {
          if ( width == KDCHART_AUTO_SIZE ) {
	    _barWidth = width;
            _userWidth = 0;
	  }
          else
	  _userWidth = width;

          emit changed();
        }


    int barWidth() const
        {
            return _barWidth;
        }

  int userWidth() const
        {
	  return _userWidth;
        }

    int numBarsDisplayed() const
        {
            return _barsDisplayed;
        }

    int numBarsLeft() const
        {
            return _barsLeft;
        }

    void setDrawSolidExcessArrows( bool solidArrows ) {
        _solidExcessArrows = solidArrows;
        emit changed();
    }

    bool drawSolidExcessArrows() const
        {
            return _solidExcessArrows;
        }

    // END BAR CHART-SPECIFIC

public:
    // LINE/AREA CHART-SPECIFIC
    enum LineChartSubType { LineNormal, LineStacked, LinePercent };

public slots:
    void setLineChartSubType( LineChartSubType lineChartSubType )
        {
            _lineChartSubType = lineChartSubType;
            emit changed();
        }

    LineChartSubType lineChartSubType() const
        {
            return _lineChartSubType;
        }


    static LineChartSubType stringToLineChartSubType( const TQString& string );
    static TQString lineChartSubTypeToString( LineChartSubType type );


    void setLineMarker( bool marker )
        {
            _lineMarker = marker;
            emit changed();
        }

    bool lineMarker() const
        {
            return _lineMarker;
        }

public:
    enum LineMarkerStyle { LineMarkerCircle  = 0,
            LineMarkerSquare  = 1,
            LineMarkerDiamond = 2,
            LineMarker1Pixel  = 3,
            LineMarker4Pixels = 4,
            LineMarkerRing    = 5,
            LineMarkerCross   = 6,
            LineMarkerFastCross = 7 };

    // PENDING(blackie) Add a wrapper for this
    typedef TQMap<uint,LineMarkerStyle> LineMarkerStyleMap;
public slots:

        void setLineMarkerStyle( uint dataset, LineMarkerStyle style );
    void setLineMarkerStyles( LineMarkerStyleMap map );
    LineMarkerStyle lineMarkerStyle( uint dataset ) const;

    static TQString lineMarkerStyleToString( LineMarkerStyle style );
    static TQString lineMarkerStyleToStringTr( LineMarkerStyle style );
    static LineMarkerStyle stringToLineMarkerStyle( const TQString& string );
    static LineMarkerStyle stringToLineMarkerStyleTr( const TQString& string );

    LineMarkerStyleMap lineMarkerStyles() const {
        return _lineMarkerStyles;
    }


    uint maxDatasetLineMarkerStyle() const
        {
            return _maxDatasetLineMarkerStyle;
        }


    void setLineMarkerSize( TQSize size )
        {
            _lineMarkerSize = size;
            emit changed();
        }

    TQSize lineMarkerSize() const
        {
            return _lineMarkerSize;
        }

    void setLineWidth( int width )
        {
            _lineWidth = width;
            emit changed();
        }

    int lineWidth() const
        {
            return _lineWidth;
        }


    void setLineColor( TQColor color = TQColor() )
        {
            _lineColor = color;
            emit changed();
        }

    TQColor lineColor() const
        {
            return _lineColor;
        }

    void setLineStyle( Qt::PenStyle style, uint dataset=KDCHART_GLOBAL_LINE_STYLE );

    Qt::PenStyle lineStyle( uint dataset=KDCHART_GLOBAL_LINE_STYLE ) const;


    void setThreeDLines( bool threeD ) {
        _threeDLines = threeD;
        emit changed();
    }


    bool threeDLines() const {
        return _threeDLines;
    }


    void setThreeDLineDepth( int depth ) {
        _threeDLineDepth = depth;
        emit changed();
    }


    int threeDLineDepth() const {
        return _threeDLineDepth;
    }


    // NOTE: documentation of this function is temporary disabled.
    // Feature is currently not supported, will be implemented
    // by future versions of KDChart
    void setThreeDLineXRotation( int degrees ) {
        _threeDLineXRotation = degrees;
        emit changed();
    }


    // NOTE: documentation of this function is temporary disabled.
    // Feature is currently not supported, will be implemented
    // by future versions of KDChart
    int threeDLineXRotation() const {
        return _threeDLineXRotation;
    }


    // NOTE: documentation of this function is temporary disabled.
    // Feature is currently not supported, will be implemented
    // by future versions of KDChart
    void setThreeDLineYRotation( int degrees ) {
        _threeDLineYRotation = degrees;
        emit changed();
    }


    // NOTE: documentation of this function is temporary disabled.
    // Feature is currently not supported, will be implemented
    // by future versions of KDChart
    int threeDLineYRotation() const {
        return _threeDLineYRotation;
    }

public:
    enum AreaChartSubType { AreaNormal, AreaStacked, AreaPercent };

public slots:
    void setAreaChartSubType( AreaChartSubType areaChartSubType )
        {
            _areaChartSubType = areaChartSubType;
            // activate default data value text settings for this chart type
            if(    printDataValues( 0 )
                   && printDataValuesWithDefaultFontParams( 0 ) )
                setPrintDataValues( true, 0 );
            emit changed();
        }


    AreaChartSubType areaChartSubType() const
        {
            return _areaChartSubType;
        }


    static TQString areaChartSubTypeToString( AreaChartSubType type );
    static AreaChartSubType stringToAreaChartSubType( const TQString& string );

public:
    enum AreaLocation { AreaAbove, AreaBelow };
public slots:

    void setAreaLocation( AreaLocation location )
        {
            _areaLocation = location;
            emit changed();
        }

    AreaLocation areaLocation() const
        {
            return _areaLocation;
        }


    static TQString areaLocationToString( AreaLocation type );
    static AreaLocation stringToAreaLocation( const TQString& string );

    // END LINE/AREA CHART-SPECIFIC

public:
    // POLAR CHART-SPECIFIC
    enum PolarChartSubType { PolarNormal, PolarStacked, PolarPercent };

public slots:
    void setPolarChartSubType( PolarChartSubType polarChartSubType )
        {
            _polarChartSubType = polarChartSubType;
            emit changed();
        }

    PolarChartSubType polarChartSubType() const
        {
            return _polarChartSubType;
        }


    static PolarChartSubType stringToPolarChartSubType( const TQString& string );
    static TQString polarChartSubTypeToString( PolarChartSubType type );

    void setPolarMarker( bool marker )
        {
            _polarMarker = marker;
            emit changed();
        }

    bool polarMarker() const
        {
            return _polarMarker;
        }

public:
    enum PolarMarkerStyle { PolarMarkerCircle  = 0,
                            PolarMarkerSquare  = 1,
                            PolarMarkerDiamond = 2,
                            PolarMarker1Pixel  = 3,
                            PolarMarker4Pixels = 4,
                            PolarMarkerRing    = 5,
                            PolarMarkerCross   = 6 };

public slots:
    void setPolarMarkerStyle( uint dataset, PolarMarkerStyle style );
    PolarMarkerStyle polarMarkerStyle( uint dataset ) const;
    static TQString polarMarkerStyleToString( PolarMarkerStyle style );
    static TQString polarMarkerStyleToStringTr( PolarMarkerStyle style );
    static PolarMarkerStyle stringToPolarMarkerStyle( const TQString& string );
    static PolarMarkerStyle stringToPolarMarkerStyleTr( const TQString& string );

public:
    typedef TQMap<uint,PolarMarkerStyle> PolarMarkerStyleMap;

public slots:
    void setPolarMarkerStyles( PolarMarkerStyleMap map );

    PolarMarkerStyleMap polarMarkerStyles() const {
        return _polarMarkerStyles;
    }

    uint maxDatasetPolarMarkerStyle() const
        {
            return _maxDatasetPolarMarkerStyle;
        }

    void setPolarMarkerSize( TQSize size = TQSize( -40, -40 ) )
        {
            _polarMarkerSize = size;
            emit changed();
        }

    TQSize polarMarkerSize() const
        {
            return _polarMarkerSize;
        }

    void setPolarLineWidth( int width = -3 )
        {
            _polarLineWidth = width;
            emit changed();
        }

    int polarLineWidth() const
        {
            return _polarLineWidth;
        }


    void setPolarZeroDegreePos( int degrees )
        {
            _polarZeroDegreePos = degrees;
        }

    int polarZeroDegreePos() const
        {
            return _polarZeroDegreePos;
        }


    void setPolarRotateCircularLabels( bool rotateCircularLabels )
        {
            _polarRotateCircularLabels = rotateCircularLabels;
        }

    bool polarRotateCircularLabels() const
        {
            return _polarRotateCircularLabels;
        }


    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setPolarDelimsAndLabelsAtPos( KDChartEnums::PositionFlag pos,
                                       bool showDelimiters,
                                       bool showLabels );

    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    bool polarDelimAtPos( KDChartEnums::PositionFlag pos ) const;

    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    bool polarLabelsAtPos( KDChartEnums::PositionFlag pos ) const;

    // END POLAR CHART-SPECIFIC


    // PIE/RING CHART-SPECIFIC

    void setExplode( bool explode )
        {
            _explode = explode;
            emit changed();
        }

    bool explode() const
        {
            return _explode;
        }


    void setExplodeValues( TQValueList<int> explodeList ) {
        _explodeList = explodeList;
        emit changed();
    }


    // Unfortunately this is not avaialble from TQSA-
    TQValueList<int> explodeValues() const {
        return _explodeList;
    }

public:
    typedef TQMap<int,double> ExplodeFactorsMap;

public slots:
    void setExplodeFactors( ExplodeFactorsMap factors ) {
        _explodeFactors = factors;
        emit changed();
    }


    ExplodeFactorsMap explodeFactors() const {
        return _explodeFactors;
    }


    void setExplodeFactor( double factor )
        {
            _explodeFactor = factor;
            emit changed();
        }

    double explodeFactor() const
        {
            return _explodeFactor;
        }


    void setThreeDPies( bool threeDPies )
        {
            _threeDPies = threeDPies;
            emit changed();
        }

    bool threeDPies() const
        {
            return _threeDPies;
        }


    void setThreeDPieHeight( int pixels )
        {
            _threeDPieHeight = pixels;
            emit changed();
        }

    int threeDPieHeight() const
        {
            return _threeDPieHeight;
        }

    void setPieStart( int degrees )
        {
            while ( degrees < 0 )
                degrees += 360;
            while ( degrees >= 360 )
                degrees -= 360;
            _pieStart = degrees;

            emit changed();
        }


    int pieStart() const
        {
            return _pieStart;
        }

    void setRingStart( int degrees )
        {
            while ( degrees < 0 )
                degrees += 360;
            while ( degrees >= 360 )
                degrees -= 360;
            _ringStart = degrees;

            emit changed();
        }


    int ringStart() const
        {
            return _ringStart;
        }

    void setRelativeRingThickness( bool relativeThickness ) {
        _relativeRingThickness = relativeThickness;

        emit changed();
    }


    bool relativeRingThickness() const {
        return _relativeRingThickness;
    }

    // END PIE/RING CHART-SPECIFIC

public:
    // HI/LO CHART-SPECIFIC
    enum HiLoChartSubType { HiLoNormal, HiLoSimple = HiLoNormal,
                            HiLoClose, HiLoOpenClose };

public slots:
    void setHiLoChartSubType( HiLoChartSubType hiLoChartSubType )
        {
            _hiLoChartSubType = hiLoChartSubType;
            emit changed();
        }

    HiLoChartSubType hiLoChartSubType() const
        {
            return _hiLoChartSubType;
        }

    static TQString hiLoChartSubTypeToString( HiLoChartSubType type );
    static HiLoChartSubType stringToHiLoChartSubType( const TQString& string );
    void setHiLoChartPrintLowValues( bool active,
                                     TQFont* font = 0,
                                     int size = 14,
                                     TQColor* color = 0 );

    bool hiLoChartPrintLowValues() const
        {
            return _hiLoChartPrintLowValues;
        }


    TQFont hiLoChartLowValuesFont() const
        {
            return _hiLoChartLowValuesFont;
        }


    bool hiLoChartLowValuesUseFontRelSize() const
        {
            return _hiLoChartLowValuesUseFontRelSize;
        }


    int hiLoChartLowValuesFontRelSize() const
        {
            return _hiLoChartLowValuesFontRelSize;
        }


    TQColor hiLoChartLowValuesColor() const
        {
            return _hiLoChartLowValuesColor;
        }

    void setHiLoChartPrintHighValues( bool active,
                                      TQFont* font = 0,
                                      int size = 14,
                                      TQColor* color = 0 );


    bool hiLoChartPrintHighValues() const
        {
            return _hiLoChartPrintHighValues;
        }


    TQFont hiLoChartHighValuesFont() const
        {
            return _hiLoChartHighValuesFont;
        }


    bool hiLoChartHighValuesUseFontRelSize() const
        {
            return _hiLoChartHighValuesUseFontRelSize;
        }


    int hiLoChartHighValuesFontRelSize() const
        {
            return _hiLoChartHighValuesFontRelSize;
        }


    TQColor hiLoChartHighValuesColor() const
        {
            return _hiLoChartHighValuesColor;
        }

    void setHiLoChartPrintOpenValues( bool active,
                                      TQFont* font = 0,
                                      uint size = 14,
                                      TQColor* color = 0 );

    bool hiLoChartPrintOpenValues() const
        {
            return _hiLoChartPrintOpenValues;
        }


    TQFont hiLoChartOpenValuesFont() const
        {
            return _hiLoChartOpenValuesFont;
        }


    bool hiLoChartOpenValuesUseFontRelSize() const
        {
            return _hiLoChartOpenValuesUseFontRelSize;
        }


    int hiLoChartOpenValuesFontRelSize() const
        {
            return _hiLoChartOpenValuesFontRelSize;
        }


    TQColor hiLoChartOpenValuesColor() const
        {
            return _hiLoChartOpenValuesColor;
        }

    void setHiLoChartPrintCloseValues( bool active,
                                       TQFont* font = 0,
                                       int size = 14,
                                       TQColor* color = 0 );

    bool hiLoChartPrintCloseValues() const
        {
            return _hiLoChartPrintCloseValues;
        }


    TQFont hiLoChartCloseValuesFont() const
        {
            return _hiLoChartCloseValuesFont;
        }


    bool hiLoChartCloseValuesUseFontRelSize() const
        {
            return _hiLoChartCloseValuesUseFontRelSize;
        }


    int hiLoChartCloseValuesFontRelSize() const
        {
            return _hiLoChartCloseValuesFontRelSize;
        }


    TQColor hiLoChartCloseValuesColor() const
        {
            return _hiLoChartCloseValuesColor;
        }


    void setHiLoChartPrintFirstValues( bool active,
                                       TQFont* font = 0,
                                       uint size = 14,
                                       TQColor* color = 0 )
        {
            setHiLoChartPrintOpenValues( active, font, size, color );
        }

    bool hiLoChartPrintFirstValues() const
        {
            return hiLoChartPrintOpenValues();
        }


    TQFont hiLoChartFirstValuesFont() const
        {
            return hiLoChartOpenValuesFont();
        }


    bool hiLoChartFirstValuesUseFontRelSize() const
        {
            return hiLoChartOpenValuesUseFontRelSize();
        }

    int hiLoChartFirstValuesFontRelSize() const
        {
            return hiLoChartOpenValuesFontRelSize();
        }

    TQColor hiLoChartFirstValuesColor() const
        {
            return hiLoChartOpenValuesColor();
        }

    void setHiLoChartPrintLastValues( bool active,
                                      TQFont* font = 0,
                                      int size = 14,
                                      TQColor* color = 0 )
        {
            setHiLoChartPrintCloseValues( active, font, size, color );
        }

    bool hiLoChartPrintLastValues() const
        {
            return hiLoChartPrintCloseValues();
        }

    TQFont hiLoChartLastValuesFont() const
        {
            return hiLoChartCloseValuesFont();
        }

    bool hiLoChartLastValuesUseFontRelSize() const
        {
            return hiLoChartCloseValuesUseFontRelSize();
        }

    int hiLoChartLastValuesFontRelSize() const
        {
            return hiLoChartCloseValuesFontRelSize();
        }

    TQColor hiLoChartLastValuesColor() const
        {
            return hiLoChartCloseValuesColor();
        }


    // END HI/LO CHART-SPECIFIC


public:
    // BOX WHISKER CHART-SPECIFIC
    enum BWChartSubType { BWNormal, BWSimple = BWNormal };

    enum BWStatVal {                  BWStatValSTART,
                                      UpperOuterFence = BWStatValSTART,  // first value stored in array
                                      UpperInnerFence,
                                      Quartile3,
                                      Median,
                                      Quartile1,
                                      LowerInnerFence,
                                      LowerOuterFence,
                                      MaxValue,
                                      MeanValue,
                                      MinValue,
                                      BWStatValEND = MinValue,          // last value stored in array
                                      //  extra values - not stored in the array:
                                      BWStatValOffEndValue,  // the number of array values
                                      BWStatValALL,          // special flag reprsenting *all* array values
                                      BWStatValUNKNOWN };    // to be returned when value is undefined
public slots:

    void setBWChartSubType( BWChartSubType bWChartSubType )
        {
            _BWChartSubType = bWChartSubType;
            emit changed();
        }

    BWChartSubType bWChartSubType() const
        {
            return _BWChartSubType;
        }

    static TQString bWChartSubTypeToString( BWChartSubType type );
    static BWChartSubType stringToBWChartSubType( const TQString& string );
    static TQString bWChartStatValToString( BWStatVal type );
    static BWStatVal stringToBWChartStatVal( const TQString& string );

    void setBWChartFences( double upperInner, double lowerInner,
                           double upperOuter, double lowerOuter );
    void bWChartFences( double& upperInner, double& lowerInner,
                        double& upperOuter, double& lowerOuter ) const;

    void setBWChartBrush( const TQBrush& bWChartBrush )
        {
            _BWChartBrush = bWChartBrush;
            emit changed();
        }

    TQBrush bWChartBrush() const
        {
            return _BWChartBrush;
        }

    void setBWChartOutValMarkerSize( int size )
        {
            _BWChartOutValMarkerSize = size;
        }


    int bWChartOutValMarkerSize() const
        {
            return _BWChartOutValMarkerSize;
        }

    void setBWChartPrintStatistics( BWStatVal statValue,
                                    bool active,
                                    TQFont* font = 0,
                                    int size = 24,
                                    TQColor* color = 0,
                                    TQBrush* brush = 0 );

    bool bWChartPrintStatistics( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].active;
        }


    TQFont bWChartStatisticsFont( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].font;
        }


    bool bWChartStatisticsUseRelSize( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].useRelSize;
        }


    int bWChartStatisticsFontRelSize( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].relSize;
        }


    TQColor bWChartStatisticsColor( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].color;
        }

    TQBrush bWChartStatisticsBrush( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].brush;
        }


public:
    // LEGENDS

    enum LegendPosition { NoLegend, LegendTop, LegendBottom,
                          LegendLeft, LegendRight,
                          LegendTopLeft,
                          LegendTopLeftTop,
                          LegendTopLeftLeft,
                          LegendTopRight,
                          LegendTopRightTop,
                          LegendTopRightRight,
                          LegendBottomLeft,
                          LegendBottomLeftBottom,
                          LegendBottomLeftLeft,
                          LegendBottomRight,
                          LegendBottomRightBottom,
                          LegendBottomRightRight
    };

public slots:
    void setLegendPosition( LegendPosition position )
        {
            _legendPosition = position;
            emit changed();
        }

    LegendPosition legendPosition() const
        {
            return _legendPosition;
        }

    void setLegendOrientation( Qt::Orientation orientation )
        {
            _legendOrientation = orientation;
            emit changed();
        }

    Qt::Orientation legendOrientation() const
        {
            return _legendOrientation;
        }


    void setLegendShowLines( bool legendShowLines )
        {
            _legendShowLines = legendShowLines;
            emit changed();
        }

    bool legendShowLines() const
        {
            return _legendShowLines;
        }


    static TQString legendPositionToString( LegendPosition pos );
    static LegendPosition stringToLegendPosition( const TQString& string );

public:
    enum LegendSource { LegendManual, LegendFirstColumn, LegendAutomatic };

public slots:
    void setLegendSource( LegendSource source )
        {
            _legendSource = source;
            emit changed();
        }

    LegendSource legendSource() const
        {
            return _legendSource;
        }

    static TQString legendSourceToString( LegendSource source );
    static LegendSource stringToLegendSource( const TQString& string );

    void setLegendText( uint dataset, const TQString& text )
        {
            _legendText[ dataset ] = text;
            emit changed();
        }

    TQString legendText( uint dataset ) const
        {
            if( _legendText.find( dataset ) != _legendText.end() )
                return _legendText[ dataset ];
            else
                return TQString();
        }


    void setLegendTextColor( const TQColor& color )
        {
            _legendTextColor = color;
            emit changed();
        }


    TQColor legendTextColor() const
        {
            return _legendTextColor;
        }


    void setLegendFont( const TQFont& font, bool useFontSize )
        {
            _legendFont = font;
            _legendFontUseRelSize = ! useFontSize;
            emit changed();
        }

    TQFont legendFont() const
        {
            return _legendFont;
        }


    void setLegendFontUseRelSize( bool legendFontUseRelSize )
        {
            _legendFontUseRelSize = legendFontUseRelSize;
            emit changed();
        }

    bool legendFontUseRelSize() const
        {
            return _legendFontUseRelSize;
        }

    void setLegendFontRelSize( int legendFontRelSize )
        {
            _legendFontRelSize = legendFontRelSize;
            emit changed();
        }

    int legendFontRelSize() const
        {
            return _legendFontRelSize;
        }


    void setLegendTitleText( const TQString& text )
        {
            _legendTitleText = text;
            emit changed();
        }


    TQString legendTitleText() const
        {
            return _legendTitleText;
        }


    void setLegendTitleTextColor( const TQColor& color )
        {
            _legendTitleTextColor = color;
            emit changed();
        }


    TQColor legendTitleTextColor() const
        {
            return _legendTitleTextColor;
        }



    void setLegendTitleFont( const TQFont& font, bool useFontSize )
        {
            _legendTitleFont = font;
            _legendTitleFontUseRelSize = ! useFontSize;
            emit changed();
        }

    TQFont legendTitleFont() const
        {
            return _legendTitleFont;
        }


    void setLegendTitleFontUseRelSize( bool legendTitleFontUseRelSize )
        {
            _legendTitleFontUseRelSize = legendTitleFontUseRelSize;
            emit changed();
        }

    bool legendTitleFontUseRelSize() const
        {
            return _legendTitleFontUseRelSize;
        }

    void setLegendTitleFontRelSize( int legendTitleFontRelSize )
        {
            _legendTitleFontRelSize = legendTitleFontRelSize;
            emit changed();
        }

    int legendTitleFontRelSize() const
        {
            return _legendTitleFontRelSize;
        }


    void setLegendSpacing( uint space )
        {
            _legendSpacing = space;
        }


    uint legendSpacing() const
        {
            return _legendSpacing;
        }

    // END LEGENDS



    // AXES

    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setAxisType( uint n, const KDChartAxisParams::AxisType axisType )
        {
            if ( n < KDCHART_MAX_AXES ) {
                _axisSettings[ n ].params.setAxisType( axisType );
                emit changed();
            }
        }

    void setAxisVisible( uint n,
                         const bool axisVisible )
        {
            if ( n < KDCHART_MAX_AXES ) {
                _axisSettings[ n ].params.setAxisVisible( axisVisible );
                emit changed();
            }
        }

    bool axisVisible( uint n ) const
        {
            return n < KDCHART_MAX_AXES ? _axisSettings[ n ].params.axisVisible()
                : false;
        }

    void setAxisShowGrid( uint n,
                          bool axisShowGrid );
    bool showGrid() const;
    void setAxisDatasets( uint n,
                          uint dataset,
                          uint dataset2 = KDCHART_NO_DATASET,
                          uint chart = 0 );
    bool axisDatasets( uint n,
                       uint& dataset,
                       uint& dataset2,
                       uint& chart ) const;

public:
#if COMPAT_TQT_VERSION >= 0x030000
    typedef TQValueVector<uint> AxesArray;
#else
    typedef TQArray<uint> AxesArray;
#endif

public slots:
    bool chartAxes( uint chart, uint& cnt, AxesArray& axes ) const;

    void setAxisArea( const uint n, const TQRect& areaRect )
        {
            if ( n < KDCHART_MAX_AXES ) {
                _axisSettings[ n ].params.setAxisTrueAreaRect( areaRect );
                // Do not do emit changed() here!
            }
        }

    void setAxisLabelsTouchEdges( uint n, bool axisLabelsTouchEdges )
        {
            _axisSettings[ n ].params.setAxisLabelsTouchEdges(
                axisLabelsTouchEdges );
            emit changed();
        }

    void setAxisLabelsVisible( uint n,
                               bool axisLabelsVisible )
        {
            if ( n < KDCHART_MAX_AXES )
                _axisSettings[ n ].params.setAxisLabelsVisible( axisLabelsVisible );
        }

    void setAxisLabelsFont( uint n,
                            TQFont axisLabelsFont,
                            int axisLabelsFontSize = 0,
                            TQColor axisLabelsColor = TQt::black );

    // Note if you change the parameters here, then you must also change them in wrappers/KDChartParametersWrapper.h
    void setAxisLabelTextParams( uint n,
                                 bool axisSteadyValueCalc   = true,
                                 TQVariant axisValueStart = KDCHART_AXIS_LABELS_AUTO_LIMIT,
                                 TQVariant axisValueEnd   = KDCHART_AXIS_LABELS_AUTO_LIMIT,
                                 double axisValueDelta      = KDCHART_AXIS_LABELS_AUTO_DELTA,
                                 int axisDigitsBehindComma  = KDCHART_AXIS_LABELS_AUTO_DIGITS,
                                 int axisMaxEmptyInnerSpan  = 67,
                                 KDChartAxisParams::LabelsFromDataRow takeLabelsFromDataRow
                                 = KDChartAxisParams::LabelsFromDataRowNo,
                                 int labelTextsDataRow      = 0,
                                 TQStringList* axisLabelStringList = 0,
                                 TQStringList* axisShortLabelsStringList = 0,
                                 int axisValueLeaveOut      = KDCHART_AXIS_LABELS_AUTO_LEAVEOUT,
                                 KDChartAxisParams::ValueScale axisValueDeltaScale = KDChartAxisParams::ValueScaleNumerical )
        {
            _axisSettings[ n ].params.setAxisValues(
                axisSteadyValueCalc,
                axisValueStart,
                axisValueEnd,
                axisValueDelta,
                axisDigitsBehindComma,
                axisMaxEmptyInnerSpan,
                takeLabelsFromDataRow,
                labelTextsDataRow,
                axisLabelStringList,
                axisShortLabelsStringList,
                axisValueLeaveOut,
                axisValueDeltaScale );
            emit changed();
        }


    void setAxisLabelStringParams( uint n,
                                   TQStringList* axisLabelStringList,
                                   TQStringList* axisShortLabelStringList,
                                   const TQString& valueStart = TQString(),
                                   const TQString& valueEnd   = TQString() );


    void setAxisParams( uint n,
                        const KDChartAxisParams& axisParams );

    const KDChartAxisParams& axisParams( uint n ) const
        {
            return n < KDCHART_MAX_AXES ? _axisSettings[ n ].params
                : _axisSettings[ KDCHART_MAX_AXES ].params;
        }

    // some convenience functions refering to the first KDChartCustomBox
    // that is anchored to the axis n.
    bool findFirstAxisCustomBoxID(   uint n, uint& boxID ) const;
    void setAxisTitle(               uint n, const TQString& axisTitle );

    TQString axisTitle(               uint n ) const;
    void setAxisTitleColor(          uint n, TQColor axisTitleColor );
    TQColor axisTitleColor(           uint n ) const;
    void setAxisTitleFont(           uint n, TQFont axisTitleFont );
    void setAxisTitleFont(           uint n, TQFont axisTitleFont, bool useFixedFontSize );
    TQFont axisTitleFont(             uint n ) const;
    void setAxisTitleFontUseRelSize( uint n, bool useRelSize );
    bool axisTitleFontUseRelSize(    uint n ) const;
    void setAxisTitleFontRelSize(    uint n, int axisTitleFontRelSize );
    int axisTitleFontRelSize(        uint n ) const;

    TQRect axisArea( const uint n ) const
        {
            if ( n < KDCHART_MAX_AXES ) {
                return _axisSettings[ n ].params.axisTrueAreaRect();
                // Do not do emit changed() here!
            }else{
                return TQRect(TQPoint(0,0),TQSize(0,0));
            }
        }
    // END AXES



    TQRect dataArea()   const { return _dataAreaRect; }
    TQRect legendArea() const { return _legendAreaRect; }



    // HEADERS/FOOTERS

public:

    /*
      READ before changing/enhancing the following enum
      =================================================

      Please note: The following enum is made in a way that
      sections with smaller Y values come first.
      Thus one can construct a loop itterating over theHdFtPos values
      and so going from the top of the screen toiwards the bottom...

      Also please note that extending this enum shound NOT break the
      tripple groups (numbers 0/1/2, 3/4/5, and 6/7/8) since the
      algorithms in
      KDChartPainter::setupGeometry() and
      KDChartPainter::paintHeaderFooter() rely on this schema.
      Also don't forget to always update the auxiliary values
      HdFtPosSTART, HdFtPosHeadersSTART,
      HdFtPosHeadersEND, HdFtPosFootersSTART,
      HdFtPosFootersEND, and HdFtPosEND muessen - these are used
      fpr other itarators...
    */
    enum HdFtPos{ // start of all sections
        HdFtPosSTART = 0,

        // headers:
        HdFtPosHeadersSTART  = 0,
        // top-most headers
        HdFtPosHeaders0START = 0,
        HdFtPosHeader0       = 0,
        HdFtPosHeader0L = 1,
        HdFtPosHeader0R      = 2,
        HdFtPosHeaders0END   = 2,
        // normal ( == middle ) headers
        HdFtPosHeaders1START = 3,
        HdFtPosHeader        = 3,        // center
        HdFtPosHeaderL = 4,              // left
        HdFtPosHeaderR       = 5,        // right
        HdFtPosHeaders1END   = 5,
        // bottom headers
        HdFtPosHeaders2START = 6,
        HdFtPosHeader2       = 6,
        HdFtPosHeader2L = 7,
        HdFtPosHeader2R      = 8,
        HdFtPosHeaders2END   = 8,

        HdFtPosHeadersEND = 8,

        // footers:
        HdFtPosFootersSTART = 9,
        // normal ( == middle ) footers
        HdFtPosFooters1START =  9,
        HdFtPosFooter        =  9,
        HdFtPosFooterL = 10,
        HdFtPosFooterR       = 11,
        HdFtPosFooters1END   = 11,
        // bottom footers
        HdFtPosFooters2START = 12,
        HdFtPosFooter2       = 12,
        HdFtPosFooter2L = 13,
        HdFtPosFooter2R      = 14,
        HdFtPosFooters2END   = 14,
        // top-most footers
        HdFtPosFooters0START = 15,
        HdFtPosFooter0       = 15,
        HdFtPosFooter0L = 16,
        HdFtPosFooter0R      = 17,
        HdFtPosFooters0END   = 17,

        HdFtPosFootersEND = 17,

        HdFtPosEND = 17 };

public slots:

    void setHeaderFooterText( uint pos, const TQString& text );
    TQString headerFooterText( uint pos ) const;
    const TQRect& headerFooterRect( uint pos ) const;
    void setHeaderFooterColor( uint pos, const TQColor color );
    TQColor headerFooterColor( uint pos ) const;
    void setHeaderFooterFont( uint pos, const TQFont& font,
                              bool fontUseRelSize,
                              int fontRelSize );
    TQFont headerFooterFont( uint pos ) const;
    bool headerFooterFontUseRelSize( uint pos ) const;
    int headerFooterFontRelSize( uint pos ) const;


    // quick&dirty functions: access Header, Header2 and Footer
    //                        without having to specify the HdFtPos
    //
    // This may be convenient for specifying simple charts with
    // up to two centered header(s) and up to one centered footer.


    void setHeader1Text( const TQString& text )
        {
            _hdFtParams[ HdFtPosHeader ]._text = text;
            emit changed();
        }


    TQString header1Text() const
        {
            return _hdFtParams[ HdFtPosHeader ]._text;
        }

    void setHeader1Font( const TQFont& font )
        {
            _hdFtParams[ HdFtPosHeader ]._font = font;
            emit changed();
        }


    TQFont header1Font() const
        {
            return _hdFtParams[ HdFtPosHeader ]._font;
        }

    void setHeader2Text( const TQString& text )
        {
            _hdFtParams[ HdFtPosHeader2 ]._text = text;
            emit changed();
        }


    TQString header2Text() const
        {
            return _hdFtParams[ HdFtPosHeader2 ]._text;
        }

    void setHeader2Font( const TQFont& font )
        {
            _hdFtParams[ HdFtPosHeader2 ]._font = font;
            emit changed();
        }


    TQFont header2Font() const
        {
            return _hdFtParams[ HdFtPosHeader2 ]._font;
        }



    void setFooterText( const TQString& text )
        {
            _hdFtParams[ HdFtPosFooter ]._text = text;
            emit changed();
        }


    TQString footerText() const
        {
            return _hdFtParams[ HdFtPosFooter ]._text;
        }

    void setFooterFont( const TQFont& font )
        {
            _hdFtParams[ HdFtPosFooter ]._font = font;
            emit changed();
        }


    TQFont footerFont() const
        {
            return _hdFtParams[ HdFtPosFooter ]._font;
        }


    /**
       \internal
    */
    void __internalStoreHdFtRect( int pos, TQRect rect )
        {
            if ( 0 <= pos && HdFtPosEND >= pos )
                _hdFtParams[ pos ].setRect( rect );
        }


    // END HEADERS/FOOTERS



public:
    KDChartParams();
    virtual ~KDChartParams();

public slots:
    void loadAxesFormXML(int& curAxisSettings, TQDomElement& element);
    bool loadXML( const TQDomDocument& doc );

    void saveAxesToXML(TQDomDocument& doc, TQDomElement& docRoot) const;
    TQDomDocument saveXML( bool withPI = true ) const;

public:
    friend TQTextStream& operator<<( TQTextStream& s, const KDChartParams& p );
    friend TQTextStream& operator>>( TQTextStream& s, KDChartParams& p );

public slots:
    static void createChartValueNode( TQDomDocument& doc, TQDomNode& parent,
                                      const TQString& elementName,
                                      const TQVariant& valY,
                                      const TQVariant& valX,
                                      const int& propID  );
    static void createColorMapNode( TQDomDocument& doc, TQDomNode& parent,
                                    const TQString& elementName,
                                    const TQMap< uint, TQColor >& map );
    static void createDoubleMapNode( TQDomDocument& doc, TQDomNode& parent,
                                     const TQString& elementName,
                                     const TQMap< int, double >& map );
    static void createChartFontNode( TQDomDocument& doc, TQDomNode& parent,
                                     const TQString& elementName,
                                     const TQFont& font, bool useRelFont,
                                     int relFont,
                                     int minFont=-1 );
    static bool readColorMapNode( const TQDomElement& element,
                                  TQMap<uint,TQColor>* map );
    static bool readDoubleMapNode( const TQDomElement& element,
                                   TQMap<int,double>* map );
    static bool readChartFontNode( const TQDomElement& element, TQFont& font,
                                   bool& useRelFont, int& relFontSize,
                                   int* minFontSize=0 );
    static bool readChartValueNode( const TQDomElement& element,
                                    TQVariant& valY,
                                    TQVariant& valX,
                                    int& propID );


    // do *not* call this function manually: it is used by KDChartPainter::setupGeometry()
    void setDataArea( const TQRect& areaRect )
        {
            _dataAreaRect = areaRect;
            // Do not do emit changed() here!
        }
    // do *not* call this function manually: it is used by KDChartPainter::setupGeometry()
    void setLegendArea( const TQRect& areaRect )
        {
            _legendAreaRect = areaRect;
            // Do not do emit changed() here!
        }


signals:
    void changed();


protected:
    void setBarsDisplayed( int barsDisplayed )
        {
            _barsDisplayed = barsDisplayed;
        }
    void setBarsLeft( int barsLeft )
        {
            _barsLeft = barsLeft;
        }


private:
    TQString dataRegionFrameAreaName( uint dataRow,
                             uint dataCol,
                             uint data3rd );
    void recomputeShadowColors();
    void insertDefaultAxisTitleBox( uint n,
                                    bool setTitle,       const TQString& axisTitle,
                                    bool setColor,       const TQColor& axisTitleColor,
                                    bool setFont,        const TQFont& axisTitleFont,
                                    bool setFontUseRel,  bool useFontSize,
                                    bool setFontRelSize, int axisTitleFontRelSize );

    static TQColor _internalPointer_DataValueAutoColor;

    KDChartPropertySet* tempPropSetA;
    KDChartPropertySet* tempPropSetB;

    bool _optimizeOutputForScreen;
    int _globalLeadingLeft;
    int _globalLeadingTop;
    int _globalLeadingRight;
    int _globalLeadingBottom;
    ChartType _chartType;
    ChartType _additionalChartType;
    int _numValues;
    TQFont _defaultFont;

    typedef TQDict < KDChartFrameSettings > AreaDict;
    AreaDict _areaDict;

    CustomBoxDict _customBoxDict;
    bool _customBoxDictMayContainHoles;
    TQRect _noRect;
    KDFrame _noFrame;

    KDChartFrameSettings _noFrameSettings;

    class ModeAndChart
    {
    public:
        ModeAndChart()
            : _mode( UnknownMode ), _chart( KDCHART_NO_CHART )
            {}
        ModeAndChart( SourceMode mode, uint chart )
            : _mode( mode ), _chart( chart )
            {}

        SourceMode mode() const
            {
                return _mode;
            };
        uint chart() const
            {
                return _chart;
            };

        void setMode( SourceMode mode )
            {
                _mode = mode;
            };
        void setChart( uint chart )
            {
                _chart = chart;
            };
    private:
        SourceMode _mode;
        uint _chart;
    };

    typedef TQMap < uint, ModeAndChart > ModeAndChartMap;
    ModeAndChartMap _dataSourceModeAndChart;
    bool _setChartSourceModeWasUsed;
    TQMap < uint, TQColor > _dataColors;
    uint _maxDatasetSourceMode;
    KDChartPropertySetList _propertySetList;
    double _shadowBrightnessFactor;
    Qt::BrushStyle _shadowPattern;
    bool _threeDShadowColors;
    uint _maxDatasetColor;
    TQMap < uint, TQColor > _dataColorsShadow1;
    TQMap < uint, TQColor > _dataColorsShadow2;
    TQColor _outlineDataColor;
    uint _outlineDataLineWidth;
    Qt::PenStyle _outlineDataLineStyle;


    struct PrintDataValuesSettings {
        bool _printDataValues;
        int _divPow10;
        int _digitsBehindComma;
        TQFont _dataValuesFont;
        bool _dataValuesUseFontRelSize;
        int _dataValuesFontRelSize;
        TQColor _dataValuesColor;
        TQBrush _dataValuesBrush;
        bool _dataValuesAutoColor;
        KDChartEnums::PositionFlag _dataValuesAnchorNegativePosition;
        uint _dataValuesAnchorNegativeAlign;
        int _dataValuesAnchorNegativeDeltaX;
        int _dataValuesAnchorNegativeDeltaY;
        int _dataValuesNegativeRotation;
        KDChartEnums::PositionFlag _dataValuesAnchorPositivePosition;
        uint _dataValuesAnchorPositiveAlign;
        int _dataValuesAnchorPositiveDeltaX;
        int _dataValuesAnchorPositiveDeltaY;
        int _dataValuesPositiveRotation;
        KDChartEnums::TextLayoutPolicy _dataValuesLayoutPolicy;
        bool _dataValuesShowInfinite;

        bool _useDefaultFontParams;  // internal flag, do NOT store it!
    };
    PrintDataValuesSettings _printDataValuesSettings;
    PrintDataValuesSettings _printDataValuesSettings2;

    bool _allowOverlappingDataValueTexts;
    BarChartSubType _barChartSubType;
    bool _threeDBars;
    int _threeDBarAngle;
    double _threeDBarDepth;
    double _cosThreeDBarAngle;
    int _datasetGap;
    bool _datasetGapIsRelative;
    int _valueBlockGap;
    bool _valueBlockGapIsRelative;
    int _barWidth;
    int _userWidth;
    bool _solidExcessArrows;
    // volatile bar chart information, not saved in the stream
    TQRect _dataAreaRect;
    TQRect _legendAreaRect;
    int _barsDisplayed;
    int _barsLeft;

    // LINES/AREAS-specific
    LineChartSubType _lineChartSubType;
    bool _threeDLines;
    int _threeDLineDepth;
    int _threeDLineXRotation;
    int _threeDLineYRotation;
    bool _lineMarker;
    LineMarkerStyleMap _lineMarkerStyles;
    uint _maxDatasetLineMarkerStyle;
    TQSize _lineMarkerSize;
    TQColor _lineColor;
    int _lineWidth;
    Qt::PenStyle _lineStyle;
    typedef TQMap<uint, Qt::PenStyle> LineStyleMap;
    LineStyleMap _datasetLineStyles;
    AreaChartSubType _areaChartSubType;
    AreaLocation _areaLocation;


    // POLAR-specific
    PolarChartSubType _polarChartSubType;
    bool _polarMarker;
    PolarMarkerStyleMap _polarMarkerStyles;
    uint _maxDatasetPolarMarkerStyle;
    TQSize _polarMarkerSize;
    int _polarLineWidth;
    int _polarZeroDegreePos;
    bool _polarRotateCircularLabels;
    struct _polarDelimsAndLabelStruct {
        bool showDelimiters;
        bool showLabels;
    };
    _polarDelimsAndLabelStruct _polarDelimsAndLabels[ 1 + KDCHART_MAX_POLAR_DELIMS_AND_LABELS_POS ];



    // PIES/RINGS
    bool _explode;
    double _explodeFactor;
    ExplodeFactorsMap _explodeFactors;
    TQValueList<int> _explodeList;
    bool _threeDPies;
    int _threeDPieHeight;
    int _pieStart;
    int _ringStart;
    bool _relativeRingThickness;


    // HI-LO CHARTS

    HiLoChartSubType _hiLoChartSubType;
    bool _hiLoChartPrintLowValues;
    TQFont _hiLoChartLowValuesFont;
    bool _hiLoChartLowValuesUseFontRelSize;
    int _hiLoChartLowValuesFontRelSize;
    TQColor _hiLoChartLowValuesColor;
    bool _hiLoChartPrintHighValues;
    TQFont _hiLoChartHighValuesFont;
    bool _hiLoChartHighValuesUseFontRelSize;
    int _hiLoChartHighValuesFontRelSize;
    TQColor _hiLoChartHighValuesColor;
    bool _hiLoChartPrintOpenValues;
    TQFont _hiLoChartOpenValuesFont;
    bool _hiLoChartOpenValuesUseFontRelSize;
    int _hiLoChartOpenValuesFontRelSize;
    TQColor _hiLoChartOpenValuesColor;
    bool _hiLoChartPrintCloseValues;
    TQFont _hiLoChartCloseValuesFont;
    bool _hiLoChartCloseValuesUseFontRelSize;
    int _hiLoChartCloseValuesFontRelSize;
    TQColor _hiLoChartCloseValuesColor;



    // BOX AND WHISKER CHARTS

    BWChartSubType _BWChartSubType;

    struct BWChartStatistics {
        double value;
        int    y;
        bool   active;
        TQFont  font;
        bool   useRelSize;
        int    relSize;
        TQColor color;
        TQBrush brush;
    };
    BWChartStatistics _BWChartStatistics[ BWStatValOffEndValue ];
    double _BWChartFenceUpperInner;
    double _BWChartFenceLowerInner;
    double _BWChartFenceUpperOuter;
    double _BWChartFenceLowerOuter;
    int _BWChartOutValMarkerSize;
    TQBrush _BWChartBrush;


    // LEGENDS

    LegendPosition _legendPosition;
    Qt::Orientation _legendOrientation;
    bool _legendShowLines;
    LegendSource _legendSource;
    TQMap < int, TQString > _legendText;
    TQColor _legendTextColor;
    TQFont _legendFont;
    bool _legendFontUseRelSize;
    int _legendFontRelSize;
    TQString _legendTitleText;
    TQColor _legendTitleTextColor;
    TQFont _legendTitleFont;
    bool _legendTitleFontUseRelSize;
    int _legendTitleFontRelSize;
    uint _legendSpacing;


    // AXES (private)
    // Must be exported because of the inline methods
    struct KDCHART_EXPORT AxisSettings
    {
        uint dataset;
        uint dataset2;
        uint chart;
        KDChartAxisParams params;
        AxisSettings()
            {
                dataset = KDCHART_NO_DATASET;
                dataset2 = KDCHART_NO_DATASET;
                chart = KDCHART_NO_CHART;
            }
    };

    // 13 == KDCHART_MAX_AXES + 1
    AxisSettings _axisSettings[ 13 ];
    // END AXES (private)


    // HEADER/FOOTER (private)
    // Must be exported because of the inline methods
    struct KDCHART_EXPORT HdFtParams
    {
        TQString _text;
        TQColor _color;
        TQFont _font;
        bool _fontUseRelSize;
        int _fontRelSize;
        HdFtParams()
            {
                _color = TQColor( TQt::black );
                _font = TQFont( "helvetica", 10, TQFont::Normal, false );
                _fontUseRelSize = true;
                _fontRelSize = 8; // per default quite small
            }
        void setRect( TQRect rect )
            {
                _rect = rect;
            }
        const TQRect& rect() const
            {
                return _rect;
            }
    private:
        // temporary data that are NOT to be stored within sessions:
        TQRect _rect;
    };

    HdFtParams _hdFtParams[ HdFtPosEND + 1 ];
    // END HEADER/FOOTER (private)
};


TQTextStream& operator<<( TQTextStream& s, const KDChartParams& p );


TQTextStream& operator>>( TQTextStream& s, KDChartParams& p );


#endif