File indexing completed on 2024-04-28 04:57:32

0001 /* This file is part of the KDE project
0002 
0003    Copyright (C) 2004 Dario Massarin <nekkar@libero.it>
0004    Copyright (C) 2012 Aish Raj Dahal <dahalaishraj@gmail.com>
0005 
0006    This program is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU General Public
0008    License as published by the Free Software Foundation; either
0009    version 2 of the License, or (at your option) any later version.
0010 */
0011 
0012 #ifndef METALINK_FACTORY_H
0013 #define METALINK_FACTORY_H
0014 
0015 #include "core/plugin/transferfactory.h"
0016 #include "ui/metalinkcreator/metalinker.h"
0017 
0018 class Transfer;
0019 class TransferGroup;
0020 class Scheduler;
0021 
0022 class MetalinkFactory : public TransferFactory
0023 {
0024     Q_OBJECT
0025 public:
0026     MetalinkFactory(QObject *parent, const QVariantList &args);
0027     ~MetalinkFactory() override;
0028 
0029     Transfer *createTransfer(const QUrl &srcUrl, const QUrl &destUrl, TransferGroup *parent, Scheduler *scheduler, const QDomElement *e = nullptr) override;
0030 
0031     QString displayName() const override
0032     {
0033         return "MetaLink";
0034     }
0035     /**
0036      * Checks if a URL is supported by this plugin.
0037      *
0038      * @param url The URL to be tested
0039      * @return True if the URL is a metalink (xml or http).
0040      */
0041     bool isSupported(const QUrl &url) const override;
0042 };
0043 
0044 #endif