lib

#include <set.h>

Inheritance diagram for KoProperty::Set:
KoProperty::Buffer

Classes

class  Iterator

Signals

void propertyChanged (KoProperty::Set &set, KoProperty::Property &property)
void propertyChangedInternal (KoProperty::Set &set, KoProperty::Property &property)
void propertyReset (KoProperty::Set &set, KoProperty::Property &property)
void aboutToDeleteProperty (KoProperty::Set &set, KoProperty::Property &property)
void aboutToBeCleared ()
void aboutToBeDeleted ()

Public Member Functions

 Set (TQObject *parent=0, const TQString &typeName=TQString())
 Set (const Set &set)
void addProperty (Property *property, TQCString group="common")
void removeProperty (Property *property)
void removeProperty (const TQCString &name)
virtual void clear ()
uint count () const
bool isEmpty () const
bool isReadOnly () const
void setReadOnly (bool readOnly)
bool contains (const TQCString &name) const
Property & property (const TQCString &name) const
Property & operator[] (const TQCString &name) const
const Set & operator= (const Set &set)
void changeProperty (const TQCString &property, const TQVariant &value)
void setGroupDescription (const TQCString &group, const TQString &desc)
TQString groupDescription (const TQCString &group) const
void setGroupIcon (const TQCString &group, const TQString &icon)
TQString groupIcon (const TQCString &group) const
const TQValueList< TQCString > & groupNames () const
const TQValueList< TQCString > & propertyNamesForGroup (const TQCString &group) const
TQCString prevSelection () const
void setPrevSelection (const TQCString &prevSelection)
TQString typeName () const
void debug ()

Protected Member Functions

 Set (bool propertyOwner)
void addToGroup (const TQCString &group, Property *property)
void removeFromGroup (Property *property)
void addPropertyInternal (Property *property, TQCString group, bool updateSortingKey)
void informAboutClearing (bool &cleared)

Protected Attributes

SetPrivate * d

Friends

class Iterator
class Property
class Buffer

Detailed Description

Lists holding properties in groups.

Author
Cedric Pasteur cedri.nosp@m.c.pa.nosp@m.steur.nosp@m.@fre.nosp@m.e.fr
Alexander Dymo cloud.nosp@m.temp.nosp@m.le@ms.nosp@m.kat..nosp@m.net
Jaroslaw Staniek js@ii.nosp@m.dea..nosp@m.pl

Definition at line 40 of file set.h.

Constructor & Destructor Documentation

◆ Set() [1/3]

Set::Set ( TQObject * parent = 0,
const TQString & typeName = TQString() )
explicit

Definition at line 132 of file set.cpp.

◆ Set() [2/3]

Set::Set ( const Set & set)
explicit

Constructs a deep copy of set. The new object will not have a TQObject parent even if set has such parent.

Definition at line 142 of file set.cpp.

◆ ~Set()

Set::~Set ( )
virtual

Definition at line 157 of file set.cpp.

◆ Set() [3/3]

Set::Set ( bool propertyOwner)
protected

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

Definition at line 149 of file set.cpp.

Member Function Documentation

◆ aboutToBeCleared

void KoProperty::Set::aboutToBeCleared ( )
signal

Emitted when property set object is about to be cleared (using clear()). This signal is also emmited from destructor before emitting aboutToBeDeleted().

◆ aboutToBeDeleted

void KoProperty::Set::aboutToBeDeleted ( )
signal

Emitted when property set object is about to be deleted.

◆ aboutToDeleteProperty

void KoProperty::Set::aboutToDeleteProperty ( KoProperty::Set & set,
KoProperty::Property & property )
signal

Emitted when property is about to be deleted.

◆ addProperty()

void Set::addProperty ( Property * property,
TQCString group = "common" )

Adds the property to the set, in the group. You can use any group name, except "common" (which is already used for basic group).

Definition at line 196 of file set.cpp.

◆ addPropertyInternal()

void Set::addPropertyInternal ( Property * property,
TQCString group,
bool updateSortingKey )
protected

Adds the property to the set, in the group. You can use any group name, except "common" (which is already used for basic group). If updateSortingKey is true, the sorting key will be set automatically to count().

Definition at line 168 of file set.cpp.

◆ addToGroup()

void Set::addToGroup ( const TQCString & group,
Property * property )
protected

Adds property to a group.

Definition at line 252 of file set.cpp.

◆ changeProperty()

void Set::changeProperty ( const TQCString & property,
const TQVariant & value )

Change the value of property whose key is property to value. By default, it only calls Property::setValue().

Definition at line 396 of file set.cpp.

◆ clear()

void Set::clear ( )
virtual

Removes all properties from the property set and destroys them.

Definition at line 226 of file set.cpp.

◆ contains()

bool Set::contains ( const TQCString & name) const
Returns
true if the set contains property names name.

Definition at line 356 of file set.cpp.

◆ count()

uint Set::count ( ) const
Returns
the number of items in the set.

Definition at line 332 of file set.cpp.

◆ debug()

void Set::debug ( )

