• Skip to content
  • Skip to link menu
KDE 4.8 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • CollectionStatistics
Public Member Functions
Akonadi::CollectionStatistics Class Reference

#include <collectionstatistics.h>

List of all members.

Public Member Functions

 CollectionStatistics ()
 CollectionStatistics (const CollectionStatistics &other)
 ~CollectionStatistics ()
qint64 count () const
CollectionStatistics & operator= (const CollectionStatistics &other)
void setCount (qint64 count)
void setSize (qint64 size)
void setUnreadCount (qint64 count)
qint64 size () const
qint64 unreadCount () const

Detailed Description

Provides statistics information of a Collection.

This class contains information such as total number of items, number of new and unread items, etc.

These information might be expensive to obtain and are thus not included when fetching collection with a CollectionFetchJob. They can be retrieved spearately using CollectionStatisticsJob.

Example:

 Akonadi::Collection collection = ...

 Akonadi::CollectionStatisticsJob *job = new Akonadi::CollectionStatisticsJob( collection );
 connect( job, SIGNAL( result( KJob* ) ), SLOT( jobFinished( KJob* ) ) );

 ...

 MyClass::jobFinished( KJob *job )
 {
   if ( job->error() ) {
     qDebug() << "Error occurred";
     return;
   }

   CollectionStatisticsJob *statisticsJob = qobject_cast<CollectionStatisticsJob*>( job );

   const Akonadi::CollectionStatistics statistics = statisticsJob->statistics();
   qDebug() << "Unread items:" << statistics.unreadCount();
 }

This class is implicitely shared.

Author:
Volker Krause <vkrause@kde.org>

Definition at line 69 of file collectionstatistics.h.


Constructor & Destructor Documentation

Akonadi::CollectionStatistics::CollectionStatistics ( )

Creates a new collection statistics object.

Akonadi::CollectionStatistics::CollectionStatistics ( const CollectionStatistics &  other)

Creates a collection statistics object from an other one.

Akonadi::CollectionStatistics::~CollectionStatistics ( )

Destroys the collection statistics object.


Member Function Documentation

qint64 Akonadi::CollectionStatistics::count ( ) const

Returns the number of items in this collection or -1 if this information is not available.

See also:
setCount()
unreadCount()
CollectionStatistics& Akonadi::CollectionStatistics::operator= ( const CollectionStatistics &  other)

Assigns other to this statistics object and returns a reference to this one.

void Akonadi::CollectionStatistics::setCount ( qint64  count)

Sets the number of items in this collection.

Parameters:
countThe number of items.
See also:
count()
void Akonadi::CollectionStatistics::setSize ( qint64  size)

Sets the total size of the items in this collection.

Parameters:
sizeThe total size of the items
See also:
size()
Since:
4.3
void Akonadi::CollectionStatistics::setUnreadCount ( qint64  count)

Sets the number of unread items in this collection.

Parameters:
countThe number of unread messages.
See also:
unreadCount()
qint64 Akonadi::CollectionStatistics::size ( ) const

Returns the total size of the items in this collection or -1 if this information is not available.

See also:
setSize()
Since:
4.3
qint64 Akonadi::CollectionStatistics::unreadCount ( ) const

Returns the number of unread items in this collection or -1 if this information is not available.

See also:
setUnreadCount()
count()

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

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • 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.6.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