KDevelop API Documentation

PropertyLib::PropertyList Class Reference

The list of properties. More...

#include <propertylist.h>

Inheritance diagram for PropertyLib::PropertyList:

Inheritance graph
[legend]
Collaboration diagram for PropertyLib::PropertyList:

Collaboration graph
[legend]
List of all members.

Signals

void propertyValueChanged (Property *property)
 Emitted when the value of the property is changed.
void aboutToDeleteProperty (Property *property)
 Emitted when property is about to be deleted.

Public Member Functions

 PropertyList ()
virtual ~PropertyList ()
virtual MultiPropertyoperator[] (const QString &name)
 Accesses a property by it's name.
virtual void addProperty (Property *property)
 Adds the property to the list to the "common" group.
virtual void addProperty (const QString &group, Property *property)
 Adds the property to the list in group.
virtual void removeProperty (Property *property)
 Removes property from the list.
virtual void removeProperty (const QString &name)
 Removes property with the given name from the list.
virtual const QValueList<
QPair< QString, QValueList<
QString > > > & 
propertiesOfGroup () const
virtual const QMap< MultiProperty *,
QString > & 
groupOfProperty () const
virtual void clear ()
 Clears the list of properties.
virtual bool contains (const QString &name)
 Returns true if the list of properties contains property with given name.
QPtrList< Propertyproperties (const QString &name)
 The list of properties with given name.

Protected Member Functions

 PropertyList (bool propertyOwner)
 Constructs a list which owns or does not own it's properties.
void addToGroup (const QString &group, MultiProperty *property)
 Adds property to a group.
void removeFromGroup (MultiProperty *property)
 Removes property from a group.

Private Attributes

QMap< QString, MultiProperty * > m_list
QValueList< QPair< QString,
QValueList< QString > > > 
m_propertiesOfGroup
QMap< MultiProperty *, QStringm_groupOfProperty
bool m_propertyOwner

Friends

class MultiProperty
class PropertyBuffer

Detailed Description

The list of properties.

Every object in a program should operate with properties through this list in order to:

PropertyList owns properties and deletes them itself. For a list that does not own it's properties, look at PropertyBuffer class.

PropertyList is also capable of grouping properties. You can have unsorted list of groups of properties or a plain alphabetically sorted list of properties or both at the same time.

Definition at line 55 of file propertylist.h.


Constructor & Destructor Documentation

PropertyLib::PropertyList::PropertyList  ) 
 

Definition at line 27 of file propertylist.cpp.

PropertyLib::PropertyList::~PropertyList  )  [virtual]
 

Definition at line 37 of file propertylist.cpp.

References clear().

PropertyLib::PropertyList::PropertyList bool  propertyOwner  )  [protected]
 

Constructs a list which owns or does not own it's properties.

Definition at line 32 of file propertylist.cpp.


Member Function Documentation

void PropertyLib::PropertyList::aboutToDeleteProperty Property property  )  [signal]
 

Emitted when property is about to be deleted.

Referenced by removeProperty().

void PropertyLib::PropertyList::addProperty const QString group,
Property property
[virtual]
 

Adds the property to the list in group.

Definition at line 68 of file propertylist.cpp.

References PropertyLib::MultiProperty::addProperty(), addToGroup(), m_list, MultiProperty, and PropertyLib::Property::name().

void PropertyLib::PropertyList::addProperty Property property  )  [virtual]
 

Adds the property to the list to the "common" group.

Definition at line 50 of file propertylist.cpp.

References PropertyLib::MultiProperty::addProperty(), addToGroup(), m_list, MultiProperty, and PropertyLib::Property::name().

void PropertyLib::PropertyList::addToGroup const QString group,
MultiProperty property
[protected]
 

Adds property to a group.

Definition at line 151 of file propertylist.cpp.

References m_groupOfProperty, m_propertiesOfGroup, and PropertyLib::MultiProperty::name().

Referenced by addProperty(), PropertyLib::PropertyBuffer::PropertyBuffer(), and removeProperty().

void PropertyLib::PropertyList::clear  )  [virtual]
 

Clears the list of properties.

Definition at line 250 of file propertylist.cpp.

References m_list, and removeProperty().

