Incidenceeditor

individualmailcomponentfactory.h
1/*
2 * SPDX-FileCopyrightText: 2014 Sandro Knauß <knauss@kolabsys.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
5 */
6
7#pragma once
8
9#include "incidenceeditor_export.h"
10
11#include <Akonadi/IncidenceChanger>
12#include <Akonadi/MessageQueueJob>
13#include <KIdentityManagementCore/Identity>
14namespace IncidenceEditorNG
15{
16class OpenComposerJob;
17class IndividualMailDialog;
18
19class IndividualMessageQueueJob : public Akonadi::MessageQueueJob
20{
22public:
23 explicit IndividualMessageQueueJob(const KIdentityManagementCore::Identity &identity,
27
28 void start() override;
29
30private:
31 void startQueueJob(const QStringList &messageTo, const QStringList &to, const QStringList &messageCc, const QStringList &cc);
32 void startComposerJob(const QStringList &to, const QStringList &cc);
33 void handleJobFinished(KJob *job);
37 Akonadi::MessageQueueJob *mQueueJob = nullptr;
38 OpenComposerJob *mComposerJob = nullptr;
39};
40
41class IndividualMailITIPHandlerDialogDelegate : public Akonadi::ITIPHandlerDialogDelegate
42{
44public:
45 explicit IndividualMailITIPHandlerDialogDelegate(const KCalendarCore::Incidence::Ptr &incidence, KCalendarCore::iTIPMethod method, QWidget *parent);
46
47 void openDialogIncidenceCreated(Recipient recipient,
48 const QString &question,
49 Action action = ActionAsk,
50 const KGuiItem &buttonYes = KGuiItem(i18nc("@action:button dialog positive answer", "Send Email")),
51 const KGuiItem &buttonNo = KGuiItem(i18nc("@action:button dialog negative answer", "Do Not Send"))) override;
52
53 void openDialogIncidenceModified(bool attendeeStatusChanged,
54 Recipient recipient,
55 const QString &question,
56 Action action = ActionAsk,
57 const KGuiItem &buttonYes = KGuiItem(i18nc("@action:button dialog positive answer", "Send Email")),
58 const KGuiItem &buttonNo = KGuiItem(i18nc("@action:button dialog negative answer", "Do Not Send"))) override;
59
60 void openDialogIncidenceDeleted(Recipient recipient,
61 const QString &question,
62 Action action = ActionAsk,
63 const KGuiItem &buttonYes = KGuiItem(i18nc("@action:button dialog positive answer", "Send Email")),
64 const KGuiItem &buttonNo = KGuiItem(i18nc("@action:button dialog negative answer", "Do Not Send"))) override;
65
67 void setEdit(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Attendee::List &edit);
68 void setUpdate(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Attendee::List &update);
69
70protected:
71 void
72 openDialog(const QString &question, const KCalendarCore::Attendee::List &attendees, Action action, const KGuiItem &buttonYes, const KGuiItem &buttonNo);
73
74private:
75 void onDialogClosed(int result);
76 IndividualMailDialog *mDialog = nullptr;
77};
78
79class INCIDENCEEDITOR_EXPORT IndividualMailComponentFactory : public Akonadi::ITIPHandlerComponentFactory
80{
81 Q_OBJECT
82public:
83 explicit IndividualMailComponentFactory(QObject *parent = nullptr);
85 createMessageQueueJob(const KCalendarCore::IncidenceBase::Ptr &incidence, const KIdentityManagementCore::Identity &identity, QObject *parent) override;
86
88 createITIPHanderDialogDelegate(const KCalendarCore::Incidence::Ptr &incidence, KCalendarCore::iTIPMethod method, QWidget *parent) override;
89
90public Q_SLOTS:
91 void onSetEdit(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Attendee::List &edit);
92 void onSetUpdate(const KCalendarCore::Incidence::Ptr &incidence, const KCalendarCore::Attendee::List &update);
93
94private:
97};
98}
QString i18nc(const char *context, const char *text, const TYPE &arg...)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.