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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 CollectionStatistics::CollectionStatistics() :
54  d( new Private )
55 {
56 }
57 
58 CollectionStatistics::CollectionStatistics(const CollectionStatistics &other) :
59  d( other.d )
60 {
61 }
62 
63 CollectionStatistics::~CollectionStatistics()
64 {
65 }
66 
67 qint64 CollectionStatistics::count( ) const
68 {
69  return d->count;
70 }
71 
72 void CollectionStatistics::setCount( qint64 count )
73 {
74  d->count = count;
75 }
76 
77 qint64 CollectionStatistics::unreadCount( ) const
78 {
79  return d->unreadCount;
80 }
81 
82 void CollectionStatistics::setUnreadCount( qint64 count )
83 {
84  d->unreadCount = count;
85 }
86 
87 qint64 CollectionStatistics::size( ) const
88 {
89  return d->size;
90 }
91 
92 void CollectionStatistics::setSize( qint64 size )
93 {
94  d->size = size;
95 }
96 
97 CollectionStatistics& CollectionStatistics::operator =(const CollectionStatistics & other)
98 {
99  d = other.d;
100  return *this;
101 }
102 
103 QDebug operator<<( QDebug d, const CollectionStatistics& s )
104 {
105  return d << "CollectionStatistics:" << endl
106  << " count:" << s.count() << endl
107  << " unread count:" << s.unreadCount() << endl
108  << " size:" << s.size();
109 }
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:67
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:53
Akonadi::CollectionStatistics::~CollectionStatistics
~CollectionStatistics()
Destroys the collection statistics object.
Definition: collectionstatistics.cpp:63
Akonadi::CollectionStatistics::setUnreadCount
void setUnreadCount(qint64 count)
Sets the number of unread items in this collection.
Definition: collectionstatistics.cpp:82
Akonadi::CollectionStatistics::setSize
void setSize(qint64 size)
Sets the total size of the items in this collection.
Definition: collectionstatistics.cpp:92
Akonadi::CollectionStatistics::setCount
void setCount(qint64 count)
Sets the number of items in this collection.
Definition: collectionstatistics.cpp:72
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::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:87
Akonadi::CollectionStatistics::operator=
CollectionStatistics & operator=(const CollectionStatistics &other)
Assigns other to this statistics object and returns a reference to this one.
Definition: collectionstatistics.cpp:97
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:26 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
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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