13 Undefined, //!< Undefined type
14 StringList, //!< List of strings, one can be attribute value
15 FreeString, //!< Any string can be attribute value, not unique
16 UniqueString//!< UniqueString, e.g. for IDs
19 /*! \brief A key and a value
20 The data itself is stored in Attribute Definitions (AttributeDef). A list of these tables
21 AttributeTable is maintained for every MapEditor.
23 class Attribute:public XMLObj {
26 void setKey (const QString &k, const AttributeType &t);
28 void setValue (const QString &v);
30 void setType (const AttributeType &t);
31 AttributeType getType ();
32 QString getTypeString ();
33 void setTable (AttributeTable *at);
34 AttributeTable* getTable();
37 AttributeTable *table;
38 AttributeDef *definition;
39 QString freeString; //!< String value for type FreeString
44 Attribute definition, defines possible values and type of attribute.
50 void setType (const AttributeType &t);
51 AttributeType getType();
52 QString getTypeString ();
53 void setKey (const QString &k);
55 void setValue (const QString &v);
56 void setValue (const QVariant &v);
62 QVariant value; //!< value (except FreeString, FreeInt ...
65 /*! \brief A table containing a list of keys and each of these keys has
66 a list of default values. The keys and the values for each key are
70 class AttributeTable:public XMLObj{
75 AttributeDef* addKey (const QString &k, const AttributeType &t); //!< Adds a key to the table
76 void removeKey (const QString &k); //!< Removes key and its default values
77 AttributeDef* getDef(const QString &k); //!< Get defintion of attribute
78 int countKeys(); //!< Return number of keys
79 QStringList getKeys ();
83 QList <AttributeDef*> attdefs;