attribute.h
author anng888
Thu Dec 06 18:30:29 2007 +0000 (2007-12-06)
changeset 632 f4282e4db9f7
parent 616 16d63fc9ae42
child 636 f83abc1f75b4
permissions -rw-r--r--
- Fixed Win32 start up crash as a result of "showing" the main window to
early when its previous state was maximized.
     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