27 PropertyList::PropertyList()
28 :TQObject(0, 0), m_propertyOwner(true)
32 PropertyList::PropertyList(
bool propertyOwner)
33 :TQObject(0, 0), m_propertyOwner(propertyOwner)
37 PropertyList::~PropertyList()
44 if (m_list.contains(name))
52 if (m_list.contains(name))
63 if ( m_list.contains(property->
name()) )
65 mp = m_list[
property->name()];
71 m_list[
property->name()] = mp;
82 if (m_list.contains(property->
name()))
84 mp = m_list[
property->name()];
90 m_list[
property->name()] = mp;
104 TQString group = m_groupOfProperty[mp];
106 TQString pname =
property->name();
110 if (mp->list.count() == 0)
113 m_list.remove(pname);
122 if (m_list.contains(name))
124 TQString group = m_groupOfProperty[m_list[name]];
127 for (property = m_list[name]->list.first();
property;
property = m_list[name]->list.next())
132 m_list[
property->name()]->removeProperty(property);
136 if (m_list[name]->list.count() == 0)
151 return m_propertiesOfGroup;
156 return m_groupOfProperty;
165 if (m_groupOfProperty.contains(property) && (m_groupOfProperty[
property] == group))
168 TQPair<TQString, TQValueList<TQString> > *groupPair = 0;
169 for(TQValueList<TQPair<TQString, TQValueList<TQString> > >::iterator it = m_propertiesOfGroup.begin();
170 it != m_propertiesOfGroup.end(); ++it)
172 if ((*it).first == group)
180 groupPair =
new TQPair<TQString, TQValueList<TQString> >();
181 groupPair->first = group;
182 groupPair->second.append(property->
name());
183 m_propertiesOfGroup.append(*groupPair);
184 m_groupOfProperty[
property] = group;
188 if (!groupPair->second.contains(property->
name()))
189 groupPair->second.append(property->
name());
191 m_groupOfProperty[
property] = group;
196 TQString group = m_groupOfProperty[
property];
199 for(TQValueList<TQPair<TQString, TQValueList<TQString> > >::iterator it = m_propertiesOfGroup.begin();
200 it != m_propertiesOfGroup.end(); ++it)
203 if ((*it).first == group)
206 (*it).second.remove(property->
name());
211 m_groupOfProperty.remove(property);
216 for (TQMap<TQString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it)
222 if (m_list.contains(name))
229 if (m_list.contains(name))
230 return m_list[name]->list;
231 return TQPtrList<Property>();
234 PropertyList::Iterator PropertyList::begin()
236 return Iterator(
this);
239 PropertyList::Iterator PropertyList::end()
241 return Iterator(
this,
true);
249 current = m_list->m_list.begin();
252 PropertyList::Iterator::Iterator(
PropertyList *list,
bool 256 current = m_list->m_list.end();
259 void PropertyList::Iterator::operator ++()
264 void PropertyList::Iterator::operator ++(
int)
269 void PropertyList::Iterator::next()
279 TQString PropertyList::Iterator::key()
281 return current.key();
286 return current.data();
289 bool PropertyList::Iterator::operator !=(Iterator it)
291 return current != it.current;
308 tqWarning(
"PropertyBuffer::intersect");
309 for (TQMap<TQString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it)
312 if (list->m_list.contains(it.key()))
319 if ( ((*it.data()) == *(list->m_list[it.key()]))
320 && (list->m_groupOfProperty[list->m_list[it.key()]] == m_groupOfProperty[it.data()]) )
323 it.data()->addProperty(list->m_list[it.key()]);
336 TQString propertyName =
property->name();
341 if (mp == *m_list[propertyName])
344 TQPtrList<Property> props =
properties(propertyName);
345 for (prop = props.first(); prop; prop = props.next())
354 for (TQMap<TQString, MultiProperty*>::const_iterator it = list->m_list.begin();
355 it != list->m_list.end(); ++it)
358 mp->m_propertyList =
this;
359 addToGroup(list->m_groupOfProperty[it.data()], mp);
360 m_list[it.key()] = mp;
368 #include "propertylist.moc" virtual void addProperty(Property *property)
Adds the property to the list to the "common" group.
virtual const TQValueList< TQPair< TQString, TQValueList< TQString > > > & propertiesOfGroup() const
Namespace which contain property editing classes.
virtual void removeProperty(Property *property)
Removes property from the list.
virtual const TQMap< MultiProperty *, TQString > & groupOfProperty() const
Contains PropertyLib::MultiProperty class.
Contains PropertyLib::Property class and PropertyLib::Property::PropertyType enum.
Contains PropertyLib::PropertyList class.
TQString name() const
Returns the name of a property.
TQPtrList< Property > properties(const TQString &name)
The list of properties with given name.
void removeProperty(Property *prop)
Removes property from the list.
virtual bool contains(const TQString &name)
Returns true if the list of properties contains property with given name.
void propertyValueChanged(Property *property)
Emitted when the value of the property is changed.
PropertyBuffer()
Constructs an empty property buffer.
virtual void intersect(const PropertyList *list)
Intersects with other PropertyLib::PropertyList.
MultiProperty * property(const TQString &name)
Accesses a property by it's name.
void removeFromGroup(MultiProperty *property)
Removes property from a group.
void addToGroup(const TQString &group, MultiProperty *property)
Adds property to a group.
virtual TQString name() const
virtual MultiProperty * operator[](const TQString &name)
Accesses a property by it's name.
virtual void clear()
Clears the list of properties.
void addProperty(Property *prop)
Adds property to the list.
Holds a list of properties with the same name and type.
void aboutToDeleteProperty(Property *property)
Emitted when property is about to be deleted.