• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

  • Akonadi
  • Akonadi::PartFetcher
Public Member Functions

Akonadi::PartFetcher Class Reference

Convenience class for getting payload parts from an Akonadi Model. More...

#include <partfetcher.h>

Inherits KJob.

List of all members.

Public Member Functions

 PartFetcher (const QModelIndex &index, const QByteArray &partName, QObject *parent=0)
QModelIndex index () const
Item item () const
QByteArray partName () const
virtual void start ()

Detailed Description

Convenience class for getting payload parts from an Akonadi Model.

This class can be used to retrieve individual payload parts from an EntityTreeModel, and fetch them asynchronously from the Akonadi storage if necessary.

The requested part is emitted though the partFetched signal.

Example:

 const QModelIndex index = view->selectionModel()->currentIndex();

 PartFetcher *fetcher = new PartFetcher( index, Akonadi::MessagePart::Envelope );
 connect( fetcher, SIGNAL( result( KJob* ) ), SLOT( fetchResult( KJob* ) ) );
 fetcher->start();

 ...

 MyClass::fetchResult( KJob *job )
 {
   if ( job->error() ) {
     qDebug() << job->errorText();
     return;
   }

   PartFetcher *fetcher = qobject_cast<PartFetcher*>( job );

   const Item item = fetcher->item();
   // do something with the item
 }
Author:
Stephen Kelly <steveire@gmail.com>
Since:
4.4

Definition at line 73 of file partfetcher.h.


Constructor & Destructor Documentation

Akonadi::PartFetcher::PartFetcher ( const QModelIndex &  index,
const QByteArray &  partName,
QObject *  parent = 0 
)

Creates a new part fetcher.

Parameters:
index The index of the item to fetch the part from.
partName The name of the payload part to fetch.
parent The parent object.

Member Function Documentation

QModelIndex Akonadi::PartFetcher::index (  )  const

Returns the index of the item the part was fetched from.

Item Akonadi::PartFetcher::item (  )  const

Returns the item that contains the fetched payload part.

QByteArray Akonadi::PartFetcher::partName (  )  const

Returns the name of the part that has been fetched.

virtual void Akonadi::PartFetcher::start (  )  [virtual]

Starts the fetch operation.


The documentation for this class was generated from the following file:
  • partfetcher.h

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal