23 #ifndef __WADSEEKER_H_ 24 #define __WADSEEKER_H_ 29 #include <QStringList> 33 #include "entities/waddownloadinfo.h" 34 #include "wadseekerexportinfo.h" 35 #include "wadseekermessagetype.h" 37 #define WADSEEKER_CONNECT_TIMEOUT_SECONDS_DEFAULT 30 38 #define WADSEEKER_DOWNLOAD_TIMEOUT_SECONDS_DEFAULT 120 41 class WadArchiveClient;
97 static const QString defaultSites[];
106 static const QString forbiddenWads[];
111 static const QString defaultIdgamesUrl();
118 static QStringList defaultSitesListEncoded();
123 static ModSet filterAllowedOnlyWads(
const ModSet &wads);
127 static ModSet filterForbiddenOnlyWads(
const ModSet &wads);
138 static bool isForbiddenWad(
const ModFile &wad);
156 bool isDownloadingFile(
const ModFile &file)
const;
167 bool isWorking()
const;
179 void setCustomSite(
const QString &url);
187 void setIdgamesEnabled(
bool bEnabled);
192 void setIdgamesUrl(QString archiveURL);
202 void setMaximumConcurrentDownloads(
unsigned max);
212 void setMaximumConcurrentSeeks(
unsigned max);
224 void setPrimarySites(
const QStringList &urlList);
232 void setPrimarySitesToDefault();
243 void setTargetDirectory(
const QString &dir);
249 void setWadArchiveEnabled(
bool enabled);
263 void skipFileCurrentUrl(
const QString &fileName);
271 void skipService(
const QString &service);
284 void skipSiteSeek(
const QUrl &url);
295 bool startSeek(
const ModSet &wads);
303 QString targetDirectory()
const;
321 void allDone(
bool bSuccess);
335 void fileDownloadFinished(
const ModFile &filename);
352 void fileDownloadProgress(
const ModFile &filename, qint64 done, qint64 total);
362 void fileDownloadStarted(
const ModFile &filename,
const QUrl &url);
372 void fileInstalled(
const ModFile &filename);
381 void message(
const QString &msg, WadseekerLib::MessageType type);
391 void seekStarted(
const ModSet &filenames);
406 void serviceStarted(
const QString &name);
417 void serviceFinished(
const QString &name);
422 void siteFinished(
const QUrl &site);
427 void siteProgress(
const QUrl &site, qint64 bytes, qint64 total);
432 void siteRedirect(
const QUrl &oldUrl,
const QUrl &newUrl);
437 void siteStarted(
const QUrl &site);
443 void abortWwwSeeker();
444 void cleanUpAfterFinish();
445 bool isAllFinished()
const;
450 void prepareSeekObjects();
452 void setupIdgamesClients(
const QList<WadDownloadInfo> &wadDownloadInfoList);
453 void setupSitesUrls();
454 void setupWadArchiveClient(
const QList<WadDownloadInfo> &wadDownloadInfos);
456 void startNextIdgamesClient();
459 void startWadArchiveClient();
460 void stopWadArchiveClient();
463 void cleanUpIfAllFinished();
464 void fileLinkFound(
const QString &filename,
const QUrl &url);
465 void fileMirrorLinksFound(
const QString &filename,
const QList<QUrl> &urls);
466 void idgamesClientFinished(Idgames *pEmitter);
467 void reportBadUrl(
const QUrl &url);
468 void wadArchiveFinished();
469 void wadRetrieverDownloadFinished(WadDownloadInfo wadDownloadInfo);
470 void wadRetrieverDownloadProgress(WadDownloadInfo wadDownloadInfo, qint64 current, qint64 total);
471 void wadRetrieverDownloadStarted(WadDownloadInfo wadDownloadInfo,
const QUrl &url);
472 void wadRetrieverFinished();
473 void wadRetrieverMessage(
const QString &message, WadseekerLib::MessageType type);
474 void wadRetrieverWadInstalled(WadDownloadInfo wadDownloadInfo);
475 void wwwSeekerFinished();