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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • akonadi
  • calendar
itiphandlerhelper_p.h
1 /*
2  Copyright (c) 2002-2004 Klarälvdalens Datakonsult AB
3  <info@klaralvdalens-datakonsult.se>
4 
5  Copyright (C) 2010 Bertjan Broeksema <broeksema@kde.org>
6  Copyright (C) 2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
7 
8  This library is free software; you can redistribute it and/or modify it
9  under the terms of the GNU Library General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or (at your
11  option) any later version.
12 
13  This library is distributed in the hope that it will be useful, but WITHOUT
14  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
16  License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to the
20  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  02110-1301, USA.
22 */
23 
24 #ifndef AKONADI_CALENDAR_ITIP_HANDLERHELPER_P_H
25 #define AKONADI_CALENDAR_ITIP_HANDLERHELPER_P_H
26 
27 #include "itiphandler.h"
28 #include "mailscheduler_p.h"
29 #include "etmcalendar.h"
30 
31 #include <kcalcore/incidence.h>
32 #include <kcalcore/schedulemessage.h>
33 
34 #include <KGuiItem>
35 #include <KLocalizedString>
36 
37 #include <QObject>
38 
39 class QWidget;
40 
41 namespace Akonadi {
42 
43 enum Status {
44  StatusNone,
45  StatusSendingInvitation
46 };
47 
67 class ITIPHandlerHelper : public QObject
68 {
69  Q_OBJECT
70 public:
71  explicit ITIPHandlerHelper(QWidget *parent = 0); // TODO
72  ~ITIPHandlerHelper();
73 
74  enum SendResult {
75  ResultCanceled,
77  ResultFailKeepUpdate,
78  ResultFailAbortUpdate,
79  ResultNoSendingNeeded,
81  ResultError,
82  ResultSuccess
83  };
84 
85  enum Action {
86  ActionAsk,
87  ActionSendMessage,
88  ActionDontSendMessage
89  };
90 
100  void setDefaultAction(Action action);
101 
107  void setDialogParent(QWidget *parent);
108 
115  ITIPHandlerHelper::SendResult sendIncidenceCreatedMessage(KCalCore::iTIPMethod method,
116  const KCalCore::Incidence::Ptr &incidence);
117 
128  bool handleIncidenceAboutToBeModified(const KCalCore::Incidence::Ptr &incidence);
129 
135  ITIPHandlerHelper::SendResult sendIncidenceModifiedMessage(KCalCore::iTIPMethod method,
136  const KCalCore::Incidence::Ptr &incidence,
137  bool attendeeStatusChanged);
138 
143  ITIPHandlerHelper::SendResult sendIncidenceDeletedMessage(KCalCore::iTIPMethod method,
144  const KCalCore::Incidence::Ptr &incidence);
145 
151  ITIPHandlerHelper::SendResult sendCounterProposal(const KCalCore::Incidence::Ptr &oldIncidence,
152  const KCalCore::Incidence::Ptr &newIncidence);
153 
154  // Frees calendar if it doesn't have jobs running
155  void calendarJobFinished(bool success, const QString &errorString);
156 
157 Q_SIGNALS:
158  void finished(Akonadi::ITIPHandlerHelper::SendResult result,
159  const QString &errorMessage);
160 
161 private Q_SLOTS:
162  void onSchedulerFinished(Akonadi::Scheduler::Result result, const QString &errorMsg);
163 
164 private:
165  ITIPHandlerHelper::SendResult sentInvitation(int messageBoxReturnCode,
166  const KCalCore::Incidence::Ptr &incidence,
167  KCalCore::iTIPMethod method);
168 
169  int askUserIfNeeded(const QString &question,
170  bool ignoreDefaultAction = true,
171  const KGuiItem &buttonYes = KGuiItem(i18n("Send Email")),
172  const KGuiItem &buttonNo = KGuiItem(i18n("Do Not Send"))) const;
173 
179  bool weAreOrganizerOf(const KCalCore::Incidence::Ptr &incidence);
180 
186  bool weNeedToSendMailFor(const KCalCore::Incidence::Ptr &incidence);
187 
188  ITIPHandlerHelper::Action mDefaultAction;
189  QWidget *mParent;
190  MailScheduler *m_scheduler;
191  Status m_status;
192 };
193 
194 }
195 
196 #endif
Akonadi::ITIPHandlerHelper::ResultFailKeepUpdate
Sending failed, the changes to the incidence must be kept.
Definition: itiphandlerhelper_p.h:77
Akonadi::ITIPHandlerHelper::ResultFailAbortUpdate
Sending failed, the changes to the incidence must be undone.
Definition: itiphandlerhelper_p.h:78
Akonadi::ITIPHandlerHelper::ResultError
An unexpected error occurred.
Definition: itiphandlerhelper_p.h:81
Akonadi::ITIPHandlerHelper::ResultNoSendingNeeded
In some cases it is not needed to send an invitation (e.g.
Definition: itiphandlerhelper_p.h:79
Akonadi::ITIPHandlerHelper::sendIncidenceModifiedMessage
ITIPHandlerHelper::SendResult sendIncidenceModifiedMessage(KCalCore::iTIPMethod method, const KCalCore::Incidence::Ptr &incidence, bool attendeeStatusChanged)
Handles sending of invitations for modified incidences.
Akonadi::ITIPHandlerHelper::sendIncidenceDeletedMessage
ITIPHandlerHelper::SendResult sendIncidenceDeletedMessage(KCalCore::iTIPMethod method, const KCalCore::Incidence::Ptr &incidence)
Handles sending of ivitations for deleted incidences.
Akonadi::ITIPHandlerHelper::ResultSuccess
The invitation was sent to all attendees.
Definition: itiphandlerhelper_p.h:82
Akonadi::ITIPHandlerHelper::handleIncidenceAboutToBeModified
bool handleIncidenceAboutToBeModified(const KCalCore::Incidence::Ptr &incidence)
Checks if the incidence should really be modified.
Akonadi::ITIPHandlerHelper
This class handles sending of invitations to attendees when Incidences (e.g.
Definition: itiphandlerhelper_p.h:67
Akonadi::ITIPHandlerHelper::sendIncidenceCreatedMessage
ITIPHandlerHelper::SendResult sendIncidenceCreatedMessage(KCalCore::iTIPMethod method, const KCalCore::Incidence::Ptr &incidence)
Handles sending of invitations for newly created incidences.
Akonadi::ITIPHandlerHelper::setDefaultAction
void setDefaultAction(Action action)
When an Incidence is created/modified/deleted the user can choose to send an ICal message to the othe...
Akonadi::ITIPHandlerHelper::ResultCanceled
Sending was canceled by the user, meaning there are local changes of which other attendees are not aw...
Definition: itiphandlerhelper_p.h:75
Akonadi::ITIPHandlerHelper::SendResult
SendResult
Definition: itiphandlerhelper_p.h:74
Akonadi::ITIPHandlerHelper::sendCounterProposal
ITIPHandlerHelper::SendResult sendCounterProposal(const KCalCore::Incidence::Ptr &oldIncidence, const KCalCore::Incidence::Ptr &newIncidence)
Send counter proposal message.
Akonadi::ITIPHandlerHelper::setDialogParent
void setDialogParent(QWidget *parent)
Before an invitation is sent the user is asked for confirmation by means of an dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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