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

akonadi

  • sources
  • kde-4.14
  • 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 
30 #include <kcalcore/incidence.h>
31 #include <kcalcore/schedulemessage.h>
32 
33 #include <KGuiItem>
34 #include <KLocalizedString>
35 
36 #include <QObject>
37 
38 class QWidget;
39 
40 namespace Akonadi {
41 
42 enum Status {
43  StatusNone,
44  StatusSendingInvitation
45 };
46 
66 class ITIPHandlerHelper : public QObject
67 {
68  Q_OBJECT
69 public:
70  explicit ITIPHandlerHelper(QWidget *parent = 0); // TODO
71  ~ITIPHandlerHelper();
72 
73  enum SendResult {
74  ResultCanceled,
76  ResultFailKeepUpdate,
77  ResultFailAbortUpdate,
78  ResultNoSendingNeeded,
80  ResultError,
81  ResultSuccess
82  };
83 
84  enum Action {
85  ActionAsk,
86  ActionSendMessage,
87  ActionDontSendMessage
88  };
89 
99  void setDefaultAction(Action action);
100 
106  void setDialogParent(QWidget *parent);
107 
114  ITIPHandlerHelper::SendResult sendIncidenceCreatedMessage(KCalCore::iTIPMethod method,
115  const KCalCore::Incidence::Ptr &incidence);
116 
127  bool handleIncidenceAboutToBeModified(const KCalCore::Incidence::Ptr &incidence);
128 
134  ITIPHandlerHelper::SendResult sendIncidenceModifiedMessage(KCalCore::iTIPMethod method,
135  const KCalCore::Incidence::Ptr &incidence,
136  bool attendeeStatusChanged);
137 
142  ITIPHandlerHelper::SendResult sendIncidenceDeletedMessage(KCalCore::iTIPMethod method,
143  const KCalCore::Incidence::Ptr &incidence);
144 
150  ITIPHandlerHelper::SendResult sendCounterProposal(const KCalCore::Incidence::Ptr &oldIncidence,
151  const KCalCore::Incidence::Ptr &newIncidence);
152 
153  // Frees calendar if it doesn't have jobs running
154  void calendarJobFinished(bool success, const QString &errorString);
155 
156 Q_SIGNALS:
157  void finished(Akonadi::ITIPHandlerHelper::SendResult result,
158  const QString &errorMessage);
159 
160 private Q_SLOTS:
161  void onSchedulerFinished(Akonadi::Scheduler::Result result, const QString &errorMsg);
162 
163 private:
164  ITIPHandlerHelper::SendResult sentInvitation(int messageBoxReturnCode,
165  const KCalCore::Incidence::Ptr &incidence,
166  KCalCore::iTIPMethod method);
167 
168  int askUserIfNeeded(const QString &question,
169  bool ignoreDefaultAction = true,
170  const KGuiItem &buttonYes = KGuiItem(i18n("Send Email")),
171  const KGuiItem &buttonNo = KGuiItem(i18n("Do Not Send"))) const;
172 
178  bool weAreOrganizerOf(const KCalCore::Incidence::Ptr &incidence);
179 
185  bool weNeedToSendMailFor(const KCalCore::Incidence::Ptr &incidence);
186 
187  ITIPHandlerHelper::Action mDefaultAction;
188  QWidget *mParent;
189  MailScheduler *m_scheduler;
190  Status m_status;
191 };
192 
193 }
194 
195 #endif
Akonadi::ITIPHandlerHelper::ResultFailKeepUpdate
Sending failed, the changes to the incidence must be kept.
Definition: itiphandlerhelper_p.h:76
QWidget
Akonadi::ITIPHandlerHelper::ResultFailAbortUpdate
Sending failed, the changes to the incidence must be undone.
Definition: itiphandlerhelper_p.h:77
Akonadi::ITIPHandlerHelper::ResultError
An unexpected error occurred.
Definition: itiphandlerhelper_p.h:80
Akonadi::ITIPHandlerHelper::ResultNoSendingNeeded
In some cases it is not needed to send an invitation (e.g.
Definition: itiphandlerhelper_p.h:78
Akonadi::ITIPHandlerHelper::sendIncidenceModifiedMessage
ITIPHandlerHelper::SendResult sendIncidenceModifiedMessage(KCalCore::iTIPMethod method, const KCalCore::Incidence::Ptr &incidence, bool attendeeStatusChanged)
Handles sending of invitations for modified incidences.
QObject
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:81
QString
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:66
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:74
Akonadi::ITIPHandlerHelper::SendResult
SendResult
Definition: itiphandlerhelper_p.h:73
Akonadi::ITIPHandlerHelper::sendCounterProposal
ITIPHandlerHelper::SendResult sendCounterProposal(const KCalCore::Incidence::Ptr &oldIncidence, const KCalCore::Incidence::Ptr &newIncidence)
Send counter proposal message.
QObject::parent
QObject * parent() const
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 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
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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