attributeitem.h
changeset 823 0bba81dde1bc
parent 822 c2ce9944148c
     1.1 --- a/attributeitem.h	Wed Feb 10 13:48:42 2010 +0000
     1.2 +++ b/attributeitem.h	Fri Feb 19 13:47:03 2010 +0000
     1.3 @@ -11,7 +11,7 @@
     1.4  	A list of these tables AttributeTable is maintained for every MapEditor.
     1.5  */
     1.6  class AttributeItem:public BranchItem {
     1.7 -
     1.8 +public:
     1.9  enum Type {
    1.10  	Undefined,	//!< Undefined type
    1.11  	IntList,	//!< Free integer
    1.12 @@ -21,9 +21,10 @@
    1.13  	UniqueString//!< UniqueString, e.g. for IDs
    1.14  };
    1.15  
    1.16 -public:
    1.17  	AttributeItem(const QList<QVariant> &data, TreeItem *parent = 0);
    1.18  	virtual ~AttributeItem();
    1.19 +	void set (const QString &k, const QString &v, const Type &t);
    1.20 +	void get (QString &k, QString &v, Type &t);
    1.21  	void setKey (const QString &k, const Type &t);
    1.22  	QString getKey ();
    1.23  	void setValue (const QString &v);
    1.24 @@ -31,10 +32,14 @@
    1.25  	void setType (const Type &t);
    1.26  	AttributeItem::Type getAttributeType ();
    1.27  	QString getTypeString ();
    1.28 +	void setInternal (bool b);
    1.29 +	bool isInternal();
    1.30  	QString getDataXML();
    1.31  protected:
    1.32 -	QString freeString;		//!< String value for type FreeString
    1.33  	bool internal;			//!< Internal attributes cannot be edited by user
    1.34 +	QString key;
    1.35 +	QVariant value;
    1.36 +	Type attrType;
    1.37  };
    1.38  
    1.39  #endif