transportabstractplugin.h 1.72 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
    Copyright (c) 2017 Laurent Montel <montel@kde.org>

    This library is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 of the License, or (at your
    option) any later version.

    This library 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 Library General Public
    License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to the
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
*/

#ifndef TRANSPORTABSTRACTPLUGIN_H
#define TRANSPORTABSTRACTPLUGIN_H

#include <QObject>
Laurent Montel's avatar
Fix api  
Laurent Montel committed
24
#include <QVector>
25 26 27
#include "mailtransport_export.h"
namespace MailTransport {
class TransportJob;
28
class Transport;
Laurent Montel's avatar
Fix api  
Laurent Montel committed
29 30 31 32 33 34 35

struct MAILTRANSPORT_EXPORT TransportAbstractPluginInfo
{
    QString name;
    QString identifier;
};

36 37 38 39 40 41 42
class MAILTRANSPORT_EXPORT TransportAbstractPlugin : public QObject
{
    Q_OBJECT
public:
    explicit TransportAbstractPlugin(QObject *parent = nullptr);
    ~TransportAbstractPlugin();

Laurent Montel's avatar
Fix api  
Laurent Montel committed
43 44 45
    virtual TransportJob *createTransportJob(const QString &identifier);
    virtual QVector<TransportAbstractPluginInfo> names() const = 0;
    virtual bool configureTransport(const QString &identifier, Transport *transport, QWidget *parent) = 0;
46
    virtual void cleanUp(const QString &identifier);
47 48
};
}
Laurent Montel's avatar
Fix api  
Laurent Montel committed
49
Q_DECLARE_TYPEINFO(MailTransport::TransportAbstractPluginInfo, Q_MOVABLE_TYPE);
50 51

#endif // TRANSPORTABSTRACTPLUGIN_H