File indexing completed on 2025-01-12 06:47:26
0001 /*************************************************************************** 0002 cdownloader.h - download stuff 0003 ------------------- 0004 begin : Pi mar 28 2003 0005 copyright : (C) 2003 by Tomas Mecir 0006 email : kmuddy@kmuddy.com 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * * 0011 * This program is free software; you can redistribute it and/or modify * 0012 * it under the terms of the GNU General Public License as published by * 0013 * the Free Software Foundation; either version 2 of the License, or * 0014 * (at your option) any later version. * 0015 * * 0016 ***************************************************************************/ 0017 0018 #ifndef CDOWNLOADER_H 0019 #define CDOWNLOADER_H 0020 0021 //Currently we only can use this object with MSP. Later, it may be used with 0022 //other stuff (MXP) as well. Then this will have to be changed. 0023 0024 #include <qobject.h> 0025 #include <kmuddy_export.h> 0026 0027 class cMSP; 0028 0029 class KJob; 0030 0031 /** 0032 Class used to download stuff. 0033 *@author Tomas Mecir 0034 */ 0035 0036 //class definition must always exist - MOC depends on that 0037 class KMUDDY_EXPORT cDownloader : public QObject { 0038 Q_OBJECT 0039 public: 0040 cDownloader (cMSP *mspObject); 0041 ~cDownloader () override; 0042 bool downloading () { return (currentJob != nullptr); }; 0043 void reset (); 0044 void download (QString remoteURL, QString localFile); 0045 protected slots: 0046 void slotResult (KJob *job); 0047 protected: 0048 cMSP *msp; 0049 KJob *currentJob; 0050 }; 0051 0052 #endif //CDOWNLOADER_H