Go to the documentation of this file.
32#include <KDXMLTools.h>
35#include <tqvaluestack.h>
47 if( !source || this == source )
49 mOwnID = source->mOwnID;
50 mName = source->mName;
51 mIdShowBar = source->mIdShowBar; mShowBar = source->mShowBar;
52 mIdBarColor = source->mIdBarColor; mBarColor = source->mBarColor;
53 mIdAreaBrush = source->mIdAreaBrush; mAreaBrush = source->mAreaBrush;
54 mIdLineWidth = source->mIdLineWidth; mLineWidth = source->mLineWidth;
55 mIdLineColor = source->mIdLineColor; mLineColor = source->mLineColor;
56 mIdLineStyle = source->mIdLineStyle; mLineStyle = source->mLineStyle;
57 mIdShowMarker = source->mIdShowMarker; mShowMarker = source->mShowMarker;
58 mIdMarkerSize = source->mIdMarkerSize; mMarkerSize = source->mMarkerSize;
59 mIdMarkerColor = source->mIdMarkerColor; mMarkerColor = source->mMarkerColor;
60 mIdMarkerStyle = source->mIdMarkerStyle; mMarkerStyle = source->mMarkerStyle;
61 mIdMarkerAlign = source->mIdMarkerAlign; mMarkerAlign = source->mMarkerAlign;
62 mIdExtraLinesAlign = source->mIdExtraLinesAlign; mExtraLinesAlign = source->mExtraLinesAlign;
63 mIdExtraLinesInFront = source->mIdExtraLinesInFront; mExtraLinesInFront = source->mExtraLinesInFront;
64 mIdExtraLinesLength = source->mIdExtraLinesLength; mExtraLinesLength = source->mExtraLinesLength;
65 mIdExtraLinesWidth = source->mIdExtraLinesWidth; mExtraLinesWidth = source->mExtraLinesWidth;
66 mIdExtraLinesColor = source->mIdExtraLinesColor; mExtraLinesColor = source->mExtraLinesColor;
67 mIdExtraLinesStyle = source->mIdExtraLinesStyle; mExtraLinesStyle = source->mExtraLinesStyle;
68 mIdExtraMarkersAlign = source->mIdExtraMarkersAlign; mExtraMarkersAlign = source->mExtraMarkersAlign;
69 mIdExtraMarkersSize = source->mIdExtraMarkersSize; mExtraMarkersSize = source->mExtraMarkersSize;
70 mIdExtraMarkersColor = source->mIdExtraMarkersColor; mExtraMarkersColor = source->mExtraMarkersColor;
71 mIdExtraMarkersStyle = source->mIdExtraMarkersStyle; mExtraMarkersStyle = source->mExtraMarkersStyle;
87 mIdLineWidth = idParent;
88 mIdLineColor = idParent;
89 mIdLineStyle = idParent;
90 mIdShowMarker = idParent;
91 mIdMarkerSize = idParent;
92 mIdMarkerColor = idParent;
93 mIdMarkerStyle = idParent;
94 mIdMarkerAlign = idParent;
95 mIdExtraLinesAlign = idParent;
96 mIdExtraLinesInFront = idParent;
97 mIdExtraLinesLength = idParent;
98 mIdExtraLinesWidth = idParent;
99 mIdExtraLinesColor = idParent;
100 mIdExtraLinesStyle = idParent;
101 mIdExtraMarkersAlign = idParent;
102 mIdExtraMarkersSize = idParent;
103 mIdExtraMarkersColor = idParent;
104 mIdExtraMarkersStyle = idParent;
105 mIdShowBar = idParent;
106 mIdBarColor = idParent;
107 mIdAreaBrush = idParent;
113 fillValueMembersWithDummyValues();
116void KDChartPropertySet::fillValueMembersWithDummyValues()
120 mLineColor = TQt::black;
121 mLineStyle = TQt::SolidLine;
123 mMarkerAlign = TQt::AlignCenter;
124 mMarkerSize = TQSize(6,6);
125 mMarkerColor = TQt::black;
127 mExtraLinesAlign = TQt::AlignLeft|TQt::AlignTop;
128 mExtraLinesInFront = false;
129 mExtraLinesLength = -20;
130 mExtraLinesWidth = 1;
131 mExtraLinesColor = TQt::black;
132 mExtraLinesStyle = TQt::SolidLine;
133 mExtraMarkersAlign = TQt::AlignLeft|TQt::AlignTop;
134 mExtraMarkersSize = TQSize(6,6);
135 mExtraMarkersColor = TQt::black;
136 mExtraMarkersStyle = 0;
138 mBarColor = TQt::black;
139 mAreaBrush = TQBrush( TQt::blue );
145 TQDomElement propertySetElement = doc.createElement( "PropertySet" );
146 propertySetElement.setAttribute( "OwnID", mOwnID );
147 KDXML::createStringNode( doc, propertySetElement, "Name", mName );
149 KDXML::createIntNode( doc, propertySetElement, "IDShowBar", mIdShowBar );
150 KDXML::createBoolNode( doc, propertySetElement, "ShowBar", mShowBar );
151 KDXML::createIntNode( doc, propertySetElement, "IDBarColor", mIdBarColor );
152 KDXML::createColorNode( doc, propertySetElement, "BarColor", mBarColor );
154 KDXML::createIntNode( doc, propertySetElement, "IDAreaBrush", mIdAreaBrush );
155 KDXML::createBrushNode( doc, propertySetElement, "AreaBrush", mAreaBrush );
157 KDXML::createIntNode( doc, propertySetElement, "IDLineWidth", mIdLineWidth );
158 KDXML::createIntNode( doc, propertySetElement, "LineWidth", mLineWidth );
159 KDXML::createIntNode( doc, propertySetElement, "IDLineColor", mIdLineColor );
160 KDXML::createColorNode( doc, propertySetElement, "LineColor", mLineColor );
161 KDXML::createIntNode( doc, propertySetElement, "IDLineStyle", mIdLineStyle );
162 TQDomElement lineStyleElement = doc.createElement( "LineStyle" );
163 propertySetElement.appendChild( lineStyleElement );
164 lineStyleElement.setAttribute( "Style", KDXML::penStyleToString( mLineStyle));
166 KDXML::createIntNode( doc, propertySetElement, "IDShowMarker", mIdShowMarker);
167 KDXML::createBoolNode( doc, propertySetElement, "ShowMarker", mShowMarker);
168 KDXML::createIntNode( doc, propertySetElement, "IDMarkerAlign", mIdMarkerAlign );
169 KDXML::createIntNode( doc, propertySetElement, "MarkerAlign", mMarkerAlign );
170 KDXML::createIntNode( doc, propertySetElement, "IDMarkerSize", mIdMarkerSize );
171 KDXML::createSizeNode( doc, propertySetElement, "MarkerSize", mMarkerSize );
172 KDXML::createIntNode( doc, propertySetElement, "IDMarkerColor", mIdMarkerColor );
173 KDXML::createColorNode( doc, propertySetElement, "MarkerColor", mMarkerColor );
174 KDXML::createIntNode( doc, propertySetElement, "IDMarkerStyle", mIdMarkerStyle );
175 TQDomElement markerStElem = doc.createElement( "MarkerStyle" );
176 propertySetElement.appendChild( markerStElem );
177 markerStElem.setAttribute( "Style",
180 KDXML::createIntNode( doc, propertySetElement, "IDExtraLinesAlign", mIdExtraLinesAlign );
181 KDXML::createIntNode( doc, propertySetElement, "ExtraLinesAlign", mExtraLinesAlign );
182 KDXML::createIntNode( doc, propertySetElement, "IDExtraLinesInFront",mIdExtraLinesInFront );
183 KDXML::createBoolNode( doc, propertySetElement, "ExtraLinesInFront", mExtraLinesInFront );
184 KDXML::createIntNode( doc, propertySetElement, "IDExtraLinesLength", mIdExtraLinesLength );
185 KDXML::createIntNode( doc, propertySetElement, "ExtraLinesLength", mExtraLinesLength );
186 KDXML::createIntNode( doc, propertySetElement, "IDExtraLinesWidth", mIdExtraLinesWidth );
187 KDXML::createIntNode( doc, propertySetElement, "ExtraLinesWidth", mExtraLinesWidth );
188 KDXML::createIntNode( doc, propertySetElement, "IDExtraLinesColor", mIdExtraLinesColor );
189 KDXML::createColorNode( doc, propertySetElement, "ExtraLinesColor", mExtraLinesColor );
190 KDXML::createIntNode( doc, propertySetElement, "IDExtraLinesStyle", mIdExtraLinesStyle );
191 TQDomElement specLineStElem = doc.createElement( "ExtraLinesStyle" );
192 propertySetElement.appendChild( specLineStElem );
193 specLineStElem.setAttribute( "Style", KDXML::penStyleToString( mExtraLinesStyle));
195 KDXML::createIntNode( doc, propertySetElement, "IDExtraMarkersAlign", mIdExtraMarkersAlign );
196 KDXML::createIntNode( doc, propertySetElement, "ExtraMarkersAlign", mExtraMarkersAlign );
197 KDXML::createIntNode( doc, propertySetElement, "IDExtraMarkersSize", mIdExtraMarkersSize );
198 KDXML::createSizeNode( doc, propertySetElement, "ExtraMarkersSize", mExtraMarkersSize );
199 KDXML::createIntNode( doc, propertySetElement, "IDExtraMarkersColor", mIdExtraMarkersColor );
200 KDXML::createColorNode( doc, propertySetElement, "ExtraMarkersColor", mExtraMarkersColor );
201 KDXML::createIntNode( doc, propertySetElement, "IDExtraMarkersStyle", mIdExtraMarkersStyle );
202 TQDomElement specMarkerStElem = doc.createElement( "ExtraMarkersStyle" );
203 propertySetElement.appendChild( specMarkerStElem );
204 specMarkerStElem.setAttribute( "Style",
206 return propertySetElement;
211 bool bOwnIDFound = false;
219 set.fillValueMembersWithDummyValues();
221 if( element.hasAttribute( "OwnID") ){
222 i = element.attribute( "OwnID" ).toInt( &bOwnIDFound );
225 TQDomNode node = element.firstChild();
226 while( !node.isNull() ) {
227 TQDomElement element = node.toElement();
228 if( !element.isNull() ) {
229 TQString tagName = element.tagName();
230 if( tagName == "Name" ) {
231 if( KDXML::readStringNode( element, s ) )
235 if( tagName == "IDShowBar" ) {
236 if( KDXML::readIntNode( element, i ) )
238 } else if( tagName == "ShowBar" ) {
239 if( KDXML::readBoolNode( element, bValue ) )
240 set.mShowBar = bValue;
241 } else if( tagName == "IDBarColor" ) {
242 if( KDXML::readIntNode( element, i ) )
244 } else if( tagName == "BarColor" ) {
245 if( KDXML::readColorNode( element, color ) )
246 set.mBarColor = color;
249 if( tagName == "IDAreaBrush" ) {
250 if( KDXML::readIntNode( element, i ) )
251 set.mIdAreaBrush = i;
252 } else if( tagName == "AreaBrush" ) {
253 if( KDXML::readBrushNode( element, brush ) )
254 set.mAreaBrush = TQBrush(color);
257 if( tagName == "IDLineWidth" ) {
258 if( KDXML::readIntNode( element, i ) )
259 set.mIdLineWidth = i;
260 } else if( tagName == "LineWidth" ) {
261 if( KDXML::readIntNode( element, i ) )
263 } else if( tagName == "IDLineColor" ) {
264 if( KDXML::readIntNode( element, i ) )
265 set.mIdLineColor = i;
266 } else if( tagName == "LineColor" ) {
267 if( KDXML::readColorNode( element, color ) )
268 set.mLineColor = color;
269 } else if( tagName == "IDLineStyle" ) {
270 if( KDXML::readIntNode( element, i ) )
271 set.mIdLineStyle = i;
272 } else if( tagName == "LineStyle" ) {
273 if( element.hasAttribute( "Style" ) )
274 set.mLineStyle = KDXML::stringToPenStyle( element.attribute( "Style" ) );
277 if( tagName == "IDShowMarker" ) {
278 if( KDXML::readIntNode( element, i ) )
279 set.mIdShowMarker = i;
280 } else if( tagName == "ShowMarker" ) {
281 if( KDXML::readBoolNode( element, bValue ) )
282 set.mShowMarker = bValue;
283 } else if( tagName == "IDMarkerAlign" ) {
284 if( KDXML::readIntNode( element, i ) )
285 set.mIdMarkerAlign = i;
286 } else if( tagName == "MarkerAlign" ) {
287 if( KDXML::readIntNode( element, i ) )
288 set.mMarkerAlign = i;
289 } else if( tagName == "IDMarkerSize" ) {
290 if( KDXML::readIntNode( element, i ) )
291 set.mIdMarkerSize = i;
292 } else if( tagName == "MarkerSize" ) {
293 if( KDXML::readSizeNode( element, size ) )
294 set.mMarkerSize = size;
295 } else if( tagName == "IDMarkerColor" ) {
296 if( KDXML::readIntNode( element, i ) )
297 set.mIdMarkerColor = i;
298 } else if( tagName == "MarkerColor" ) {
299 if( KDXML::readColorNode( element, color ) )
300 set.mMarkerColor = color;
301 } else if( tagName == "IDMarkerStyle" ) {
302 if( KDXML::readIntNode( element, i ) )
303 set.mIdMarkerStyle = i;
304 } else if( tagName == "MarkerStyle" ) {
305 if( element.hasAttribute( "Style" ) )
310 if( tagName == "IDExtraLinesAlign" ) {
311 if( KDXML::readIntNode( element, i ) )
312 set.mIdExtraLinesAlign = i;
313 } else if( tagName == "ExtraLinesAlign" ) {
314 if( KDXML::readIntNode( element, i ) )
315 set.mExtraLinesAlign = i;
316 } else if( tagName == "IDExtraLinesInFront" ) {
317 if( KDXML::readIntNode( element, i ) )
318 set.mIdExtraLinesInFront = i;
319 } else if( tagName == "ExtraLinesInFront" ) {
320 if( KDXML::readBoolNode( element, bValue ) )
321 set.mExtraLinesInFront = bValue;
322 } else if( tagName == "IDExtraLinesLength" ) {
323 if( KDXML::readIntNode( element, i ) )
324 set.mIdExtraLinesLength = i;
325 } else if( tagName == "ExtraLinesLength" ) {
326 if( KDXML::readIntNode( element, i ) )
327 set.mExtraLinesLength = i;
328 } else if( tagName == "IDExtraLinesWidth" ) {
329 if( KDXML::readIntNode( element, i ) )
330 set.mIdExtraLinesWidth = i;
331 } else if( tagName == "ExtraLinesWidth" ) {
332 if( KDXML::readIntNode( element, i ) )
333 set.mExtraLinesWidth = i;
334 } else if( tagName == "IDExtraLinesColor" ) {
335 if( KDXML::readIntNode( element, i ) )
336 set.mIdExtraLinesColor = i;
337 } else if( tagName == "ExtraLinesColor" ) {
338 if( KDXML::readColorNode( element, color ) )
339 set.mExtraLinesColor = color;
340 } else if( tagName == "IDExtraLinesStyle" ) {
341 if( KDXML::readIntNode( element, i ) )
342 set.mIdExtraLinesStyle = i;
343 } else if( tagName == "ExtraLinesStyle" ) {
344 if( element.hasAttribute( "Style" ) )
345 set.mExtraLinesStyle = KDXML::stringToPenStyle( element.attribute( "Style" ) );
348 if( tagName == "IDExtraMarkersAlign" ) {
349 if( KDXML::readIntNode( element, i ) )
350 set.mIdExtraMarkersAlign = i;
351 } else if( tagName == "ExtraMarkersAlign" ) {
352 if( KDXML::readIntNode( element, i ) )
353 set.mExtraMarkersAlign = i;
354 } else if( tagName == "IDExtraMarkersSize" ) {
355 if( KDXML::readIntNode( element, i ) )
356 set.mIdExtraMarkersSize = i;
357 } else if( tagName == "ExtraMarkersSize" ) {
358 if( KDXML::readSizeNode( element, size ) )
359 set.mExtraMarkersSize = size;
360 } else if( tagName == "IDExtraMarkersColor" ) {
361 if( KDXML::readIntNode( element, i ) )
362 set.mIdExtraMarkersColor = i;
363 } else if( tagName == "ExtraMarkersColor" ) {
364 if( KDXML::readColorNode( element, color ) )
365 set.mExtraMarkersColor = color;
366 } else if( tagName == "IDExtraMarkersStyle" ) {
367 if( KDXML::readIntNode( element, i ) )
368 set.mIdExtraMarkersStyle = i;
369 } else if( tagName == "ExtraMarkersStyle" ) {
370 if( element.hasAttribute( "Style" ) )
371 set.mExtraMarkersStyle
374 tqDebug( "Unknown subelement of KDChartPropertySet found: %s", tagName.latin1() );
377 node = node.nextSibling();
384#include "KDChartPropertySet.moc"
Header for all common chart parameters.
Property settings of a single KDChart data cell.
static TQString lineMarkerStyleToString(LineMarkerStyle style) Converts the specified line marker style enum to a string representation.
LineMarkerStyle The available line marker styles.
static LineMarkerStyle stringToLineMarkerStyle(const TQString &string) Converts the specified string to a line marker style value.
Property settings of a single KDChart data cell.
KDChartPropertySet() default constructor setting all values to undefined and name to empty string
static bool loadXML(const TQDomElement &element, KDChartPropertySet &set) Retrieves a property set and stores it in parameter set.
const KDChartPropertySet * clone() const Create a new property set on the heap, copy the settings stored by this property set into the newly c...
void quickReset(const TQString &name, int idParent=KDChartPropertySet::UndefinedID) Set the name, set all of the ID settings to idParent, but do NOT change the value settings,...
TQDomElement saveXML(TQDomDocument &doc) const Save this property set's settings in a stream, this stores the own property set ID as well.
void fullReset(const TQString &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 def...
TQString name() const Returns the name of this property set.
void deepCopy(const KDChartPropertySet *source) Copy the settings stored by property set source into this property set.
|