Referenced by PropertyLib::PropertyEditor::clearProperties(), and ~PropertyList().

bool PropertyLib::PropertyList::contains const QString name  )  [virtual]
 

Returns true if the list of properties contains property with given name.

Definition at line 256 of file propertylist.cpp.

References m_list.

const QMap< MultiProperty *, QString > & PropertyLib::PropertyList::groupOfProperty  )  const [virtual]
 

Returns:
the map: property - group name.

Definition at line 146 of file propertylist.cpp.

MultiProperty * PropertyLib::PropertyList::operator[] const QString name  )  [virtual]
 

Accesses a property by it's name.

All property modifications are allowed trough this method. For example, to set a value of a property, use: /code PropertyList list; ... list["My Property"]->setValue("My Value"); /endcode

Returns:
MultiProperty with given name.

Definition at line 42 of file propertylist.cpp.

References m_list, and MultiProperty.

QPtrList< Property > PropertyLib::PropertyList::properties const QString name  ) 
 

The list of properties with given name.

Definition at line 263 of file propertylist.cpp.

References m_list.

const QValueList< QPair< QString, QValueList< QString > > > & PropertyLib::PropertyList::propertiesOfGroup  )  const [virtual]
 

Returns:
the list of grouped properties.

Definition at line 141 of file propertylist.cpp.

Referenced by PropertyLib::PropertyEditor::populateProperties().

void PropertyLib::PropertyList::propertyValueChanged Property property  )  [signal]
 

Emitted when the value of the property is changed.

Referenced by PropertyLib::MultiProperty::setValue(), and PropertyLib::MultiProperty::undo().

void PropertyLib::PropertyList::removeFromGroup MultiProperty property  )  [protected]
 

Removes property from a group.

Definition at line 186 of file propertylist.cpp.

References m_groupOfProperty, m_propertiesOfGroup, and PropertyLib::MultiProperty::name().

Referenced by removeProperty().

void PropertyLib::PropertyList::removeProperty const QString name  )  [virtual]
 

Removes property with the given name from the list.

Emits aboutToDeleteProperty before removing.

Definition at line 112 of file propertylist.cpp.

References aboutToDeleteProperty(), addToGroup(), m_groupOfProperty, m_list, PropertyLib::Property::name(), and removeFromGroup().

void PropertyLib::PropertyList::removeProperty Property property  )  [virtual]
 

Removes property from the list.

Emits aboutToDeleteProperty before removing.

Definition at line 87 of file propertylist.cpp.

References aboutToDeleteProperty(), addToGroup(), PropertyLib::MultiProperty::list, m_groupOfProperty, m_list, PropertyLib::Property::name(), removeFromGroup(), and PropertyLib::MultiProperty::removeProperty().

Referenced by clear(), and PropertyLib::PropertyBuffer::intersect().


Friends And Related Function Documentation

friend class MultiProperty [friend]
 

Definition at line 124 of file propertylist.h.

Referenced by addProperty(), operator[](), and PropertyLib::PropertyBuffer::PropertyBuffer().

friend class PropertyBuffer [friend]
 

Definition at line 125 of file propertylist.h.


Member Data Documentation

QMap<MultiProperty*, QString> PropertyLib::PropertyList::m_groupOfProperty [private]
 

Definition at line 118 of file propertylist.h.

Referenced by addToGroup(), PropertyLib::PropertyBuffer::intersect(), PropertyLib::PropertyBuffer::PropertyBuffer(), removeFromGroup(), and removeProperty().

QMap<QString, MultiProperty*> PropertyLib::PropertyList::m_list [private]
 

Definition at line 112 of file propertylist.h.

Referenced by addProperty(), clear(), contains(), PropertyLib::PropertyBuffer::intersect(), operator[](), properties(), PropertyLib::PropertyBuffer::PropertyBuffer(), and removeProperty().

QValueList<QPair<QString, QValueList<QString> > > PropertyLib::PropertyList::m_propertiesOfGroup [private]
 

Definition at line 116 of file propertylist.h.

Referenced by addToGroup(), and removeFromGroup().

bool PropertyLib::PropertyList::m_propertyOwner [private]
 

Definition at line 122 of file propertylist.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:33:26 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003