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

akonadi

  • Akonadi
  • CollectionStatistics
Public Member Functions | List of all members
Akonadi::CollectionStatistics Class Reference

#include <collectionstatistics.h>

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.

This information might be expensive to obtain and is thus not included when fetching collections with a CollectionFetchJob. It can be retrieved separately 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();
}
Akonadi::CollectionStatisticsJob
Job that fetches collection statistics from the Akonadi storage.
Definition collectionstatisticsjob.h:67
Akonadi::CollectionStatisticsJob::statistics
CollectionStatistics statistics() const
Returns the fetched collection statistics.
Definition collectionstatisticsjob.cpp:105
Akonadi::CollectionStatistics
Provides statistics information of a Collection.
Definition collectionstatistics.h:70
Akonadi::CollectionStatistics::unreadCount
qint64 unreadCount() const
Returns the number of unread items in this collection or -1 if this information is not available.
Definition collectionstatistics.cpp:77
Akonadi::Collection
Represents a collection of PIM items.
Definition collection.h:76

This class is implicitly shared.

Author
Volker Krause vkrau.nosp@m.se@k.nosp@m.de.or.nosp@m.g

Definition at line 69 of file collectionstatistics.h.

Constructor & Destructor Documentation

◆ CollectionStatistics() [1/2]

CollectionStatistics::CollectionStatistics ( )

Creates a new collection statistics object.

Definition at line 53 of file collectionstatistics.cpp.

◆ CollectionStatistics() [2/2]

CollectionStatistics::CollectionStatistics ( const CollectionStatistics & other)

Creates a collection statistics object from an other one.

Definition at line 58 of file collectionstatistics.cpp.

◆ ~CollectionStatistics()

CollectionStatistics::~CollectionStatistics ( )

Destroys the collection statistics object.

Definition at line 63 of file collectionstatistics.cpp.

Member Function Documentation

◆ count()

qint64 CollectionStatistics::count ( ) const

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

See also
setCount()
unreadCount()

Definition at line 67 of file collectionstatistics.cpp.

◆ operator=()

CollectionStatistics & CollectionStatistics::operator= ( const CollectionStatistics & other)

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

Definition at line 97 of file collectionstatistics.cpp.

◆ setCount()

void CollectionStatistics::setCount ( qint64 count)

Sets the number of items in this collection.

Parameters
countThe number of items.
See also
count()

Definition at line 72 of file collectionstatistics.cpp.

◆ setSize()

void 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

Definition at line 92 of file collectionstatistics.cpp.

◆ setUnreadCount()

void CollectionStatistics::setUnreadCount ( qint64 count)

Sets the number of unread items in this collection.

Parameters
countThe number of unread messages.
See also
unreadCount()

Definition at line 82 of file collectionstatistics.cpp.

◆ size()

qint64 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

Definition at line 87 of file collectionstatistics.cpp.

◆ unreadCount()

qint64 CollectionStatistics::unreadCount ( ) const

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

See also
setUnreadCount()
count()

Definition at line 77 of file collectionstatistics.cpp.


The documentation for this class was generated from the following files:
  • collectionstatistics.h
  • collectionstatistics.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 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
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 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
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