Prints debug output for this set.

Definition at line 406 of file set.cpp.

◆ groupDescription()

TQString Set::groupDescription ( const TQCString & group) const
Returns
the i18n'ed description string for group that will be shown in Editor to represent group. If there is no special description set for the group, group is just returned.

Definition at line 310 of file set.cpp.

◆ groupIcon()

TQString Set::groupIcon ( const TQCString & group) const
Returns
the icons name for group.

Definition at line 324 of file set.cpp.

◆ groupNames()

const TQValueList< TQCString > & Set::groupNames ( ) const
Returns
a list of all group names. The order is the same as the order of creation.

Definition at line 292 of file set.cpp.

◆ informAboutClearing()

void Set::informAboutClearing ( bool & cleared)
protected

Definition at line 243 of file set.cpp.

◆ isEmpty()

bool Set::isEmpty ( ) const
Returns
true if the set is empty, i.e. count() == 0; otherwise returns false.

Definition at line 338 of file set.cpp.

◆ isReadOnly()

bool Set::isReadOnly ( ) const
Returns
true if the set is read-only. In read-only property set, no property can be modified regardless of read-only flag of any property (see Property::isReadOnly()). On the other hand, if Property::isReadOnly() is true of a property and Set::isReadOnly() is false, the property is still read-only. Read-only property set prevents editing in the property editor. By default the set is read-write.

Definition at line 344 of file set.cpp.

◆ operator=()

const Set & Set::operator= ( const Set & set)

Creates a deep copy of set and assigns it to this property set.

updateSortingKey, because the key is already set in Property copy ctor.

Definition at line 374 of file set.cpp.

◆ operator[]()

Property & Set::operator[] ( const TQCString & name) const

Accesses a property by it's name. Property reference is returned, so all property modifications are allowed. If there is no such property, null property is returned, so it's good practice to use contains() is you're unsure if the property exists. For example, to set a value of a property, use: /code Set set; ... if (!set.contains("myProperty")) { dosomething; } set["myProperty"].setValue("My Value"); /endcode

Returns
Property with given name.

Definition at line 368 of file set.cpp.

◆ prevSelection()

TQCString Set::prevSelection ( ) const

Used by property editor to preserve previous selection when this set is assigned again.

Definition at line 420 of file set.cpp.

◆ property()

Property & Set::property ( const TQCString & name) const
Returns
property named with name. If no such property is found, null property (Property::null) is returned.

Definition at line 362 of file set.cpp.

◆ propertyChanged

void KoProperty::Set::propertyChanged ( KoProperty::Set & set,
KoProperty::Property & property )
signal

Emitted when the value of the property is changed.

◆ propertyNamesForGroup()

const TQValueList< TQCString > & Set::propertyNamesForGroup ( const TQCString & group) const
Returns
a list of all property names. The order is the same as the order of creation.

Definition at line 298 of file set.cpp.

◆ propertyReset

void KoProperty::Set::propertyReset ( KoProperty::Set & set,
KoProperty::Property & property )
signal

Emitted when the value of the property is reset.

◆ removeFromGroup()

void Set::removeFromGroup ( Property * property)
protected

Removes property from a group.

Definition at line 274 of file set.cpp.

◆ removeProperty() [1/2]

void Set::removeProperty ( const TQCString & name)

Removes property with the given name from the set. Emits aboutToDeleteProperty() before removing.

Definition at line 216 of file set.cpp.

◆ removeProperty() [2/2]

void Set::removeProperty ( Property * property)

Removes property from the set. Emits aboutToDeleteProperty before removing.

Definition at line 202 of file set.cpp.

◆ setGroupDescription()

void Set::setGroupDescription ( const TQCString & group,
const TQString & desc )

Sets the i18n'ed string that will be shown in Editor to represent group.

Definition at line 304 of file set.cpp.

◆ setGroupIcon()

void Set::setGroupIcon ( const TQCString & group,
const TQString & icon )

Sets the icon name icon to be displayed for group.

Definition at line 318 of file set.cpp.

◆ setPrevSelection()

void Set::setPrevSelection ( const TQCString & prevSelection)

Definition at line 426 of file set.cpp.

◆ setReadOnly()

void Set::setReadOnly ( bool readOnly)

Sets this set to be read-only.

See also
isReadOnly

Definition at line 350 of file set.cpp.

◆ typeName()

TQString Set::typeName ( ) const

A name of this property set type, that is usable when we want to know if two property set objects have the same type. This avoids e.g. reloading of all Editor's contents. Also, this allows to know if two property set objects are compatible by their property sets. For comparing purposes, type names are case insensitive.

Definition at line 432 of file set.cpp.

◆ Buffer

friend class Buffer
friend

Definition at line 225 of file set.h.

◆ Iterator

friend class Iterator
friend

Definition at line 223 of file set.h.

◆ Property

friend class Property
friend

Definition at line 224 of file set.h.

Member Data Documentation

◆ d

SetPrivate* KoProperty::Set::d
protected

Definition at line 221 of file set.h.


The documentation for this class was generated from the following files: