Akonadi

core/collectionstatistics.cpp
1 /*
2  Copyright (c) 2006 Volker Krause <[email protected]>
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 <QSharedData>
23 #include <QDebug>
24 
25 using namespace Akonadi;
26 
30 class Q_DECL_HIDDEN CollectionStatistics::Private : public QSharedData
31 {
32 public:
33  Private()
34  : QSharedData()
35  {
36  }
37 
38  Private(const Private &other)
39  : QSharedData(other)
40  {
41  count = other.count;
42  unreadCount = other.unreadCount;
43  size = other.size;
44  }
45 
46  qint64 count = -1;
47  qint64 unreadCount = -1;
48  qint64 size = -1;
49 };
50 
52  : d(new Private)
53 {
54 }
55 
57  : d(other.d)
58 {
59 }
60 
62 {
63 }
64 
66 {
67  return d->count;
68 }
69 
71 {
72  d->count = count;
73 }
74 
76 {
77  return d->unreadCount;
78 }
79 
81 {
82  d->unreadCount = count;
83 }
84 
86 {
87  return d->size;
88 }
89 
91 {
92  d->size = size;
93 }
94 
96 {
97  d = other.d;
98  return *this;
99 }
100 
102 {
103  return d << "CollectionStatistics:\n"
104  << " count:" << s.count() << '\n'
105  << " unread count:" << s.unreadCount() << '\n'
106  << " size:" << s.size();
107 }
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
qint64 count() const
Returns the number of items in this collection or -1 if this information is not available.
Provides statistics information of a Collection.
CollectionStatistics()
Creates a new collection statistics object.
~CollectionStatistics()
Destroys the collection statistics object.
void setUnreadCount(qint64 count)
Sets the number of unread items in this collection.
void setSize(qint64 size)
Sets the total size of the items in this collection.
void setCount(qint64 count)
Sets the number of items in this collection.
Helper integration between Akonadi and Qt.
qint64 unreadCount() const
Returns the number of unread items in this collection or -1 if this information is not available...
qint64 size() const
Returns the total size of the items in this collection or -1 if this information is not available...
CollectionStatistics & operator=(const CollectionStatistics &other)
Assigns other to this statistics object and returns a reference to this one.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed May 27 2020 22:43:37 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.