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

akonadi

  • akonadi
  • calendar
freebusymanager_p.h
1/*
2 Copyright (c) 2002-2004 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
3 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#ifndef AKONADI_FREEBUSYMANAGER_P_H
22#define AKONADI_FREEBUSYMANAGER_P_H
23
24#include "etmcalendar.h"
25#include "mailscheduler_p.h"
26
27#include <kcalcore/freebusy.h>
28#include <kcalcore/icalformat.h>
29
30#include <QtCore/QPointer>
31#include <QtDBus/QDBusContext>
32#include <QtDBus/QDBusInterface>
33
34#include <KJob>
35#include <KUrl>
36
37namespace KIO {
38class Job;
39}
40
41namespace Akonadi {
42
43class FreeBusyManager;
44
45class FreeBusyManagerPrivate : public QObject
46{
47 Q_OBJECT
48
49 FreeBusyManager *const q_ptr;
50 Q_DECLARE_PUBLIC(FreeBusyManager)
51
52public:
53 struct FreeBusyProviderRequest
54 {
55 FreeBusyProviderRequest(const QString &provider);
56
57 enum Status {
58 NotStarted,
59 HandlingRequested,
60 FreeBusyRequested
61 };
62
63 Status mRequestStatus;
64 QSharedPointer<QDBusInterface> mInterface;
65 };
66
67 struct FreeBusyProvidersRequestsQueue
68 {
69 explicit FreeBusyProvidersRequestsQueue(const QString &start = QString(),
70 const QString &end = QString());
71
72 FreeBusyProvidersRequestsQueue(const KDateTime &start, const KDateTime &end);
73
74 QString mStartTime;
75 QString mEndTime;
76 QList<FreeBusyProviderRequest> mRequests;
77 int mHandlersCount;
78 KCalCore::FreeBusy::Ptr mResultingFreeBusy;
79 };
80
81public:
82 Akonadi::ETMCalendar::Ptr mCalendar;
83 KCalCore::ICalFormat mFormat;
84
85 QStringList mRetrieveQueue;
86 QMap<KUrl, QString> mFreeBusyUrlEmailMap;
87 QMap<QString, FreeBusyProvidersRequestsQueue> mProvidersRequestsByEmail;
88
89 // Free/Busy uploading
90 QDateTime mNextUploadTime;
91 int mTimerID;
92 bool mUploadingFreeBusy;
93 bool mBrokenUrl;
94
95 QPointer<QWidget > mParentWidgetForMailling;
96
97 // the parentWidget to use while doing our "recursive" retrieval
98 QPointer<QWidget> mParentWidgetForRetrieval;
99
100public:
101 FreeBusyManagerPrivate(FreeBusyManager *q);
102 void checkFreeBusyUrl();
103 QString freeBusyDir() const;
104 void fetchFreeBusyUrl(const QString &email);
105 QString freeBusyToIcal(const KCalCore::FreeBusy::Ptr &);
106 KCalCore::FreeBusy::Ptr iCalToFreeBusy(const QByteArray &freeBusyData);
107 KCalCore::FreeBusy::Ptr ownerFreeBusy();
108 QString ownerFreeBusyAsString();
109 void processFreeBusyDownloadResult(KJob *_job);
110 void processFreeBusyUploadResult(KJob *_job);
111 void uploadFreeBusy();
112 QStringList getFreeBusyProviders() const;
113 void queryFreeBusyProviders(const QStringList &providers, const QString &email);
114 void queryFreeBusyProviders(const QStringList &providers, const QString &email,
115 const KDateTime &start, const KDateTime &end);
116
117public Q_SLOTS:
118 void processRetrieveQueue();
119 void contactSearchJobFinished(KJob *_job);
120 void finishProcessRetrieveQueue(const QString &email, const KUrl &url);
121 void onHandlesFreeBusy(const QString &email, bool handles);
122 void onFreeBusyRetrieved(const QString &email, const QString &freeBusy,
123 bool success, const QString &errorText);
124 void processMailSchedulerResult(Akonadi::Scheduler::Result result, const QString &errorMsg);
125 void fbCheckerJobFinished(KJob*);
126
127Q_SIGNALS:
128 void freeBusyUrlRetrieved(const QString &email, const KUrl &url);
129};
130
131class FbCheckerJob : public KJob
132{
133 Q_OBJECT
134public:
135 explicit FbCheckerJob(const QList<KUrl> &urlsToCheck, QObject *parent = 0);
136 virtual void start();
137
138 KUrl validUrl() const;
139
140private Q_SLOTS:
141 void onGetJobFinished(KJob *job);
142 void dataReceived(KIO::Job *, const QByteArray &data);
143
144private:
145 void checkNextUrl();
146 QList<KUrl> mUrlsToCheck;
147 QByteArray mData;
148 KUrl mValidUrl;
149};
150
151}
152
153#endif // FREEBUSYMANAGER_P_H
Akonadi
FreeBusyManager::Singleton.
Definition actionstatemanager_p.h:28
Akonadi::FreeBusyManagerPrivate::FreeBusyProviderRequest
Structs.
Definition freebusymanager_p.h:54
Akonadi::FreeBusyManagerPrivate::FreeBusyProviderRequest::FreeBusyProviderRequest
FreeBusyProviderRequest(const QString &provider)
FreeBusyManagerPrivate::FreeBusyProviderRequest.
Definition freebusymanager.cpp:136
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 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
  • Related Pages

kdepimlibs-4.14.10 API Reference

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