7#include "job/itipjob.h"
9#include "contentjobbase_p.h"
10#include "job/multipartjob.h"
11#include "job/singlepartjob.h"
12#include "part/itippart.h"
14#include <KLocalizedString>
17#include <KMime/Content>
21class MessageComposer::ItipJobPrivate :
public ContentJobBasePrivate
25 : ContentJobBasePrivate(qq)
43 job->contentType()->setCharset(
"utf-8");
44 job->contentType()->setParameter(QByteArrayLiteral(
"method"), itipPart->method());
45 job->contentTransferEncoding()->setEncoding(KMime::Headers::CEquPr);
46 job->contentDisposition()->setDisposition(KMime::Headers::CDinline);
47 job->setData(KMime::CRLFtoLF(itipPart->invitationBody().
toUtf8()));
55 job->contentType()->setCharset(
"utf-8");
56 job->contentType()->setName(QStringLiteral(
"cal.ics"));
57 job->contentType()->setParameter(QByteArrayLiteral(
"method"), itipPart->method());
58 job->contentDisposition()->setDisposition(KMime::Headers::CDattachment);
59 job->contentTransferEncoding()->setEncoding(KMime::Headers::CEquPr);
60 job->setData(KMime::CRLFtoLF(itipPart->invitation().
toUtf8()));
66 auto bodyJob = createInvitationBodyJob();
67 if (itipPart->invitation().
isEmpty()) {
72 mpJob->setMultipartSubtype(
"mixed");
73 mpJob->appendSubjob(bodyJob);
74 mpJob->appendSubjob(createInvitationJob());
82 job->contentType()->setName(QStringLiteral(
"cal.ics"));
83 job->contentType()->setParameter(QByteArrayLiteral(
"method"), QStringLiteral(
"request"));
84 job->contentType()->setCharset(
"utf-8");
86 if (!itipPart->invitation().
isEmpty()) {
87 job->contentDisposition()->setDisposition(KMime::Headers::CDinline);
88 job->contentTransferEncoding()->setEncoding(KMime::Headers::CEquPr);
89 job->setData(KMime::CRLFtoLF(itipPart->invitation().
toUtf8()));
99 d->itipPart = itipPart;
102ItipJob::~ItipJob() =
default;
110void ItipJob::setItipPart(
ItipPart *part)
116void ItipJob::doStart()
119 Q_ASSERT(d->itipPart);
121 if (d->itipPart->outlookConformInvitation()) {
130void ItipJob::process()
134 Q_ASSERT(d->subjobContents.count() == 1);
135 d->resultContent = d->subjobContents.constFirst();
139#include "moc_itipjob.cpp"
The ContentJobBase class.
virtual void doStart()
Reimplement to do additional stuff before processing children, such as adding more subjobs.
bool appendSubjob(ContentJobBase *job)
This is meant to be used instead of KCompositeJob::addSubjob(), making it possible to add subjobs fro...
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
bool isEmpty() const const
QByteArray toUtf8() const const