akonadi
#include <attribute.h>
Public Types | |
typedef QList< Attribute * > | List |
Public Member Functions | |
virtual | ~Attribute () |
virtual Attribute * | clone () const =0 |
virtual void | deserialize (const QByteArray &data)=0 |
virtual QByteArray | serialized () const =0 |
virtual QByteArray | type () const =0 |
Detailed Description
Provides interface for custom attributes for Entity.
This class is an interface for custom attributes, that can be stored in an entity. Attributes should be meta data, e.g. ACLs, quotas etc. that are not part of the entities' data itself.
Note that attributes are per user, i.e. when an attribute is added to an entity, it only applies to the current user.
To provide custom attributes, you have to subclass from this interface and reimplement the pure virtual methods.
Additionally, you need to register your attribute with Akonadi::AttributeFactory for automatic deserialization during retrieving of collecitons or items:
Third party attributes need to be registered once by each application that uses them. So the above snippet needs to be in the resource that adds the attribute, and each application that uses the resource. This may be simplified in the future.
The custom attributes can be used in the following way:
and
Definition at line 138 of file attribute.h.
Member Typedef Documentation
typedef QList<Attribute*> Akonadi::Attribute::List |
Describes a list of attributes.
Definition at line 144 of file attribute.h.
Constructor & Destructor Documentation
|
virtual |
Destroys this attribute.
Definition at line 24 of file attribute.cpp.
Member Function Documentation
|
pure virtual |
Creates a copy of this attribute.
Implemented in Akonadi::EntityDisplayAttribute, Akonadi::CollectionQuotaAttribute, Akonadi::EntityDeletedAttribute, Akonadi::MessageThreadingAttribute, Akonadi::EntityHiddenAttribute, Akonadi::BlockAlarmsAttribute, Akonadi::CollectionRightsAttribute, Akonadi::MessageFolderAttribute, Akonadi::SpecialCollectionAttribute, Akonadi::ContactMetaDataAttribute, and Akonadi::AddressAttribute.
|
pure virtual |
Sets the data of this attribute, using the same encoding as returned by toByteArray().
- Parameters
-
data The encoded attribute data.
Implemented in Akonadi::EntityDisplayAttribute, Akonadi::CollectionQuotaAttribute, Akonadi::EntityDeletedAttribute, Akonadi::EntityHiddenAttribute, Akonadi::BlockAlarmsAttribute, Akonadi::MessageThreadingAttribute, Akonadi::CollectionRightsAttribute, Akonadi::MessageFolderAttribute, Akonadi::SpecialCollectionAttribute, Akonadi::ContactMetaDataAttribute, and Akonadi::AddressAttribute.
|
pure virtual |
Returns a QByteArray representation of the attribute which will be storaged.
This can be raw binary data, no encoding needs to be applied.
Implemented in Akonadi::EntityDisplayAttribute, Akonadi::CollectionQuotaAttribute, Akonadi::EntityDeletedAttribute, Akonadi::EntityHiddenAttribute, Akonadi::MessageThreadingAttribute, Akonadi::BlockAlarmsAttribute, Akonadi::CollectionRightsAttribute, Akonadi::MessageFolderAttribute, Akonadi::SpecialCollectionAttribute, Akonadi::ContactMetaDataAttribute, and Akonadi::AddressAttribute.
|
pure virtual |
Returns the type of the attribute.
Implemented in Akonadi::EntityDisplayAttribute, Akonadi::CollectionQuotaAttribute, Akonadi::MessageThreadingAttribute, Akonadi::EntityDeletedAttribute, Akonadi::EntityHiddenAttribute, Akonadi::BlockAlarmsAttribute, Akonadi::CollectionRightsAttribute, Akonadi::MessageFolderAttribute, Akonadi::SpecialCollectionAttribute, Akonadi::ContactMetaDataAttribute, and Akonadi::AddressAttribute.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.