akonadi
protocolhelper.cpp
87void ProtocolHelper::parseAncestorsCached( const QByteArray &data, Entity *entity, Collection::Id parentCollection,
252QByteArray ProtocolHelper::encodePartIdentifier(PartNamespace ns, const QByteArray & label, int version )
254 const QByteArray versionString( version != 0 ? QByteArray(QByteArray("[") + QByteArray::number( version ) + QByteArray("]")) : "" );
282QByteArray ProtocolHelper::entitySetToByteArray( const QList<Item> &_objects, const QByteArray &command )
288 std::sort( objects.begin(), objects.end(), boost::bind( &Item::id, _1 ) < boost::bind( &Item::id, _2 ) );
325 std::sort( objects.begin(), objects.end(), boost::bind( &Tag::id, _1 ) < boost::bind( &Tag::id, _2 ) );
338QByteArray ProtocolHelper::tagSetToByteArray( const Tag::List &_objects, const QByteArray &command )
346 std::sort( objects.begin(), objects.end(), boost::bind( &Tag::id, _1 ) < boost::bind( &Tag::id, _2 ) );
365QByteArray ProtocolHelper::commandContextToByteArray(const Akonadi::Collection &collection, const Akonadi::Tag &tag,
387 r += " " AKONADI_PARAM_COLLECTION " " + ImapParser::quote(collection.remoteId().toUtf8()) + ' ';
402 return '(' + QByteArray::number( col.id() ) + ' ' + ImapParser::quote( col.remoteId().toUtf8() ) + ") " + parentHrid;
408 return '(' + QByteArray::number( item.id() ) + ' ' + ImapParser::quote( item.remoteId().toUtf8() ) + ") " + parentHrid;
438 command += " " AKONADI_PARAM_CHANGEDSINCE " " + QByteArray::number( fetchScope.fetchChangedSince().toTime_t() );
480static Item::Flags convertFlags( const QList<QByteArray>& flags, ProtocolHelperValuePool *valuePool )
483 // When the compiler supports thread-safe static initialization (mandated by the C++11 memory model)
485 // NOTE: GCC and clang has threadsafe static initialization for some time now, even without C++11.
503void ProtocolHelper::parseItemFetchResult( const QList<QByteArray> &lineTokens, Item &item, ProtocolHelperValuePool *valuePool )
640 //kDebug() << "Payload is external: " << isExternal << " filename: " << lineTokens.value( i + 1 );
708 fullRelPath += QDir::separator() + QLatin1String("instance") + QDir::separator() + Akonadi::ServerManager::instanceIdentifier();
717 return akonadiStoragePath() + QDir::separator() + QLatin1String("file_db_data") + QDir::separator() + fileName;
723bool ProtocolHelper::streamPayloadToFile(const QByteArray &command, const QByteArray &data, QByteArray &error)
757QByteArray ProtocolHelper::listPreference(Collection::ListPurpose purpose, Collection::ListPreference preference)
Parent class for entities that can have attributes.
Definition: attributeentity.h:40
Attribute::List attributes() const
Returns a list of all attributes of the entity.
Definition: attributeentity.cpp:99
static Attribute * createAttribute(const QByteArray &type)
Creates an entity attribute object of the given type.
Definition: attributefactory.cpp:147
virtual void deserialize(const QByteArray &data)=0
Sets the data of this attribute, using the same encoding as returned by toByteArray().
virtual QByteArray serialized() const =0
Returns a QByteArray representation of the attribute which will be storaged.
int cacheTimeout() const
Returns the cache timeout for non-permanently cached parts in minutes; -1 means indefinitely.
Definition: cachepolicy.cpp:108
bool inheritFromParent() const
Returns whether it inherits cache policy from the parent collection.
Definition: cachepolicy.cpp:88
int intervalCheckTime() const
Returns the interval check time in minutes, -1 for never.
Definition: cachepolicy.cpp:118
void setLocalParts(const QStringList &parts)
Specifies the parts to permanently cache locally.
Definition: cachepolicy.cpp:103
QStringList localParts() const
Returns the parts to permanently cache locally.
Definition: cachepolicy.cpp:98
bool syncOnDemand() const
Returns whether the collection will be synced automatically when necessary, i.e.
Definition: cachepolicy.cpp:128
void setCacheTimeout(int timeout)
Sets cache timeout for non-permanently cached parts.
Definition: cachepolicy.cpp:113
void setInheritFromParent(bool inherit)
Sets whether the cache policy should be inherited from the parent collection.
Definition: cachepolicy.cpp:93
void setSyncOnDemand(bool enable)
Sets whether the collection shall be synced automatically when necessary, i.e.
Definition: cachepolicy.cpp:133
Provides statistics information of a Collection.
Definition: collectionstatistics.h:70
void setUnreadCount(qint64 count)
Sets the number of unread items in this collection.
Definition: collectionstatistics.cpp:82
void setSize(qint64 size)
Sets the total size of the items in this collection.
Definition: collectionstatistics.cpp:92
void setCount(qint64 count)
Sets the number of items in this collection.
Definition: collectionstatistics.cpp:72
Collection parentCollection() const
Returns the parent collection of this object.
Definition: entity.cpp:185
Attribute::List attributes() const
Returns a list of all attributes of the entity.
Definition: entity.cpp:153
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
Definition: entity.cpp:194
Specifies which parts of an item should be fetched from the Akonadi storage.
Definition: itemfetchscope.h:70
bool fetchVirtualReferences() const
Returns whether virtual references should be retrieved.
Definition: itemfetchscope.cpp:217
bool allAttributes() const
Returns whether all available attributes should be fetched.
Definition: itemfetchscope.cpp:89
bool fetchRemoteIdentification() const
Returns whether item remote identification should be retrieved.
Definition: itemfetchscope.cpp:182
bool fullPayload() const
Returns whether the full payload should be fetched.
Definition: itemfetchscope.cpp:65
bool cacheOnly() const
Returns whether payload data should be requested from remote sources or just from the local cache.
Definition: itemfetchscope.cpp:104
bool fetchModificationTime() const
Returns whether item modification time should be retrieved.
Definition: itemfetchscope.cpp:142
bool checkForCachedPayloadPartsOnly() const
Returns whether payload data should be fetched or only checked for presence in the cache.
Definition: itemfetchscope.cpp:122
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition: itemfetchscope.cpp:75
bool ignoreRetrievalErrors() const
Returns whether retrieval errors should be ignored.
Definition: itemfetchscope.cpp:162
QSet< QByteArray > payloadParts() const
Returns the payload parts that should be fetched.
Definition: itemfetchscope.cpp:51
bool fetchGid() const
Returns whether item GID should be retrieved.
Definition: itemfetchscope.cpp:152
AncestorRetrieval ancestorRetrieval() const
Returns the ancestor retrieval depth.
Definition: itemfetchscope.cpp:127
KDateTime fetchChangedSince() const
Returns timestamp of the oldest item to fetch.
Definition: itemfetchscope.cpp:172
static void deserialize(Item &item, const QByteArray &label, const QByteArray &data, int version, bool external)
throws ItemSerializerException on failure
Definition: itemserializer.cpp:84
static QByteArray itemFetchScopeToByteArray(const ItemFetchScope &fetchScope)
Converts a given ItemFetchScope object into a protocol representation.
Definition: protocolhelper.cpp:411
static int parseCachePolicy(const QByteArray &data, CachePolicy &policy, int start=0)
Parse a cache policy definition.
Definition: protocolhelper.cpp:43
static QByteArray hierarchicalRidToByteArray(const Collection &col)
Converts the given collection's hierarchical RID into a protocol representation.
Definition: protocolhelper.cpp:395
static void parseAncestors(const QByteArray &data, Entity *entity, int start=0)
Convert a ancestor chain from its protocol representation into an Entity object.
Definition: protocolhelper.cpp:106
static QByteArray tagFetchScopeToByteArray(const TagFetchScope &fetchScope)
Converts a given TagFetchScope object into a protocol representation.
Definition: protocolhelper.cpp:468
static QByteArray attributesToByteArray(const Entity &entity, bool ns=false)
Convert attributes to their protocol representation.
Definition: protocolhelper.cpp:232
static int parseCollection(const QByteArray &data, Collection &collection, int start=0)
Parse a collection description.
Definition: protocolhelper.cpp:145
static QByteArray decodePartIdentifier(const QByteArray &data, PartNamespace &ns)
Decode part label and namespace.
Definition: protocolhelper.cpp:268
static void parseItemFetchResult(const QList< QByteArray > &lineTokens, Item &item, ProtocolHelperValuePool *valuePool=0)
Parses a single line from an item fetch job result into an Item object.
Definition: protocolhelper.cpp:503
static QByteArray cachePolicyToByteArray(const CachePolicy &policy)
Convert a cache policy object into its protocol representation.
Definition: protocolhelper.cpp:71
static void parseAncestorsCached(const QByteArray &data, Entity *entity, Collection::Id parentCollection, ProtocolHelperValuePool *valuePool=0, int start=0)
Convert a ancestor chain from its protocol representation into an Entity object.
Definition: protocolhelper.cpp:87
static QByteArray encodePartIdentifier(PartNamespace ns, const QByteArray &label, int version=0)
Encodes part label and namespace.
Definition: protocolhelper.cpp:252
static QByteArray entitySetToByteArray(const QList< T > &_objects, const QByteArray &command)
Converts the given set of items into a protocol representation.
Definition: protocolhelper_p.h:125
static bool hasInstanceIdentifier()
Returns true if we are connected to a non-default Akonadi server instance.
Definition: servermanager.cpp:289
static QString instanceIdentifier()
Returns the identifier of the Akonadi instance we are connected to.
Definition: servermanager.cpp:284
Specifies which parts of a tag should be fetched from the Akonadi storage.
Definition: tagfetchscope.h:34
bool fetchIdOnly() const
Sets wether only the id of the tags should be retieved or the complete tag.
Definition: tagfetchscope.cpp:79
QSet< QByteArray > attributes() const
Returns all explicitly fetched attributes.
Definition: tagfetchscope.cpp:59
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.