diff --git a/src/MSA/AbstractMSA.cpp b/src/MSA/AbstractMSA.cpp index 76e8e016..78c366ea 100644 --- a/src/MSA/AbstractMSA.cpp +++ b/src/MSA/AbstractMSA.cpp @@ -1,81 +1,81 @@ /* Copyright (C) 2006 - 2014 Jan Kundrát This file is part of the Trojita Qt IMAP e-mail client, http://trojita.flaska.net/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "AbstractMSA.h" /** @short Implementations of the Mail Submission Agent interface */ namespace MSA { AbstractMSA::AbstractMSA(QObject *parent): QObject(parent) { } AbstractMSA::~AbstractMSA() { } bool AbstractMSA::supportsBurl() const { return false; } bool AbstractMSA::supportsImapSending() const { return false; } void AbstractMSA::sendMail(const QByteArray &from, const QList &to, const QByteArray &data) { Q_UNUSED(from); Q_UNUSED(to); Q_UNUSED(data); emit error(tr("Sending mail plaintext is not supported by %1").arg(QString::fromUtf8(metaObject()->className()))); } void AbstractMSA::sendBurl(const QByteArray &from, const QList &to, const QByteArray &imapUrl) { Q_UNUSED(from); Q_UNUSED(to); Q_UNUSED(imapUrl); emit error(tr("BURL is not supported by %1").arg(QString::fromUtf8(metaObject()->className()))); } -void AbstractMSA::sendImap(const QString &mailbox, const int uidValidity, const int uid, const Imap::Mailbox::UidSubmitOptionsList options) +void AbstractMSA::sendImap(const QString &mailbox, const uint uidValidity, const uint uid, const Imap::Mailbox::UidSubmitOptionsList options) { Q_UNUSED(mailbox); Q_UNUSED(uidValidity); Q_UNUSED(uid); Q_UNUSED(options); emit error(tr("IMAP sending is not supported by %1").arg(QString::fromUtf8(metaObject()->className()))); } void AbstractMSA::setPassword(const QString &password) { Q_UNUSED(password); emit error(tr("Setting password is not supported by %1").arg(QString::fromUtf8(metaObject()->className()))); } MSAFactory::~MSAFactory() { } } diff --git a/src/MSA/AbstractMSA.h b/src/MSA/AbstractMSA.h index 99df6c4e..86e3329f 100644 --- a/src/MSA/AbstractMSA.h +++ b/src/MSA/AbstractMSA.h @@ -1,66 +1,66 @@ /* Copyright (C) 2006 - 2014 Jan Kundrát This file is part of the Trojita Qt IMAP e-mail client, http://trojita.flaska.net/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef ABSTRACTMSA_H #define ABSTRACTMSA_H #include #include #include "Imap/Model/UidSubmitData.h" namespace MSA { class AbstractMSA : public QObject { Q_OBJECT public: explicit AbstractMSA(QObject *parent); virtual ~AbstractMSA(); virtual bool supportsBurl() const; virtual bool supportsImapSending() const; virtual void sendMail(const QByteArray &from, const QList &to, const QByteArray &data); virtual void sendBurl(const QByteArray &from, const QList &to, const QByteArray &imapUrl); - virtual void sendImap(const QString &mailbox, const int uidValidity, const int uid, + virtual void sendImap(const QString &mailbox, const uint uidValidity, const uint uid, const Imap::Mailbox::UidSubmitOptionsList options); public slots: virtual void cancel() = 0; virtual void setPassword(const QString &password); signals: void connecting(); void passwordRequested(const QString &user, const QString &host); void sending(); void sent(); void error(const QString &message); void progressMax(int max); void progress(int num); }; /** @short Factory producing AbstractMSA instances */ class MSAFactory { public: virtual ~MSAFactory(); virtual AbstractMSA *create(QObject *parent) const = 0; }; } #endif // ABSTRACTMSA_H diff --git a/src/MSA/ImapSubmit.cpp b/src/MSA/ImapSubmit.cpp index 221885fc..495c72f2 100644 --- a/src/MSA/ImapSubmit.cpp +++ b/src/MSA/ImapSubmit.cpp @@ -1,70 +1,70 @@ /* Copyright (C) 2006 - 2014 Jan Kundrát This file is part of the Trojita Qt IMAP e-mail client, http://trojita.flaska.net/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "ImapSubmit.h" #include "Common/InvokeMethod.h" #include "Imap/Model/Model.h" #include "Imap/Tasks/UidSubmitTask.h" namespace MSA { ImapSubmit::ImapSubmit(QObject *parent, Imap::Mailbox::Model *model): AbstractMSA(parent), m_model(model) { } void ImapSubmit::cancel() { emit error(QStringLiteral("MSA::ImapSubmit::cancel() is not implemented; this is a bug in Trojita.")); Q_ASSERT(false); } bool ImapSubmit::supportsImapSending() const { return true; } -void ImapSubmit::sendImap(const QString &mailbox, const int uidValidity, const int uid, +void ImapSubmit::sendImap(const QString &mailbox, const uint uidValidity, const uint uid, const Imap::Mailbox::UidSubmitOptionsList options) { Imap::Mailbox::UidSubmitTask *submitTask = m_model->sendMailViaUidSubmit(mailbox, uidValidity, uid, options); Q_ASSERT(submitTask); connect(submitTask, &Imap::Mailbox::ImapTask::completed, this, &AbstractMSA::sent); connect(submitTask, &Imap::Mailbox::ImapTask::failed, this, &AbstractMSA::error); EMIT_LATER_NOARG(this, sending); } ImapSubmitFactory::ImapSubmitFactory(Imap::Mailbox::Model *model): m_model(model) { } ImapSubmitFactory::~ImapSubmitFactory() { } AbstractMSA *ImapSubmitFactory::create(QObject *parent) const { return new ImapSubmit(parent, m_model); } } diff --git a/src/MSA/ImapSubmit.h b/src/MSA/ImapSubmit.h index 655f0b35..9b4b95f0 100644 --- a/src/MSA/ImapSubmit.h +++ b/src/MSA/ImapSubmit.h @@ -1,67 +1,67 @@ /* Copyright (C) 2006 - 2014 Jan Kundrát This file is part of the Trojita Qt IMAP e-mail client, http://trojita.flaska.net/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef TROJITA_MSA_IMAP_SUBMIT_H #define TROJITA_MSA_IMAP_SUBMIT_H #include "AbstractMSA.h" namespace Imap { namespace Mailbox { class Model; } } namespace MSA { class ImapSubmit : public AbstractMSA { Q_OBJECT public: ImapSubmit(QObject *parent, Imap::Mailbox::Model *model); virtual bool supportsImapSending() const; - virtual void sendImap(const QString &mailbox, const int uidValidity, const int uid, + virtual void sendImap(const QString &mailbox, const uint uidValidity, const uint uid, const Imap::Mailbox::UidSubmitOptionsList options); public slots: virtual void cancel(); private: Imap::Mailbox::Model *m_model; ImapSubmit(const ImapSubmit &); // don't implement ImapSubmit &operator=(const ImapSubmit &); // don't implement }; class ImapSubmitFactory: public MSAFactory { public: explicit ImapSubmitFactory(Imap::Mailbox::Model *model); virtual ~ImapSubmitFactory(); virtual AbstractMSA *create(QObject *parent) const; private: Imap::Mailbox::Model *m_model; }; } #endif // TROJITA_MSA_IMAP_SUBMIT_H