akonadi
Akonadi::Item Class Reference
#include <item.h>
List of all members.
Detailed Description
Represents a PIM item stored in Akonadi storage.
A PIM item consists of one or more parts, allowing a fine-grained access on its content where needed (eg. mail envelope, mail body and attachments).
There is also a namespace (prefix) for special parts which are local to Akonadi. These parts, prefixed by "akonadi-" will never be fetched in the resource. They are useful for local extensions like agents which might want to add meta data to items in order to handle them but the meta data should not be stored back to the resource.
This class contains beside some type-agnostic information (flags, revision) a single payload object representing its actual data. Which objects these actually are depends on the mimetype of the item and the corresponding serializer plugin.
This class is implicitly shared.
- Author:
- Volker Krause <vkrause@kde.org>, Till Adam <adam@kde.org>
Definition at line 145 of file item.h.
Member Typedef Documentation
Describes a flag name.
Definition at line 156 of file item.h.
Describes a set of flag names.
Definition at line 161 of file item.h.
Describes a list of items.
Definition at line 151 of file item.h.
Member Enumeration Documentation
Describes the type of url which is returned in url().
- Enumerator:
-
UrlShort |
A short url which contains the identifier only (default). |
UrlWithMimeType |
A url with identifier and mimetype. |
Definition at line 337 of file item.h.
Constructor & Destructor Documentation
Creates a new item.
Definition at line 34 of file item.cpp.
Item::Item |
( |
Id |
id |
) |
[explicit] |
Creates a new item with the given unique id
.
Definition at line 39 of file item.cpp.
Item::Item |
( |
const QString & |
mimeType |
) |
[explicit] |
Creates a new item with the given mime type.
- Parameters:
-
| mimeType | The mime type of the item. |
Definition at line 44 of file item.cpp.
Item::Item |
( |
const Item & |
other |
) |
|
Creates a new item from an other
item.
Definition at line 50 of file item.cpp.
Destroys the item.
Definition at line 55 of file item.cpp.
Member Function Documentation
Removes the flag with the given name
from the item.
Definition at line 72 of file item.cpp.
void Item::clearFlags |
( |
|
) |
|
Removes all flags from the item.
Definition at line 87 of file item.cpp.
Returns all flags of this item.
Definition at line 59 of file item.cpp.
Item Item::fromUrl |
( |
const KUrl & |
url |
) |
[static] |
Creates an item from the given url
.
Definition at line 154 of file item.cpp.
bool Item::hasFlag |
( |
const QByteArray & |
name |
) |
const |
Returns whether the flag with the given name
is set in the item.
Definition at line 94 of file item.cpp.
template<typename T>
bool Akonadi::Item::hasPayload |
( |
|
) |
const [inline] |
Returns whether the item has a payload of type T
.
Definition at line 322 of file item.h.
bool Item::hasPayload |
( |
|
) |
const |
Returns whether the item has a payload object.
Definition at line 137 of file item.cpp.
Returns the list of loaded payload parts.
This is not necessarily identical to all parts in the cache or to all available parts on the backend.
Definition at line 99 of file item.cpp.
Returns the mime type of the item.
Definition at line 127 of file item.cpp.
template<typename T>
T Akonadi::Item::payload |
( |
|
) |
const [inline] |
Returns the payload object of this PIM item.
- Note:
- This method will abort the application if you try to retrieve the wrong payload type, so better always check the mime type first.
Definition at line 298 of file item.h.
Returns the full payload in its canonical representation, e.g.
the binary or textual format usually used for data with this mime type. This is useful when communicating with non-Akonadi application by e.g. drag&drop, copy&paste or stored files.
Definition at line 104 of file item.cpp.
int Item::revision |
( |
|
) |
const |
Returns the revision number of the item.
Definition at line 117 of file item.cpp.
Sets the flag with the given name
in the item.
Definition at line 64 of file item.cpp.
void Item::setFlags |
( |
const Flags & |
flags |
) |
|
Overwrites all flags of the item by the given flags
.
Definition at line 80 of file item.cpp.
void Item::setMimeType |
( |
const QString & |
mimeType |
) |
|
Sets the mime type of the item to mimeType
.
Definition at line 132 of file item.cpp.
template<typename T>
void Akonadi::Item::setPayload |
( |
T |
p |
) |
[inline] |
Sets the payload object of this PIM item.
The payload MUST NOT be a pointer, use a boost::shared_ptr instead. The payload should be an implicitly shared class.
Definition at line 285 of file item.h.
void Item::setPayloadFromData |
( |
const QByteArray & |
data |
) |
|
Sets the payload based on the canonical representation normally used for data of this mime type.
- Parameters:
-
- See also:
- fullPayloadData
Definition at line 112 of file item.cpp.
void Item::setRevision |
( |
int |
revision |
) |
|
Sets the revision
number of the item.
- Note:
- Do not modify this value from within an application, it is updated automatically by the revision checking functions.
Definition at line 122 of file item.cpp.
KUrl Item::url |
( |
UrlType |
type = UrlShort |
) |
const |
Returns the url of the item.
Definition at line 142 of file item.cpp.
Member Data Documentation
Describes the part name that is used to fetch the full payload of an item.
Definition at line 167 of file item.h.
The documentation for this class was generated from the following files: