CalendarSupport

freebusyitem.cpp
1/*
2 SPDX-FileCopyrightText: 2000, 2001, 2004 Cornelius Schumacher <schumacher@kde.org>
3 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
4 SPDX-FileCopyrightText: 2010 Andras Mantia <andras@kdab.com>
5 SPDX-FileCopyrightText: 2010 Casey Link <casey@kdab.com>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#include "freebusyitem.h"
11
12#include <Akonadi/FreeBusyManager>
13
14using namespace CalendarSupport;
15
17 : mAttendee(attendee)
18 , mParentWidget(parentWidget)
19{
20 Q_ASSERT(!attendee.isNull());
21 setFreeBusy(KCalendarCore::FreeBusy::Ptr());
22}
23
24KCalendarCore::Attendee FreeBusyItem::attendee() const
25{
26 return mAttendee;
27}
28
29void FreeBusyItem::setFreeBusy(const KCalendarCore::FreeBusy::Ptr &fb)
30{
31 mFreeBusy = fb;
32 mIsDownloading = false;
33}
34
35KCalendarCore::FreeBusy::Ptr FreeBusyItem::freeBusy() const
36{
37 return mFreeBusy;
38}
39
40QString FreeBusyItem::email() const
41{
42 return mAttendee.email();
43}
44
45void FreeBusyItem::setUpdateTimerID(int id)
46{
47 mTimerID = id;
48}
49
50int FreeBusyItem::updateTimerID() const
51{
52 return mTimerID;
53}
54
55void FreeBusyItem::startDownload(bool forceDownload)
56{
57 mIsDownloading = true;
58 Akonadi::FreeBusyManager *m = Akonadi::FreeBusyManager::self();
59 if (!m->retrieveFreeBusy(attendee().email(), forceDownload, mParentWidget)) {
60 mIsDownloading = false;
61 }
62}
63
64void FreeBusyItem::setIsDownloading(bool d)
65{
66 mIsDownloading = d;
67}
68
69bool FreeBusyItem::isDownloading() const
70{
71 return mIsDownloading;
72}
FreeBusyItem(const KCalendarCore::Attendee &attendee, QWidget *parentWidget)
QString email() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:32 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.