Akonadi

core/collectionstatistics.cpp
1/*
2 SPDX-FileCopyrightText: 2006 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "collectionstatistics.h"
8
9#include <QDebug>
10#include <QSharedData>
11
12using namespace Akonadi;
13
14/**
15 * @internal
16 */
17class Akonadi::CollectionStatisticsPrivate : public QSharedData
18{
19public:
20 qint64 count = -1;
21 qint64 unreadCount = -1;
22 qint64 size = -1;
23};
24
26 : d(new CollectionStatisticsPrivate)
27{
28}
29
34
36
38{
39 return d->count;
40}
41
43{
44 d->count = count;
45}
46
48{
49 return d->unreadCount;
50}
51
53{
54 d->unreadCount = count;
55}
56
58{
59 return d->size;
60}
61
63{
64 d->size = size;
65}
66
68{
69 d = other.d;
70 return *this;
71}
72
73QDebug operator<<(QDebug d, const CollectionStatistics &s)
74{
75 return d << "CollectionStatistics:\n"
76 << " count:" << s.count() << '\n'
77 << " unread count:" << s.unreadCount() << '\n'
78 << " size:" << s.size();
79}
Provides statistics information of a Collection.
qint64 unreadCount() const
Returns the number of unread items in this collection or -1 if this information is not available.
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.
~CollectionStatistics()
Destroys the collection statistics object.
void setCount(qint64 count)
Sets the number of items in this collection.
qint64 count() const
Returns the number of items in this collection or -1 if this information is not available.
CollectionStatistics()
Creates a new collection statistics object.
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.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.