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

akonadi

  • akonadi
collectionstatistics.cpp
1 /*
2  Copyright (c) 2006 Volker Krause <vkrause@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #include "collectionstatistics.h"
21 
22 #include <QtCore/QSharedData>
23 #include <QtCore/QDebug>
24 
25 using namespace Akonadi;
26 
30 class CollectionStatistics::Private : public QSharedData
31 {
32  public:
33  Private() :
34  QSharedData(),
35  count( -1 ),
36  unreadCount( -1 ),
37  size( -1 )
38  {}
39 
40  Private( const Private &other ) :
41  QSharedData( other )
42  {
43  count = other.count;
44  unreadCount = other.unreadCount;
45  size = other.size;
46  }
47 
48  qint64 count;
49  qint64 unreadCount;
50  qint64 size;
51 };
52 
53 
54 CollectionStatistics::CollectionStatistics() :
55  d( new Private )
56 {
57 }
58 
59 CollectionStatistics::CollectionStatistics(const CollectionStatistics &other) :
60  d( other.d )
61 {
62 }
63 
64 CollectionStatistics::~CollectionStatistics()
65 {
66 }
67 
68 qint64 CollectionStatistics::count( ) const
69 {
70  return d->count;
71 }
72 
73 void CollectionStatistics::setCount( qint64 count )
74 {
75  d->count = count;
76 }
77 
78 qint64 CollectionStatistics::unreadCount( ) const
79 {
80  return d->unreadCount;
81 }
82 
83 void CollectionStatistics::setUnreadCount( qint64 count )
84 {
85  d->unreadCount = count;
86 }
87 
88 qint64 CollectionStatistics::size( ) const
89 {
90  return d->size;
91 }
92 
93 void CollectionStatistics::setSize( qint64 size )
94 {
95  d->size = size;
96 }
97 
98 CollectionStatistics& CollectionStatistics::operator =(const CollectionStatistics & other)
99 {
100  d = other.d;
101  return *this;
102 }
103 
104 QDebug operator<<( QDebug d, const CollectionStatistics& s )
105 {
106  return d << "CollectionStatistics:" << endl
107  << " count:" << s.count() << endl
108  << " unread count:" << s.unreadCount() << endl
109  << " size:" << s.size();
110 }
Akonadi::CollectionStatistics::count
qint64 count() const
Returns the number of items in this collection or -1 if this information is not available.
Definition: collectionstatistics.cpp:68
Akonadi::CollectionStatistics
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
Akonadi::CollectionStatistics::CollectionStatistics
CollectionStatistics()
Creates a new collection statistics object.
Definition: collectionstatistics.cpp:54
Akonadi::CollectionStatistics::~CollectionStatistics
~CollectionStatistics()
Destroys the collection statistics object.
Definition: collectionstatistics.cpp:64
Akonadi::CollectionStatistics::setUnreadCount
void setUnreadCount(qint64 count)
Sets the number of unread items in this collection.
Definition: collectionstatistics.cpp:83
Akonadi::CollectionStatistics::setSize
void setSize(qint64 size)
Sets the total size of the items in this collection.
Definition: collectionstatistics.cpp:93
Akonadi::CollectionStatistics::setCount
void setCount(qint64 count)
Sets the number of items in this collection.
Definition: collectionstatistics.cpp:73
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:78
Akonadi::CollectionStatistics::size
qint64 size() const
Returns the total size of the items in this collection or -1 if this information is not available...
Definition: collectionstatistics.cpp:88
Akonadi::CollectionStatistics::operator=
CollectionStatistics & operator=(const CollectionStatistics &other)
Assigns other to this statistics object and returns a reference to this one.
Definition: collectionstatistics.cpp:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:16 by doxygen 1.8.5 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-4.11.3 API Reference

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