• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 class KJob;
35 
36 namespace Akonadi {
37 
38 class FreeBusyManager;
39 
40 class FreeBusyManagerPrivate : public QObject
41 {
42  Q_OBJECT
43 
44  FreeBusyManager *const q_ptr;
45  Q_DECLARE_PUBLIC( FreeBusyManager )
46 
47 public:
48  struct FreeBusyProviderRequest
49  {
50  FreeBusyProviderRequest( const QString &provider );
51 
52  enum Status {
53  NotStarted,
54  HandlingRequested,
55  FreeBusyRequested
56  };
57 
58  Status mRequestStatus;
59  QSharedPointer<QDBusInterface> mInterface;
60  };
61 
62  struct FreeBusyProvidersRequestsQueue
63  {
64  explicit FreeBusyProvidersRequestsQueue( const QString &start = QString(),
65  const QString &end = QString() );
66 
67  FreeBusyProvidersRequestsQueue( const KDateTime &start, const KDateTime &end );
68 
69  QString mStartTime;
70  QString mEndTime;
71  QList<FreeBusyProviderRequest> mRequests;
72  int mHandlersCount;
73  KCalCore::FreeBusy::Ptr mResultingFreeBusy;
74  };
75 
76 public:
77  Akonadi::ETMCalendar::Ptr mCalendar;
78  KCalCore::ICalFormat mFormat;
79 
80  QStringList mRetrieveQueue;
81  QMap<KUrl, QString> mFreeBusyUrlEmailMap;
82  QMap<QString, FreeBusyProvidersRequestsQueue> mProvidersRequestsByEmail;
83 
84  // Free/Busy uploading
85  QDateTime mNextUploadTime;
86  int mTimerID;
87  bool mUploadingFreeBusy;
88  bool mBrokenUrl;
89 
90  QPointer<QWidget > mParentWidgetForMailling;
91 
92  // the parentWidget to use while doing our "recursive" retrieval
93  QPointer<QWidget> mParentWidgetForRetrieval;
94 
95 public:
96  FreeBusyManagerPrivate( FreeBusyManager *q );
97  void checkFreeBusyUrl();
98  QString freeBusyDir() const;
99  void fetchFreeBusyUrl( const QString &email );
100  QString freeBusyToIcal( const KCalCore::FreeBusy::Ptr & );
101  KCalCore::FreeBusy::Ptr iCalToFreeBusy( const QByteArray &freeBusyData );
102  KCalCore::FreeBusy::Ptr ownerFreeBusy();
103  QString ownerFreeBusyAsString();
104  void processFreeBusyDownloadResult( KJob *_job );
105  void processFreeBusyUploadResult( KJob *_job );
106  void uploadFreeBusy();
107  QStringList getFreeBusyProviders() const;
108  void queryFreeBusyProviders( const QStringList &providers, const QString &email );
109  void queryFreeBusyProviders( const QStringList &providers, const QString &email,
110  const KDateTime &start, const KDateTime &end );
111 
112 public slots:
113  void processRetrieveQueue();
114  void contactSearchJobFinished( KJob *_job );
115  void finishProcessRetrieveQueue( const QString &email, const KUrl &url );
116  void onHandlesFreeBusy( const QString &email, bool handles );
117  void onFreeBusyRetrieved( const QString &email, const QString &freeBusy,
118  bool success, const QString &errorText );
119  void processMailSchedulerResult( Akonadi::Scheduler::Result result, const QString &errorMsg );
120 
121 signals:
122  void freeBusyUrlRetrieved( const QString &email, const KUrl &url );
123 };
124 
125 }
126 
127 #endif // FREEBUSYMANAGER_P_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:37 by doxygen 1.8.3.1 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-4.10.5 API Reference

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