• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • ProtocolHelper
Public Types | Static Public Member Functions | List of all members
Akonadi::ProtocolHelper Class Reference

#include <protocolhelper_p.h>

Public Types

enum  PartNamespace { PartGlobal, PartPayload, PartAttribute }
 

Static Public Member Functions

static QString absolutePayloadFilePath (const QString &fileName)
 
static QString akonadiStoragePath ()
 
static QByteArray attributesToByteArray (const Entity &entity, bool ns=false)
 
static QByteArray attributesToByteArray (const AttributeEntity &entity, bool ns=false)
 
static QByteArray cachePolicyToByteArray (const CachePolicy &policy)
 
static QByteArray commandContextToByteArray (const Akonadi::Collection &collection, const Akonadi::Tag &tag, const Item::List &requestedItems, const QByteArray &command)
 
static QByteArray decodePartIdentifier (const QByteArray &data, PartNamespace &ns)
 
static QByteArray enabled (bool)
 
static QByteArray encodePartIdentifier (PartNamespace ns, const QByteArray &label, int version=0)
 
template<typename T >
static QByteArray entityIdToByteArray (const T &object, const QByteArray &command)
 
template<typename T >
static QByteArray entitySetToByteArray (const QList< T > &_objects, const QByteArray &command)
 
static QByteArray entitySetToByteArray (const QList< Akonadi::Item > &_objects, const QByteArray &command)
 
static QByteArray hierarchicalRidToByteArray (const Collection &col)
 
static QByteArray hierarchicalRidToByteArray (const Item &item)
 
static QByteArray itemFetchScopeToByteArray (const ItemFetchScope &fetchScope)
 
static QByteArray listPreference (Collection::ListPurpose purpose, Collection::ListPreference preference)
 
static void parseAncestors (const QByteArray &data, Entity *entity, int start=0)
 
static void parseAncestorsCached (const QByteArray &data, Entity *entity, Collection::Id parentCollection, ProtocolHelperValuePool *valuePool=0, int start=0)
 
static int parseCachePolicy (const QByteArray &data, CachePolicy &policy, int start=0)
 
static int parseCollection (const QByteArray &data, Collection &collection, int start=0)
 
static void parseItemFetchResult (const QList< QByteArray > &lineTokens, Item &item, ProtocolHelperValuePool *valuePool=0)
 
static void parseTagFetchResult (const QList< QByteArray > &lineTokens, Tag &tag)
 
static QByteArray referenced (bool)
 
static bool streamPayloadToFile (const QByteArray &command, const QByteArray &data, QByteArray &error)
 
static QByteArray tagFetchScopeToByteArray (const TagFetchScope &fetchScope)
 
static QByteArray tagSetToByteArray (const Akonadi::Tag::List &_objects, const QByteArray &command)
 
static QByteArray tagSetToImapSequenceSet (const Akonadi::Tag::List &_objects)
 

Detailed Description

Helper methods for converting between libakonadi objects and their protocol representation.

Todo:

Add unit tests for this.

Use exceptions for a useful error handling

Definition at line 58 of file protocolhelper_p.h.

Member Enumeration Documentation

enum Akonadi::ProtocolHelper::PartNamespace

Part namespaces.

Definition at line 62 of file protocolhelper_p.h.

Member Function Documentation

QByteArray ProtocolHelper::attributesToByteArray ( const Entity &  entity,
bool  ns = false 
)
static

Convert attributes to their protocol representation.

Definition at line 232 of file protocolhelper.cpp.

QByteArray ProtocolHelper::cachePolicyToByteArray ( const CachePolicy &  policy)
static

Convert a cache policy object into its protocol representation.

Definition at line 71 of file protocolhelper.cpp.

QByteArray ProtocolHelper::decodePartIdentifier ( const QByteArray &  data,
PartNamespace &  ns 
)
static

Decode part label and namespace.

Definition at line 268 of file protocolhelper.cpp.

QByteArray ProtocolHelper::encodePartIdentifier ( PartNamespace  ns,
const QByteArray &  label,
int  version = 0 
)
static

Encodes part label and namespace.

Definition at line 252 of file protocolhelper.cpp.

template<typename T >
static QByteArray Akonadi::ProtocolHelper::entityIdToByteArray ( const T &  object,
const QByteArray &  command 
)
inlinestatic

Converts the given object identifier into a protocol representation.

Exceptions
AAkonadi::Exception if the item set contains items with missing/invalid identifiers.

Definition at line 204 of file protocolhelper_p.h.

template<typename T >
static QByteArray Akonadi::ProtocolHelper::entitySetToByteArray ( const QList< T > &  _objects,
const QByteArray &  command 
)
inlinestatic

Converts the given set of items into a protocol representation.

Exceptions
AAkonadi::Exception if the item set contains items with missing/invalid identifiers.

Definition at line 125 of file protocolhelper_p.h.

QByteArray ProtocolHelper::hierarchicalRidToByteArray ( const Collection &  col)
static

Converts the given collection's hierarchical RID into a protocol representation.

Assumes col has a valid hierarchical RID, so check that before!

Definition at line 395 of file protocolhelper.cpp.

QByteArray ProtocolHelper::hierarchicalRidToByteArray ( const Item &  item)
static

Converts the HRID of the given item into an ASAP protocol representation.

Assumes item has a valid HRID.

Definition at line 405 of file protocolhelper.cpp.

QByteArray ProtocolHelper::itemFetchScopeToByteArray ( const ItemFetchScope &  fetchScope)
static

Converts a given ItemFetchScope object into a protocol representation.

Definition at line 411 of file protocolhelper.cpp.

void ProtocolHelper::parseAncestors ( const QByteArray &  data,
Entity *  entity,
int  start = 0 
)
static

Convert a ancestor chain from its protocol representation into an Entity object.

Definition at line 106 of file protocolhelper.cpp.

void ProtocolHelper::parseAncestorsCached ( const QByteArray &  data,
Entity *  entity,
Collection::Id  parentCollection,
ProtocolHelperValuePool *  valuePool = 0,
int  start = 0 
)
static

Convert a ancestor chain from its protocol representation into an Entity object.

This method allows to pass a valuePool which acts as cache, so ancestor paths for the same parentCollection don't have to be parsed twice.

Definition at line 87 of file protocolhelper.cpp.

int ProtocolHelper::parseCachePolicy ( const QByteArray &  data,
CachePolicy &  policy,
int  start = 0 
)
static

Parse a cache policy definition.

Parameters
dataThe input data.
policyThe parsed cache policy.
startStart of the data, ie. postion after the label.
Returns
Position in data after the cache policy description.

Definition at line 43 of file protocolhelper.cpp.

int ProtocolHelper::parseCollection ( const QByteArray &  data,
Collection &  collection,
int  start = 0 
)
static

Parse a collection description.

Parameters
dataThe input data.
collectionThe parsed collection.
startStart of the data.
Returns
Position in data after the collection description.

Definition at line 145 of file protocolhelper.cpp.

void ProtocolHelper::parseItemFetchResult ( const QList< QByteArray > &  lineTokens,
Item &  item,
ProtocolHelperValuePool *  valuePool = 0 
)
static

Parses a single line from an item fetch job result into an Item object.

Definition at line 503 of file protocolhelper.cpp.

QByteArray ProtocolHelper::tagFetchScopeToByteArray ( const TagFetchScope &  fetchScope)
static

Converts a given TagFetchScope object into a protocol representation.

Definition at line 468 of file protocolhelper.cpp.


The documentation for this class was generated from the following files:
  • protocolhelper_p.h
  • protocolhelper.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal