attribute.h
author insilmaril
Tue, 04 Dec 2007 12:32:59 +0000
changeset 628 d7d0708b1c60
parent 626 96c8e6860e0c
child 636 f83abc1f75b4
permissions -rw-r--r--
Fixed HideExport bug, changed pre- and postscript in XHTML export dialog
     1 #ifndef ATTRIBUTE_H
     2 #define ATTRIBUTE_H
     3 
     4 #include <QStringList>
     5 
     6 #include "xmlobj.h"
     7 
     8 class AttributeTable;
     9 
    10 /*! \brief A key and a value
    11 */
    12 
    13 class Attribute:public XMLObj {
    14 public:
    15 	Attribute();
    16 	void setKey (const QString &k);
    17 	QString getKey ();
    18 	void setValue (const QString &v);
    19 	QString getValue();
    20 	void setTable (AttributeTable *at);
    21 	AttributeTable* getTable();
    22 	QString getDataXML();
    23 protected:
    24 	QString key;
    25 	QString value;
    26 	AttributeTable *table;
    27 };
    28 
    29 /*! \brief A table containing a list of keys and each of these keys has
    30    a list of default values. The keys and the values for each key are
    31    unique.
    32 */
    33 class AttributeTable:public XMLObj{
    34 public:
    35 	AttributeTable();
    36 	~AttributeTable();
    37 	void clear();
    38 	void addKey (const QString &k);		//!< Adds a key to the table
    39 	void removeKey (const QString &k);	//!< Removes key and its default values
    40 	int countKeys();					//!< Return number of keys
    41 	void addValue (const QString &k, const QString &v);	//!< Adds key and value
    42 	QStringList getKeys ();
    43 	QStringList getValues(const QString &k);
    44 	QString getDataXML();
    45 
    46 protected:
    47 	QStringList keys;
    48 	QList <QStringList> values;
    49 };
    50 
    51 
    52 
    53 #endif
    54