| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/services/abstract/cacheforserviceroot.h`/ |
| 2 | |
| 3 | #ifndef CACHEFORSERVICEROOT_H |
| 4 | #define CACHEFORSERVICEROOT_Hcxx . . $ `src/librssguard/services/abstract/cacheforserviceroot.h:4:9`! |
| 5 | |
| 6 | #include "services/abstract/serviceroot.h"cxx . . $ `<file>/src/librssguard/services/abstract/serviceroot.h`/ |
| 7 | |
| 8 | #include <QMap> |
| 9 | #include <QMutex> |
| 10 | #include <QPair> |
| 11 | #include <QStringList> |
| 12 | |
| 13 | struct RSSGUARD_DLLSPECcxx . . $ `<built-in>:525:9`! CacheSnapshotcxx . . $ CacheSnapshot# { |
| 14 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#> m_cachedLabelAssignmentscxx . . $ CacheSnapshot#m_cachedLabelAssignments.; |
| 15 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#> m_cachedLabelDeassignmentscxx . . $ CacheSnapshot#m_cachedLabelDeassignments.; |
| 16 | QMapcxx . . $ QMap#<RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#, QStringListcxx . . $ QStringList#> m_cachedStatesReadcxx . . $ CacheSnapshot#m_cachedStatesRead.; |
| 17 | QMapcxx . . $ QMap#<RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance#, QListcxx . . $ QList#<Messagecxx . . $ Message#>> m_cachedStatesImportantcxx . . $ CacheSnapshot#m_cachedStatesImportant.; |
| 18 | }; |
| 19 | |
| 20 | class RSSGUARD_DLLSPECcxx . . $ `<built-in>:525:9`! CacheForServiceRootcxx . . $ CacheForServiceRoot# { |
| 21 | public: |
| 22 | explicit CacheForServiceRootcxx . . $ CacheForServiceRoot#CacheForServiceRoot(49f6e7a06ebc5aa8).(); |
| 23 | virtual ~cxx . . $ CacheForServiceRoot#`~CacheForServiceRoot`(49f6e7a06ebc5aa8).CacheForServiceRootcxx . . $ CacheForServiceRoot#(); |
| 24 | |
| 25 | virtual void saveAllCachedDatacxx . . $ CacheForServiceRoot#saveAllCachedData(b45ddcbc8423892c).(bool ignore_errors) = 0; |
| 26 | |
| 27 | void addLabelsAssignmentsToCachecxx . . $ CacheForServiceRoot#addLabelsAssignmentsToCache(a9c1f6ad514aa17c).(const QStringListcxx . . $ QStringList#& ids_of_messages, const QStringcxx . . $ QString#& lbl_custom_id, bool assign); |
| 28 | void addLabelsAssignmentsToCachecxx . . $ CacheForServiceRoot#addLabelsAssignmentsToCache(f01e5ff6d23cefdf).(const QListcxx . . $ QList#<Messagecxx . . $ Message#>& ids_of_messages, Labelcxx . . $ Label#* lbl, bool assign); |
| 29 | void addMessageStatesToCachecxx . . $ CacheForServiceRoot#addMessageStatesToCache(559cd80f2974816d).(const QListcxx . . $ QList#<Messagecxx . . $ Message#>& ids_of_messages, RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance# importance); |
| 30 | void addMessageStatesToCachecxx . . $ CacheForServiceRoot#addMessageStatesToCache(c21502b1d481d06b).(const QStringListcxx . . $ QStringList#& ids_of_messages, RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus# read); |
| 31 | |
| 32 | void loadCacheFromFilecxx . . $ CacheForServiceRoot#loadCacheFromFile(49f6e7a06ebc5aa8).(); |
| 33 | void setUniqueIdcxx . . $ CacheForServiceRoot#setUniqueId(d4f767463ce0a6b3).(int unique_id); |
| 34 | bool isEmptycxx . . $ CacheForServiceRoot#isEmpty(50ce9a9e25b4a850).() const; |
| 35 | |
| 36 | protected: |
| 37 | // Returns all cached data and clears the cache. |
| 38 | // NOTE: If returned data are not successfuly passed back to |
| 39 | // server then caller needs to re-add the data back to cache. |
| 40 | CacheSnapshotcxx . . $ CacheSnapshot# takeMessageCachecxx . . $ CacheForServiceRoot#takeMessageCache(36f721e47644ccd0).(); |
| 41 | |
| 42 | private: |
| 43 | void clearCachecxx . . $ CacheForServiceRoot#clearCache(49f6e7a06ebc5aa8).(); |
| 44 | void saveCacheToFilecxx . . $ CacheForServiceRoot#saveCacheToFile(49f6e7a06ebc5aa8).(); |
| 45 | |
| 46 | int m_uniqueIdcxx . . $ CacheForServiceRoot#m_uniqueId.; |
| 47 | QScopedPointercxx . . $ QScopedPointer#<QMutexcxx . . $ QMutex#> m_cacheSaveMutexcxx . . $ CacheForServiceRoot#m_cacheSaveMutex.; |
| 48 | |
| 49 | // Map where key is label's custom ID and value is list of message custom IDs |
| 50 | // which we want to assign to the label. |
| 51 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#> m_cachedLabelAssignmentscxx . . $ CacheForServiceRoot#m_cachedLabelAssignments.; |
| 52 | |
| 53 | // Map where key is label's custom ID and value is list of message custom IDs |
| 54 | // which we want to remove from the label assignment. |
| 55 | QMapcxx . . $ QMap#<QStringcxx . . $ QString#, QStringListcxx . . $ QStringList#> m_cachedLabelDeassignmentscxx . . $ CacheForServiceRoot#m_cachedLabelDeassignments.; |
| 56 | |
| 57 | // Map of cached read/unread changes. |
| 58 | QMapcxx . . $ QMap#<RootItemcxx . . $ RootItem#::ReadStatuscxx . . $ RootItem#ReadStatus#, QStringListcxx . . $ QStringList#> m_cachedStatesReadcxx . . $ CacheForServiceRoot#m_cachedStatesRead.; |
| 59 | |
| 60 | // Map of cached important/unimportant changes. |
| 61 | QMapcxx . . $ QMap#<RootItemcxx . . $ RootItem#::Importancecxx . . $ RootItem#Importance#, QListcxx . . $ QList#<Messagecxx . . $ Message#>> m_cachedStatesImportantcxx . . $ CacheForServiceRoot#m_cachedStatesImportant.; |
| 62 | }; |
| 63 | |
| 64 | #endif // CACHEFORSERVICEROOT_H |