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
|
/* -*- 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 __KDCHARTPROPERTYSET__
#define __KDCHARTPROPERTYSET__
#include <KDChartEnums.h>
#include <kdchart_export.h>
#include <qdom.h>
#include <qcolor.h>
#include <qbrush.h>
/**
\file KDChartPropertySet.h
\brief Property settings of a single KDChart data cell.
*/
/**
\class KDChartPropertySet KDChartPropertySet.h
\brief Property settings of a single KDChart data cell.
\note The property settings feature currently is supported by
normal (== not 3-dimensional!) Line Charts only. Future releases
of KDChart will offer a rich set of options to use cell-specific
properties for other chart types as well...
The KDChartPropertySet class stores several settings to be
used by the painter classes to decide how to visualize the
respective data cell.
Each of the settings may be specified either by giving a
value for it or by using the ID of another KDChartPropertySet
instance: If the later the value of that instance is used
instead of the value that is stored locally.
\sa KDChartData::setPropertySet
\sa KDCHART_PROPSET_NORMAL_DATA, KDCHART_PROPSET_TRANSPARENT_DATA
\sa KDChartParams::registerProperties
*/
class KDCHART_EXPORT KDChartPropertySet :public QObject
{
Q_OBJECT
Q_ENUMS( SpecialDataPropertyID )
// Required by QSA
Q_ENUMS( PenStyle )
friend class KDChartParams;
public:
/**
Special property IDs.
\li \c UndefinedID (the default value)
used to indicate that <b>no</b> ID was set for
members \c mIdLineWidth, \c mIdLineColor,
\c mIdLineStyle, \c mIdShowMarker and the like...
\li \c OwnID used for referencing a property set's *own* ID.
\sa KDChartPropertySet
*/
enum SpecialDataPropertyID {
UndefinedID = -2,
OwnID = -1
};
/**
default constructor setting all values to undefined
and name to empty string
*/
KDChartPropertySet() :
mOwnID( UndefinedID )
{ fullReset(""); }
/**
Constructor setting all Property Set IDs to the same ID value.
This constructor may be used to initialize a property set
and let it have all property IDs set to a specific value,
e.g. you might pass KDCHART_PROPSET_NORMAL_DATA
as ID to make the default property set the parent of all
values.
\param name (may be empty) a name describing this property set.
\param idParent the ID of the parent property set. Skip this paramter
to define a property set without specifying a parent.
*/
KDChartPropertySet( const QString& name, int idParent=KDChartPropertySet::UndefinedID ) :
mOwnID( UndefinedID )
{ fullReset( name, idParent ); }
/**
Copy the settings stored by property set \c source into this property set.
\note Use this method instead of using the assignment operator.
\sa clone, quickReset, fullReset
*/
void deepCopy( const KDChartPropertySet* source );
/**
Create a new property set on the heap, copy the settings stored by
this property set into the newly created property set and return
the pointer to the new property set.
\note Use this method instead of using the copy constructor.
\sa deepCopy, quickReset, fullReset
*/
const KDChartPropertySet* clone() const;
/**
Set the name,
set all of the ID settings to idParent,
but do NOT change the value settings,
and do NOT modify mOwnID.
\note Use this to quickly reset the ID settings: in most cases this should
be sufficient for resetting the property set.
\sa clone, fullReset
*/
void quickReset( const QString& name, int idParent=KDChartPropertySet::UndefinedID );
/**
Set the name,
set all of the ID settings to idParent,
set all of the value settings back to their default value,
but do NOT modify mOwnID.
\note Use this to entirely reset both the ID values and the value settings: one of
the very few reasons why you might want to do that might be your saving this property set
into a data stream. In most other cases just calling quickReset should be sufficient.
\sa clone, quickReset
*/
void fullReset( const QString& name, int idParent=KDChartPropertySet::UndefinedID );
/**
Save this property set's settings in a stream,
this stores the own property set ID as well.
\sa loadXML
*/
QDomElement saveXML(QDomDocument& doc) const;
/**
Retrieves a property set and stores it in parameter set.
\note Since the property set's internal <b>ID</b> is also read
make sure to call KDChartParams::setProperties( set.id(), set )
after calling \c load() if you want to use the loaded
property set in the context of KDChartParam settings.
\returns TRUE if the property set could be read.
\sa id, saveXLM
*/
static bool loadXML( const QDomElement& element, KDChartPropertySet& set );
public slots:
/**
Returns the name of this property set.
*/
int id() const { return mOwnID; }
/**
Change the descriptive name of this property set.
*/
void setName( const QString& name )
{
mName = name;
}
/**
Returns the name of this property set.
*/
QString name() const { return mName; }
/**
Specify the ID of the property set specifying a boolean flag indicating
whether this cell's bar is to be painted
<b>or</b> specifying this flag directly.
\note This function should be used for Bar Charts only, otherwise
the settings specified here will be ignored.
\param idShowBar ID of the property set specifying the flag
indicating whether this cell's bar is to be painted.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for this flag.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the flag by using
the following parameter.
\param showBar Flag indicating whether this cell's bar is to be painted.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa hasOwnShowBar
\sa setBarColor
\sa hasOwnBarColor
*/
void setShowBar( int idShowBar, bool showBar )
{
mIdShowBar = idShowBar;
mShowBar = showBar;
}
/**
Returns whether this property set is specifying it's own flag indicating
whether this cell's bar is to be painted.
\note This function should be used for Bar Charts only, otherwise
the settings specified here will be ignored.
\returns TRUE if this property set is specifying it's own showBar flag,
FALSE if the settings of another property set are to be used instead.
\note The return value will also be FALSE if the 'default' properties
are to be used: in this case idShowBar will be KDChartParams::NormalData
\param idShowBar to be ignored if return value is TRUE.
If idShowBar is KDChartPropertySet::UndefinedID
then neither a property set ID
nor an own flag were specified (so no special
enabeling/disabeling of bars is associated to the
respective data cell), else idShowBar contains the
ID of another property set that is specifying the flag
to be used.
\param showBar this parameter's value is not modified if return value is FALSE.
Parameter showBar contains the showBar flag
associated with the respective data cell.
If return value is FALSE the showBar
flag is not set (so the parameter keeps its previous value)
but this is to be overridden by the respective value
of another property set that is indicated
by the idShowBar parameter - unless this has the special
value KDChartPropertySet::UndefinedID as decribed above.
\sa setShowBar
\sa setBarColor
\sa hasOwnBarColor
*/
bool hasOwnShowBar( int& idShowBar, bool& showBar )
{
idShowBar = mIdShowBar;
if( OwnID == idShowBar ){
showBar = mShowBar;
return true;
}
return false;
}
/**
Specify the ID of the property set specifying the bar color
to be used for this cell
<b>or</b> specify the bar color directly.
\note This function should be used for Bar Charts only, otherwise
the settings specified here will be ignored.
\param idBarColor ID of the property set specifying the bar color.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for the bar color.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the bar color by using
the following parameter.
\param barColor The bar color to be used.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa hasOwnBarColor
*/
void setBarColor( int idBarColor, const QColor& barColor )
{
mIdBarColor = idBarColor;
mBarColor = barColor;
}
/**
Returns whether this property set is specifying it's own bar color settings.
\note This function should be used for Bar Charts only, otherwise
the settings specified here will be ignored.
\returns TRUE if this property set is specifying it's own bar color settings,
FALSE if the settings of another property set are to be used instead.
\note The return value will also be FALSE if the 'default' properties
are to be used: in this case idBarColor will be KDChartParams::NormalData
\param idBarColor to be ignored if return value is TRUE.
If idBarColor is KDChartPropertySet::UndefinedID
then neither a property set ID
nor an own bar color were specified (so no special
Bar color is associated to the respective data cell),
else idBarColor contains the ID of another property set
that is specifying the Bar color to be used.
\param barColor this parameter's value is not modified if return value is FALSE.
Parameter barColor contains the bar color value
associated with the respective data cell.
If return value is FALSE the barColor
value is not set (so the parameter keeps its previous value)
but this is to be overridden by the respective value
of another property set that is indicated
by the idBarColor parameter - unless this has the special
value KDChartPropertySet::UndefinedID as decribed above.
\sa setBarColor
*/
bool hasOwnBarColor( int& idBarColor, QColor& barColor )
{
idBarColor = mIdBarColor;
if( OwnID == mIdBarColor ){
barColor = mBarColor;
return true;
}
return false;
}
/**
Specify the ID of the property set specifying the line width
to be used for drawing a line from this data point to the next one
<b>or</b> specify the line width directly.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\param idLineWidth ID of the property set specifying the line width.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for the line width.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the line width by using
the following parameter.
\param lineWidth The line width to be used.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa setLineWidth, setLineColor, setLineStyle, setShowMarker
\sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
*/
void setLineWidth( int idLineWidth, int lineWidth )
{
mIdLineWidth = idLineWidth;
mLineWidth = lineWidth;
}
/**
Returns whether this property set is specifying it's own line width settings.
\note This function should be used for Line Charts only.
\returns TRUE if this property set is specifying it's own line width settings,
FALSE if the settings of another property set are to be used instead.
\param idLineWidth to be ignored if return value is TRUE.
If idLineWidth is KDChartPropertySet::UndefinedID
then neither a property set ID
nor an own line width were specified (so no special
line width is associated to the respective data cell),
else idLineWidth contains the ID of another property set
that is specifying the line width to be used.
\param lineWidth this parameter's value is not modified if return value is FALSE.
Parameter lineWidth contains the line width value
associated with the respective data cell.
If return value is FALSE the lineWidth
value is not set (so the parameter keeps its previous value)
but this is to be overridden by the respective value
of another property set that is indicated
by the idLineWidth parameter - unless this has the special
value KDChartPropertySet::UndefinedID as decribed above.
\sa setLineWidth, setLineColor, setLineStyle, setShowMarker
\sa hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
*/
bool hasOwnLineWidth( int& idLineWidth, int& lineWidth )
{
idLineWidth = mIdLineWidth;
if( OwnID == mIdLineWidth ){
lineWidth = mLineWidth;
return true;
}
return false;
}
/**
Specify the ID of the property set specifying the line color
to be used for drawing a line from this data point to the next one
<b>or</b> specify the line color directly.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\param idLineColor ID of the property set specifying the line color.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for the line color.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the line color by using
the following parameter.
\param lineColor The line color to be used.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa setLineWidth, setLineStyle, setShowMarker
\sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
*/
void setLineColor( int idLineColor, const QColor& lineColor )
{
mIdLineColor = idLineColor;
mLineColor = lineColor;
}
/**
Returns whether this property set is specifying it's own line color settings.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\returns TRUE if this property set is specifying it's own line color settings,
FALSE if the settings of another property set are to be used instead.
\note The return value will also be FALSE if the 'default' properties
are to be used: in this case idLineColor will be KDChartParams::NormalData
\param idLineColor to be ignored if return value is TRUE.
If idLineColor is KDChartPropertySet::UndefinedID
then neither a property set ID
nor an own line color were specified (so no special
line color is associated to the respective data cell),
else idLineColor contains the ID of another property set
that is specifying the line color to be used.
\param lineColor this parameter's value is not modified if return value is FALSE.
Parameter lineColor contains the line color value
associated with the respective data cell.
If return value is FALSE the lineColor
value is not set (so the parameter keeps its previous value)
but this is to be overridden by the respective value
of another property set that is indicated
by the idLineColor parameter - unless this has the special
value KDChartPropertySet::UndefinedID as decribed above.
\sa setLineWidth, setLineColor, setLineStyle, setShowMarker
\sa hasOwnLineWidth, hasOwnLineStyle, hasOwnShowMarker
*/
bool hasOwnLineColor( int& idLineColor, QColor& lineColor )
{
idLineColor = mIdLineColor;
if( OwnID == mIdLineColor ){
lineColor = mLineColor;
return true;
}
return false;
}
/**
Specify the ID of the property set specifying the line style
to be used for drawing a line from this data point to the next one
<b>or</b> specify the line width directly.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\param idLineStyle ID of the property set specifying the line style.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for the line style.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the line style by using
the following parameter.
\param lineStyle The line style to be used.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa setLineWidth, setLineColor, setShowMarker
\sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle, hasOwnShowMarker
*/
void setLineStyle( int idLineStyle, const PenStyle& lineStyle )
{
mIdLineStyle = idLineStyle;
mLineStyle = lineStyle;
}
/**
Returns whether this property set is specifying it's own line style settings.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\returns TRUE if this property set is specifying it's own line style settings,
FALSE if the settings of another property set are to be used instead.
\note The return value will also be FALSE if the 'default' properties
are to be used: in this case idLineStyle will be KDChartParams::NormalData
\param idLineStyle to be ignored if return value is TRUE.
If idLineStyle is KDChartPropertySet::UndefinedID
then neither a property set ID
nor an own line style were specified (so no special
line style is associated to the respective data cell),
else idLineStyle contains the ID of another property set
that is specifying the line style to be used.
\param lineStyle this parameter's value is not modified if return value is FALSE.
Parameter lineStyle contains the line style value
associated with the respective data cell.
If return value is FALSE the lineStyle
value is not set (so the parameter keeps its previous value)
but this is to be overridden by the respective value
of another property set that is indicated
by the idLineStyle parameter - unless this has the special
value KDChartPropertySet::UndefinedID as decribed above.
\sa setLineWidth, setLineColor, setLineStyle, setShowMarker
\sa hasOwnLineWidth, hasOwnLineColor, hasOwnShowMarker
*/
bool hasOwnLineStyle( int& idLineStyle, PenStyle& lineStyle )
{
idLineStyle = mIdLineStyle;
if( OwnID == mIdLineStyle ){
lineStyle = mLineStyle;
return true;
}
return false;
}
/**
Specify the ID of the property set specifying the area brush
to be used for this cell
<b>or</b> specify the area brush directly.
\note This function should be used for Area Charts in <b>Normal</b> mode
only, otherwise the settings specified here will be ignored.
\param idAreaBrush ID of the property set specifying the area brush.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for the area brush.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the area brush by using
the following parameter.
\param areaBrush The area brush to be used.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa hasOwnAreaBrush
*/
void setAreaBrush( int idAreaBrush, const QBrush& areaBrush )
{
mIdAreaBrush = idAreaBrush;
mAreaBrush = areaBrush;
}
/**
Returns whether this property set is specifying it's own area brush settings.
\note This function should be used for Area Charts in <b>Normal</b> mode
only, otherwise the settings specified here will be ignored.
\returns TRUE if this property set is specifying it's own area brush settings,
FALSE if the settings of another property set are to be used instead.
\note The return value will also be FALSE if the 'default' properties
are to be used: in this case idAreaBrush will be KDChartParams::NormalData
\param idAreaBrush to be ignored if return value is TRUE.
If idAreaBrush is KDChartPropertySet::UndefinedID
then neither a property set ID
nor an own area brush were specified (so no special
area brush is associated to the respective data cell),
else idAreaBrush contains the ID of another property set
that is specifying the area brush to be used.
\param areaBrush this parameter's value is not modified if return value is FALSE.
Parameter areaBrush contains the area brush value
associated with the respective data cell.
If return value is FALSE the areaBrush
value is not set (so the parameter keeps its previous value)
but this is to be overridden by the respective value
of another property set that is indicated
by the idAreaBrush parameter - unless this has the special
value KDChartPropertySet::UndefinedID as decribed above.
\sa setAreaBrush
*/
bool hasOwnAreaBrush( int& idAreaBrush, QBrush& areaBrush )
{
idAreaBrush = mIdAreaBrush;
if( OwnID == mIdAreaBrush ){
areaBrush = mAreaBrush;
return true;
}
return false;
}
/**
Specify the ID of the property set specifying a boolean flag indicating
whether a Marker is to be displayed for this data value
<b>or</b> specifying this flag directly.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\param idShowMarker ID of the property set specifying the flag
indicating whether a marker is to be shown.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for this flag.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the flag by using
the following parameter.
\param showMarker Flag indicating whether a marker is to be shown.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa hasOwnShowMarker
\sa setMarkerAlign, setMarkerSize, setMarkerColor, setMarkerStyle
\sa setLineWidth, setLineColor, setLineStyle
*/
void setShowMarker( int idShowMarker, bool showMarker )
{
mIdShowMarker = idShowMarker;
mShowMarker = showMarker;
}
/**
Returns whether this property set is specifying it's own flag indicating
whether a Marker is to be displayed.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\returns TRUE if this property set is specifying it's own showMarker flag,
FALSE if the settings of another property set are to be used instead.
\note The return value will also be FALSE if the 'default' properties
are to be used: in this case idShowMarker will be KDChartParams::NormalData
\param idShowMarker to be ignored if return value is TRUE.
If idShowMarker is KDChartPropertySet::UndefinedID
then neither a property set ID
nor an own flag were specified (so no special
enabeling/disabeling of markers is associated to the
respective data cell), else idShowMarker contains the
ID of another property set that is specifying the flag
to be used.
\param showMarker this parameter's value is not modified if return value is FALSE.
Parameter showMarker contains the showMarker flag
associated with the respective data cell.
If return value is FALSE the showMarker
flag is not set (so the parameter keeps its previous value)
but this is to be overridden by the respective value
of another property set that is indicated
by the idShowMarker parameter - unless this has the special
value KDChartPropertySet::UndefinedID as decribed above.
\sa setShowMarker
\sa hasOwnMarkerAlign, hasOwnMarkerSize, hasOwnMarkerColor, hasOwnMarkerStyle
\sa hasOwnLineWidth, hasOwnLineColor, hasOwnLineStyle
*/
bool hasOwnShowMarker( int& idShowMarker, bool& showMarker )
{
idShowMarker = mIdShowMarker;
if( OwnID == idShowMarker ){
showMarker = mShowMarker;
return true;
}
return false;
}
/**
Specify the ID of the property set specifying the alignment of the
Marker to be displayed for this data value
<b>or</b> specifying this flag directly.
\note This function should be used for Line Charts only, otherwise
the settings specified here will be ignored.
\param idMarkerAlign ID of the property set specifying the alignment
of the Marker to be shown.
Use special value KDChartPropertySet::UndefinedID
to specify neither another property set's ID
nor an own value for this flag.
Use special value KDChartPropertySet::OwnID
if you do NOT want to inherit another property set's
settings but want to specify the flag by using
the following parameter.
\param markerAlign The alignment of the marker to be shown.
This parameter is stored but ignored if the previous parameter
is not set to KDChartPropertySet::OwnID.
\sa hasOwnShowMarker
\sa setMarkerAlign, setMarkerSize, setMarkerColor, setMarkerStyle
\sa setLineWidth, setLineColor, setLineStyle
*/
void setMarkerAlign( int idMarkerAlign, uint markerAlign )
{
mIdMarkerAlign = idMarkerAlign;
mMarkerAlign = markerAlign;
}
bool hasOwnMarkerAlign( int& idMarkerAlign, uint& markerAlign )
{
idMarkerAlign = mIdMarkerAlign;
if( OwnID == idMarkerAlign ){
markerAlign = mMarkerAlign;
return true;
}
return false;
}
void setMarkerSize( int idMarkerSize, const QSize& markerSize )
{
mIdMarkerSize = idMarkerSize;
mMarkerSize = markerSize;
}
bool hasOwnMarkerSize( int& idMarkerSize, QSize& markerSize )
{
idMarkerSize = mIdMarkerSize;
if( OwnID == idMarkerSize ){
markerSize = mMarkerSize;
return true;
}
return false;
}
void setMarkerColor( int idMarkerColor, const QColor& markerColor )
{
mIdMarkerColor = idMarkerColor;
mMarkerColor = markerColor;
}
bool hasOwnMarkerColor( int& idMarkerColor, QColor& markerColor )
{
idMarkerColor = mIdMarkerColor;
if( OwnID == idMarkerColor ){
markerColor = mMarkerColor;
return true;
}
return false;
}
void setMarkerStyle( int idMarkerStyle, int markerStyle )
{
mIdMarkerStyle = idMarkerStyle;
mMarkerStyle = markerStyle;
}
bool hasOwnMarkerStyle( int& idMarkerStyle, int& markerStyle )
{
idMarkerStyle = mIdMarkerStyle;
if( OwnID == idMarkerStyle ){
markerStyle = mMarkerStyle;
return true;
}
return false;
}
void setExtraLinesAlign( int idExtraLinesAlign, uint extraLinesAlign )
{
mIdExtraLinesAlign = idExtraLinesAlign;
mExtraLinesAlign = extraLinesAlign;
}
bool hasOwnExtraLinesAlign( int& idExtraLinesAlign, uint& extraLinesAlign )
{
idExtraLinesAlign = mIdExtraLinesAlign;
if( OwnID == idExtraLinesAlign ){
extraLinesAlign = mExtraLinesAlign;
return true;
}
return false;
}
void setExtraLinesInFront( int idExtraLinesInFront, bool extraLinesInFront )
{
mIdExtraLinesInFront = idExtraLinesInFront;
mExtraLinesInFront = extraLinesInFront;
}
bool hasOwnExtraLinesInFront( int& idExtraLinesInFront, bool& extraLinesInFront )
{
idExtraLinesInFront = mIdExtraLinesInFront;
if( OwnID == idExtraLinesInFront ){
extraLinesInFront = mExtraLinesInFront;
return true;
}
return false;
}
void setExtraLinesLength( int idExtraLinesLength, int extraLinesLength )
{
mIdExtraLinesLength = idExtraLinesLength;
mExtraLinesLength = extraLinesLength;
}
bool hasOwnExtraLinesLength( int& idExtraLinesLength, int& extraLinesLength )
{
idExtraLinesLength = mIdExtraLinesLength;
if( OwnID == idExtraLinesLength ){
extraLinesLength = mExtraLinesLength;
return true;
}
return false;
}
void setExtraLinesWidth( int idExtraLinesWidth, int extraLinesWidth )
{
mIdExtraLinesWidth = idExtraLinesWidth;
mExtraLinesWidth = extraLinesWidth;
}
bool hasOwnExtraLinesWidth( int& idExtraLinesWidth, int& extraLinesWidth )
{
idExtraLinesWidth = mIdExtraLinesWidth;
if( OwnID == idExtraLinesWidth ){
extraLinesWidth = mExtraLinesWidth;
return true;
}
return false;
}
void setExtraLinesColor( int idExtraLinesColor, const QColor& extraLinesColor )
{
mIdExtraLinesColor = idExtraLinesColor;
mExtraLinesColor = extraLinesColor;
}
bool hasOwnExtraLinesColor( int& idExtraLinesColor, QColor& extraLinesColor )
{
idExtraLinesColor = mIdExtraLinesColor;
if( OwnID == idExtraLinesColor ){
extraLinesColor = mExtraLinesColor;
return true;
}
return false;
}
void setExtraLinesStyle( int idExtraLinesStyle, const PenStyle extraLinesStyle )
{
mIdExtraLinesStyle = idExtraLinesStyle;
mExtraLinesStyle = extraLinesStyle;
}
bool hasOwnExtraLinesStyle( int& idExtraLinesStyle, PenStyle& extraLinesStyle )
{
idExtraLinesStyle = mIdExtraLinesStyle;
if( OwnID == idExtraLinesStyle ){
extraLinesStyle = mExtraLinesStyle;
return true;
}
return false;
}
void setExtraMarkersAlign( int idExtraMarkersAlign, uint extraMarkersAlign )
{
mIdExtraMarkersAlign = idExtraMarkersAlign;
mExtraMarkersAlign = extraMarkersAlign;
}
bool hasOwnExtraMarkersAlign( int& idExtraMarkersAlign, uint& extraMarkersAlign )
{
idExtraMarkersAlign = mIdExtraMarkersAlign;
if( OwnID == idExtraMarkersAlign ){
extraMarkersAlign = mExtraMarkersAlign;
return true;
}
return false;
}
void setExtraMarkersSize( int idExtraMarkersSize, const QSize& extraMarkersSize )
{
mIdExtraMarkersSize = idExtraMarkersSize;
mExtraMarkersSize = extraMarkersSize;
}
bool hasOwnExtraMarkersSize( int& idExtraMarkersSize, QSize& extraMarkersSize )
{
idExtraMarkersSize = mIdExtraMarkersSize;
if( OwnID == idExtraMarkersSize ){
extraMarkersSize = mExtraMarkersSize;
return true;
}
return false;
}
void setExtraMarkersColor( int idExtraMarkersColor, const QColor& extraMarkersColor )
{
mIdExtraMarkersColor = idExtraMarkersColor;
mExtraMarkersColor = extraMarkersColor;
}
bool hasOwnExtraMarkersColor( int& idExtraMarkersColor, QColor& extraMarkersColor )
{
idExtraMarkersColor = mIdExtraMarkersColor;
if( OwnID == idExtraMarkersColor ){
extraMarkersColor = mExtraMarkersColor;
return true;
}
return false;
}
void setExtraMarkersStyle( int idExtraMarkersStyle, int extraMarkersStyle )
{
mIdExtraMarkersStyle = idExtraMarkersStyle;
mExtraMarkersStyle = extraMarkersStyle;
}
bool hasOwnExtraMarkersStyle( int& idExtraMarkersStyle, int& extraMarkersStyle )
{
idExtraMarkersStyle = mIdExtraMarkersStyle;
if( OwnID == idExtraMarkersStyle ){
extraMarkersStyle = mExtraMarkersStyle;
return true;
}
return false;
}
protected:
// the following member only to be set internally by KDChartParams::registerProperties
// and by KDChartParams::setProperties
int mOwnID;
private:
KDChartPropertySet( const KDChartPropertySet& ) : QObject(0) {}
QString mName;
// IDs: values used if ID == OwnID:
int mIdLineWidth; int mLineWidth;
int mIdLineColor; QColor mLineColor;
int mIdLineStyle; Qt::PenStyle mLineStyle;
int mIdShowMarker; bool mShowMarker;
int mIdMarkerSize; QSize mMarkerSize;
int mIdMarkerColor; QColor mMarkerColor;
int mIdMarkerStyle; int mMarkerStyle;
int mIdMarkerAlign; uint mMarkerAlign;
int mIdExtraLinesAlign; uint mExtraLinesAlign;
int mIdExtraLinesInFront; bool mExtraLinesInFront;
int mIdExtraLinesLength; int mExtraLinesLength;
int mIdExtraLinesWidth; int mExtraLinesWidth;
int mIdExtraLinesColor; QColor mExtraLinesColor;
int mIdExtraLinesStyle; Qt::PenStyle mExtraLinesStyle;
int mIdExtraMarkersAlign; uint mExtraMarkersAlign;
int mIdExtraMarkersSize; QSize mExtraMarkersSize;
int mIdExtraMarkersColor; QColor mExtraMarkersColor;
int mIdExtraMarkersStyle; int mExtraMarkersStyle;
int mIdShowBar; bool mShowBar;
int mIdBarColor; QColor mBarColor;
int mIdAreaBrush; QBrush mAreaBrush;
void fillValueMembersWithDummyValues();
};
#endif
|