| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/core/feeddownloader.h`/ |
| 2 | |
| 3 | #ifndef FEEDDOWNLOADER_H |
| 4 | #define FEEDDOWNLOADER_Hcxx . . $ `src/librssguard/core/feeddownloader.h:4:9`! |
| 5 | |
| 6 | #include "core/message.h"cxx . . $ `<file>/src/librssguard/core/message.h`/ |
| 7 | #include "exceptions/applicationexception.h"cxx . . $ `<file>/src/librssguard/exceptions/applicationexception.h`/ |
| 8 | #include "services/abstract/cacheforserviceroot.h"cxx . . $ `<file>/src/librssguard/services/abstract/cacheforserviceroot.h`/ |
| 9 | #include "services/abstract/feed.h"cxx . . $ `<file>/src/librssguard/services/abstract/feed.h`/ |
| 10 | |
| 11 | #include <QFutureWatcher> |
| 12 | #include <QHash> |
| 13 | #include <QObject> |
| 14 | #include <QPair> |
| 15 | |
| 16 | class MessageFiltercxx . . $ MessageFilter#; |
| 17 | |
| 18 | // Represents results of batch feed updates. |
| 19 | class FeedDownloadResultscxx . . $ FeedDownloadResults# { |
| 20 | public: |
| 21 | QHashcxx . . $ QHash#<Feedcxx . . $ Feed#*, QStringcxx . . $ QString#> erroredFeedscxx . . $ FeedDownloadResults#erroredFeeds(6d71e1f7a9ea0a7f).() const; |
| 22 | QHashcxx . . $ QHash#<Feedcxx . . $ Feed#*, QListcxx . . $ QList#<Messagecxx . . $ Message#>> updatedFeedscxx . . $ FeedDownloadResults#updatedFeeds(d6158a28bfdf01c).() const; |
| 23 | QStringcxx . . $ QString# overviewcxx . . $ FeedDownloadResults#overview(3f3c3d0e9c0eb37f).(int how_many_feeds) const; |
| 24 | |
| 25 | void appendUpdatedFeedcxx . . $ FeedDownloadResults#appendUpdatedFeed(c40737f7b92cda08).(Feedcxx . . $ Feed#* feed, const QListcxx . . $ QList#<Messagecxx . . $ Message#>& updated_unread_msgs); |
| 26 | void appendErroredFeedcxx . . $ FeedDownloadResults#appendErroredFeed(93981391c4b73a5b).(Feedcxx . . $ Feed#* feed, const QStringcxx . . $ QString#& error); |
| 27 | void clearcxx . . $ FeedDownloadResults#clear(49f6e7a06ebc5aa8).(); |
| 28 | |
| 29 | private: |
| 30 | // QString represents title if the feed, int represents count of newly downloaded messages. |
| 31 | QHashcxx . . $ QHash#<Feedcxx . . $ Feed#*, QListcxx . . $ QList#<Messagecxx . . $ Message#>> m_updatedFeedscxx . . $ FeedDownloadResults#m_updatedFeeds.; |
| 32 | QHashcxx . . $ QHash#<Feedcxx . . $ Feed#*, QStringcxx . . $ QString#> m_erroredFeedscxx . . $ FeedDownloadResults#m_erroredFeeds.; |
| 33 | }; |
| 34 | |
| 35 | struct FeedUpdateRequestcxx . . $ FeedUpdateRequest# { |
| 36 | Feedcxx . . $ Feed#* feedcxx . . $ FeedUpdateRequest#feed. = nullptr; |
| 37 | ServiceRootcxx . . $ ServiceRoot#* accountcxx . . $ FeedUpdateRequest#account. = nullptr; |
| 38 | QHashcxx . . $ QHash#<ServiceRootcxx . . $ ServiceRoot#::BagOfMessagescxx . . $ ServiceRoot#BagOfMessages#, QStringListcxx . . $ QStringList#> stated_messagescxx . . $ FeedUpdateRequest#stated_messages.; |
| 39 | QHashcxx . . $ QHash#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#> tagged_messagescxx . . $ FeedUpdateRequest#tagged_messages.; |
| 40 | }; |
| 41 | |
| 42 | struct FeedUpdateResultcxx . . $ FeedUpdateResult# { |
| 43 | Feedcxx . . $ Feed#* feedcxx . . $ FeedUpdateResult#feed. = nullptr; |
| 44 | }; |
| 45 | |
| 46 | // This class offers means to "update" feeds and "special" categories. |
| 47 | // NOTE: This class is used within separate thread. |
| 48 | class FeedDownloadercxx . . $ FeedDownloader# : public QObjectcxx . . $ QObject# { |
| 49 | Q_OBJECTcxx . . $ FeedDownloader#staticMetaObject. |
| 50 | |
| 51 | public: |
| 52 | explicit FeedDownloadercxx . . $ FeedDownloader#FeedDownloader(49f6e7a06ebc5aa8).(); |
| 53 | virtual ~cxx . . $ FeedDownloader#`~FeedDownloader`(ced63f7c635d850d).FeedDownloadercxx . . $ FeedDownloader#(); |
| 54 | |
| 55 | bool isUpdateRunningcxx . . $ FeedDownloader#isUpdateRunning(50ce9a9e25b4a850).() const; |
| 56 | bool isCacheSynchronizationRunningcxx . . $ FeedDownloader#isCacheSynchronizationRunning(50ce9a9e25b4a850).() const; |
| 57 | |
| 58 | public slotscxx . . $ `<external>/4830994369567095248/qtmetamacros.h:42:14`!: |
| 59 | void synchronizeAccountCachescxx . . $ FeedDownloader#synchronizeAccountCaches(2e643a133ad38d24).(const QListcxx . . $ QList#<CacheForServiceRootcxx . . $ CacheForServiceRoot#*>& caches, bool emit_signals); |
| 60 | void updateFeedscxx . . $ FeedDownloader#updateFeeds(bcc73982dd0bdfc6).(const QListcxx . . $ QList#<Feedcxx . . $ Feed#*>& feeds); |
| 61 | void stopRunningUpdatecxx . . $ FeedDownloader#stopRunningUpdate(49f6e7a06ebc5aa8).(); |
| 62 | |
| 63 | signalscxx . . $ `<external>/4830994369567095248/qtmetamacros.h:43:14`!: |
| 64 | void cachesSynchronizedcxx . . $ FeedDownloader#cachesSynchronized(49f6e7a06ebc5aa8).(); |
| 65 | void updateStartedcxx . . $ FeedDownloader#updateStarted(49f6e7a06ebc5aa8).(); |
| 66 | void updateFinishedcxx . . $ FeedDownloader#updateFinished(c87b5265ecd7e3fb).(FeedDownloadResultscxx . . $ FeedDownloadResults# updated_feeds); |
| 67 | void updateProgresscxx . . $ FeedDownloader#updateProgress(e8151f2ee217e1b7).(const Feedcxx . . $ Feed#* feed, int current, int total); |
| 68 | |
| 69 | private: |
| 70 | void clearFeedOverloadcxx . . $ FeedDownloader#clearFeedOverload(1b149201450d1fc7).(Feedcxx . . $ Feed#* feed); |
| 71 | bool checkIfFeedOverloadedcxx . . $ FeedDownloader#checkIfFeedOverloaded(14f6d7470dca483).(Feedcxx . . $ Feed#* feed) const; |
| 72 | |
| 73 | void skipFeedUpdateWithErrorcxx . . $ FeedDownloader#skipFeedUpdateWithError(c7206e2ca8047bef).(ServiceRootcxx . . $ ServiceRoot#* acc, Feedcxx . . $ Feed#* feed, const ApplicationExceptioncxx . . $ ApplicationException#& ex); |
| 74 | void updateOneFeedcxx . . $ FeedDownloader#updateOneFeed(42cca584b6e50687).(ServiceRootcxx . . $ ServiceRoot#* acc, |
| 75 | Feedcxx . . $ Feed#* feed, |
| 76 | const QHashcxx . . $ QHash#<ServiceRootcxx . . $ ServiceRoot#::BagOfMessagescxx . . $ ServiceRoot#BagOfMessages#, QStringListcxx . . $ QStringList#>& stated_messages, |
| 77 | const QHashcxx . . $ QHash#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#>& tagged_messages); |
| 78 | void finalizeUpdatecxx . . $ FeedDownloader#finalizeUpdate(49f6e7a06ebc5aa8).(); |
| 79 | void removeDuplicateMessagescxx . . $ FeedDownloader#removeDuplicateMessages(bcfa8667954cc170).(QListcxx . . $ QList#<Messagecxx . . $ Message#>& messages); |
| 80 | void removeTooOldMessagescxx . . $ FeedDownloader#removeTooOldMessages(e4b2289ccabdc775).(Feedcxx . . $ Feed#* feed, QListcxx . . $ QList#<Messagecxx . . $ Message#>& msgs); |
| 81 | |
| 82 | QListcxx . . $ QList#<Feedcxx . . $ Feed#*> scrambleFeedsWithSameHostcxx . . $ FeedDownloader#scrambleFeedsWithSameHost(e0832f638b4904d0).(const QListcxx . . $ QList#<Feedcxx . . $ Feed#*>& feeds) const; |
| 83 | FeedUpdateResultcxx . . $ FeedUpdateResult# updateThreadedFeedcxx . . $ FeedDownloader#updateThreadedFeed(12bca8576c8289ee).(const FeedUpdateRequestcxx . . $ FeedUpdateRequest#& fd); |
| 84 | |
| 85 | private: |
| 86 | bool m_isCacheSynchronizationRunningcxx . . $ FeedDownloader#m_isCacheSynchronizationRunning.; |
| 87 | bool m_stopCacheSynchronizationcxx . . $ FeedDownloader#m_stopCacheSynchronization.; |
| 88 | QMutexcxx . . $ QMutex# m_mutexDbcxx . . $ FeedDownloader#m_mutexDb.; |
| 89 | QHashcxx . . $ QHash#<ServiceRootcxx . . $ ServiceRoot#*, ApplicationExceptioncxx . . $ ApplicationException#> m_erroredAccountscxx . . $ FeedDownloader#m_erroredAccounts.; |
| 90 | QListcxx . . $ QList#<FeedUpdateRequestcxx . . $ FeedUpdateRequest#> m_feedscxx . . $ FeedDownloader#m_feeds. =cxx . . $ QList#QList(ced63f7c635d850d). {}; |
| 91 | QFutureWatchercxx . . $ QFutureWatcher#<FeedUpdateResultcxx . . $ FeedUpdateResult#> m_watcherLookupcxx . . $ FeedDownloader#m_watcherLookup.; |
| 92 | FeedDownloadResultscxx . . $ FeedDownloadResults# m_resultscxx . . $ FeedDownloader#m_results.; |
| 93 | QHashcxx . . $ QHash#<QStringcxx . . $ QString#, QDateTimecxx . . $ QDateTime#> m_overloadedHostscxx . . $ FeedDownloader#m_overloadedHosts.; |
| 94 | }; |
| 95 | |
| 96 | #endif // FEEDDOWNLOADER_H |