comparison layer/Layer.h @ 316:c0b9eec70639

* Make XmlExportable::toXml the function that is universally overridden (and pure virtual) instead of toXmlString. Tidies up some classes, notably the model classes, significantly. Closes #1794561.
author Chris Cannam
date Thu, 18 Oct 2007 10:15:07 +0000
parents 5c59c433b358
children 984c1975f1ff
comparison
equal deleted inserted replaced
315:c30a7cd29f4a 316:c0b9eec70639
278 278
279 virtual void setObjectName(const QString &name); 279 virtual void setObjectName(const QString &name);
280 280
281 /** 281 /**
282 * Convert the layer's data (though not those of the model it 282 * Convert the layer's data (though not those of the model it
283 * refers to) into an XML string for file output. This class 283 * refers to) into XML for file output. This class implements the
284 * implements the basic name/type/model-id output; subclasses will 284 * basic name/type/model-id output; subclasses will typically call
285 * typically call this superclass implementation with extra 285 * this superclass implementation with extra attributes describing
286 * attributes describing their particular properties. 286 * their particular properties.
287 */ 287 */
288 virtual QString toXmlString(QString indent = "", 288 virtual void toXml(QTextStream &stream, QString indent = "",
289 QString extraAttributes = "") const; 289 QString extraAttributes = "") const;
290 290
291 /** 291 /**
292 * Set the particular properties of a layer (those specific to the 292 * Set the particular properties of a layer (those specific to the
293 * subclass) from a set of XML attributes. This is the effective 293 * subclass) from a set of XML attributes. This is the effective
294 * inverse of the toXmlString method. 294 * inverse of the toXml method.
295 */ 295 */
296 virtual void setProperties(const QXmlAttributes &) = 0; 296 virtual void setProperties(const QXmlAttributes &) = 0;
297 297
298 /** 298 /**
299 * Produce an XML string containing the layer's ID and type. This 299 * Produce XML containing the layer's ID and type. This is used
300 * is used to refer to the layer in the display section of the SV 300 * to refer to the layer in the display section of the SV session
301 * session file, for a layer that has already been described in 301 * file, for a layer that has already been described in the data
302 * the data section. 302 * section.
303 */ 303 */
304 virtual QString toBriefXmlString(QString indent = "", 304 virtual void toBriefXml(QTextStream &stream,
305 QString extraAttributes = "") const; 305 QString indent = "",
306 QString extraAttributes = "") const;
306 307
307 /** 308 /**
308 * Add a measurement rectangle from the given XML attributes 309 * Add a measurement rectangle from the given XML attributes
309 * (presumably taken from a measurement element). 310 * (presumably taken from a measurement element).
310 * Does not use a command. 311 * Does not use a command.
465 long endFrame; // ditto 466 long endFrame; // ditto
466 double startY; 467 double startY;
467 double endY; 468 double endY;
468 469
469 bool operator<(const MeasureRect &mr) const; 470 bool operator<(const MeasureRect &mr) const;
470 QString toXmlString(QString indent) const; 471 void toXml(QTextStream &stream, QString indent) const;
471 }; 472 };
472 473
473 class AddMeasurementRectCommand : public Command 474 class AddMeasurementRectCommand : public Command
474 { 475 {
475 public: 476 public: