1 /* 2 SPDX-FileCopyrightText: 2013-2021 Laurent Montel <montel@kde.org> 3 4 SPDX-License-Identifier: LGPL-2.0-or-later 5 */ 6 7 #pragma once 8 9 #include <Akonadi/Collection> 10 #include <KConfigGroup> 11 12 class FolderArchiveAccountInfo 13 { 14 public: 15 FolderArchiveAccountInfo(); 16 explicit FolderArchiveAccountInfo(const KConfigGroup &config); 17 ~FolderArchiveAccountInfo(); 18 19 enum FolderArchiveType { 20 UniqueFolder, 21 FolderByMonths, 22 FolderByYears, 23 }; 24 25 bool isValid() const; 26 27 QString instanceName() const; 28 void setInstanceName(const QString &instance); 29 30 void setArchiveTopLevel(Akonadi::Collection::Id id); 31 Akonadi::Collection::Id archiveTopLevel() const; 32 33 void setFolderArchiveType(FolderArchiveType type); 34 FolderArchiveType folderArchiveType() const; 35 36 void setEnabled(bool enabled); 37 bool enabled() const; 38 39 void setKeepExistingStructure(bool b); 40 bool keepExistingStructure() const; 41 42 void writeConfig(KConfigGroup &config); 43 void readConfig(const KConfigGroup &config); 44 45 bool operator==(const FolderArchiveAccountInfo &other) const; 46 47 private: 48 FolderArchiveAccountInfo::FolderArchiveType mArchiveType = UniqueFolder; 49 Akonadi::Collection::Id mArchiveTopLevelCollectionId = -1; 50 QString mInstanceName; 51 bool mEnabled = false; 52 bool mKeepExistingStructure = false; 53 }; 54 55