Better wording
[kdepim.git] / archivemailagent / archivemailinfo.h
blob207f3ebbac3fefc125ba3fd58b8f34a4460ffdb1
1 /*
2 Copyright (c) 2012 Montel Laurent <montel@kde.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 #ifndef ARCHIVEMAILINFO_H
18 #define ARCHIVEMAILINFO_H
20 #include "mailcommon/backupjob.h"
21 #include <KConfigGroup>
22 #include <Akonadi/Collection>
23 #include <KUrl>
24 #include <QDate>
27 class ArchiveMailInfo
29 public:
30 explicit ArchiveMailInfo();
31 explicit ArchiveMailInfo(const KConfigGroup& config);
32 ~ArchiveMailInfo();
34 enum ArchiveUnit {
35 ArchiveDays = 0,
36 ArchiveWeeks,
37 ArchiveMonths,
38 ArchiveMaxUnits
41 KUrl realUrl(const QString &filename) const;
43 bool isEmpty() const;
45 Akonadi::Collection::Id saveCollectionId() const;
46 void setSaveCollectionId(Akonadi::Collection::Id collectionId);
48 void setSaveSubCollection(bool b);
49 bool saveSubCollection() const;
51 void setUrl(const KUrl& url);
52 KUrl url() const;
54 void readConfig(const KConfigGroup& config);
55 void writeConfig(KConfigGroup & config );
57 void setArchiveType( MailCommon::BackupJob::ArchiveType type );
58 MailCommon::BackupJob::ArchiveType archiveType() const;
60 void setArchiveUnit( ArchiveMailInfo::ArchiveUnit unit );
61 ArchiveMailInfo::ArchiveUnit archiveUnit() const;
63 void setArchiveAge( int age );
64 int archiveAge() const;
66 void setLastDateSaved( const QDate& date );
67 QDate lastDateSaved() const;
69 private:
70 QDate mLastDateSaved;
71 int mArchiveAge;
72 MailCommon::BackupJob::ArchiveType mArchiveType;
73 ArchiveUnit mArchiveUnit;
74 Akonadi::Collection::Id mSaveCollectionId;
75 KUrl mPath;
76 bool mSaveSubCollection;
79 #endif // ARCHIVEMAILINFO_H