9 class AttributeTable; //FIXME-3 remove from CVS
10 class AttributeDef; //FIXME-3 remove from CVS
13 Undefined, //!< Undefined type
14 IntList, //!< Free integer
15 FreeInt, //!< Free integer
16 StringList, //!< List of strings, one can be attribute value
17 FreeString, //!< Any string can be attribute value, not unique
18 UniqueString//!< UniqueString, e.g. for IDs
21 /*! \brief A key and a value
22 The data itself is stored in Attribute Definitions (AttributeDef).
23 A list of these tables AttributeTable is maintained for every MapEditor.
25 class Attribute:public XMLObj {
28 void setKey (const QString &k, const AttributeType &t);
30 void setValue (const QString &v);
32 void setType (const AttributeType &t);
33 AttributeType getType ();
34 QString getTypeString ();
35 void setTable (AttributeTable *at);
36 AttributeTable* getTable();
39 AttributeTable *table;
40 AttributeDef *definition;
41 QString freeString; //!< String value for type FreeString
46 Attribute definition, defines possible values and type of attribute.
52 void setType (const AttributeType &t);
53 AttributeType getType();
54 QString getTypeString ();
55 void setKey (const QString &k);
57 void setValue (const QString &v);
58 void setValue (const QVariant &v);
64 QVariant value; //!< value (except FreeString, FreeInt ...
67 /*! \brief A table containing a list of keys and each of these keys has
68 a list of default values. The keys and the values for each key are
72 class AttributeTable:public XMLObj{
77 AttributeDef* addKey (const QString &k, const AttributeType &t); //!< Adds a key to the table
78 void removeKey (const QString &k); //!< Removes key and its default values
79 AttributeDef* getDef(const QString &k); //!< Get defintion of attribute
80 int countKeys(); //!< Return number of keys
81 QStringList getKeys ();
82 QStringList getTypes();
86 QList <AttributeDef*> attdefs;