attribute.h
author insilmaril
Thu, 08 Nov 2007 15:28:03 +0000
changeset 620 24bfecc949a0
parent 616 16d63fc9ae42
child 626 96c8e6860e0c
permissions -rw-r--r--
1.11.2 split up of xml helper functions. started to work on attributes
     1 #ifndef ATTRIBUTE_H
     2 #define ATTRIBUTE_H
     3 
     4 #include <QStringList>
     5 
     6 #include "xmlobj.h"
     7 
     8 
     9 /*! \brief A key and a list of values
    10 */
    11 
    12 class Attribute:public XMLObj {
    13 public:
    14 	Attribute();
    15 	virtual void setKey (const QString &k);
    16 	virtual QString getKey ();
    17 	virtual void setValue (const QString &v);
    18 	virtual QString getValue();
    19 	virtual QString getDataXML();
    20 protected:
    21 	QString key;
    22 	QString value;
    23 };
    24 
    25 /*! \brief A table containing a list of keys and each of these keys has
    26    a list of default values. The keys and the values for each key are
    27    unique.
    28 */
    29 class AttributeTable:public XMLObj{
    30 public:
    31 	AttributeTable();
    32 	virtual ~AttributeTable();
    33 	virtual void clear();
    34 	virtual void addKey (const QString &k);		//!< Adds a key to the table
    35 	virtual void removeKey (const QString &k);	//!< Removes key and its default values
    36 	virtual void addValue (const QString &k, const QString &v);	//!< Adds key and value
    37 	virtual QStringList getKeys ();
    38 	virtual QStringList getValues(const QString &k);
    39 	virtual QString getDataXML();
    40 
    41 protected:
    42 	QStringList keys;
    43 	QList <QStringList> values;
    44 };
    45 
    46 
    47 
    48 #endif
    49