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;
181 void setCustomSite(
const QString &url);
189 void setCustomSites(
const QStringList &urls);
197 void setIdgamesEnabled(
bool bEnabled);
202 void setIdgamesUrl(QString archiveURL);
212 void setMaximumConcurrentDownloads(
unsigned max);
222 void setMaximumConcurrentSeeks(
unsigned max);
234 void setPrimarySites(
const QStringList &urlList);
242 void setPrimarySitesToDefault();
253 void setTargetDirectory(
const QString &dir);
259 void setWadArchiveEnabled(
bool enabled);
273 void skipFileCurrentUrl(
const QString &fileName);
281 void skipService(
const QString &service);
294 void skipSiteSeek(
const QUrl &url);
305 bool startSeek(
const ModSet &wads);
313 QString targetDirectory()
const;
331 void allDone(
bool bSuccess);
345 void fileDownloadFinished(
const ModFile &filename);
362 void fileDownloadProgress(
const ModFile &filename, qint64 done, qint64 total);
372 void fileDownloadStarted(
const ModFile &filename,
const QUrl &url);
382 void fileInstalled(
const ModFile &filename);
391 void message(
const QString &msg, WadseekerLib::MessageType type);
401 void seekStarted(
const ModSet &filenames);
416 void serviceStarted(
const QString &name);
427 void serviceFinished(
const QString &name);
432 void siteFinished(
const QUrl &site);
437 void siteProgress(
const QUrl &site, qint64 bytes, qint64 total);
442 void siteRedirect(
const QUrl &oldUrl,
const QUrl &newUrl);
447 void siteStarted(
const QUrl &site);
453 void abortWwwSeeker();
454 void cleanUpAfterFinish();
455 bool isAllFinished()
const;
460 void prepareSeekObjects();
462 void setupIdgamesClients(
const QList<WadDownloadInfo> &wadDownloadInfoList);
463 void setupSitesUrls();
464 void setupWadArchiveClient(
const QList<WadDownloadInfo> &wadDownloadInfos);
466 void startNextIdgamesClient();
469 void startWadArchiveClient();
470 void stopWadArchiveClient();
473 void cleanUpIfAllFinished();
474 void fileLinkFound(
const QString &filename,
const QUrl &url);
475 void fileMirrorLinksFound(
const QString &filename,
const QList<QUrl> &urls);
476 void idgamesClientFinished(Idgames *pEmitter);
477 void reportBadUrl(
const QUrl &url);
478 void wadArchiveFinished();
479 void wadRetrieverDownloadFinished(WadDownloadInfo wadDownloadInfo);
480 void wadRetrieverDownloadProgress(WadDownloadInfo wadDownloadInfo, qint64 current, qint64 total);
481 void wadRetrieverDownloadStarted(WadDownloadInfo wadDownloadInfo,
const QUrl &url);
482 void wadRetrieverFinished();
483 void wadRetrieverMessage(
const QString &message, WadseekerLib::MessageType type);
484 void wadRetrieverWadInstalled(WadDownloadInfo wadDownloadInfo);
485 void wwwSeekerFinished();