diff --git a/src/mailimporter/filterimporterbase.h b/src/mailimporter/filterimporterbase.h index e47a78c..10a0f68 100644 --- a/src/mailimporter/filterimporterbase.h +++ b/src/mailimporter/filterimporterbase.h @@ -1,44 +1,48 @@ /* Copyright (C) 2017-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FILTERIMPORTERBASE_H #define FILTERIMPORTERBASE_H #include "mailimporter_export.h" #include #include #include namespace MailImporter { class FilterInfo; +/** + * @brief The FilterImporterBase class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT FilterImporterBase { public: explicit FilterImporterBase(MailImporter::FilterInfo *info); virtual ~FilterImporterBase(); Q_REQUIRED_RESULT virtual bool importMessage(const QString &folderName, const QString &msgPath, bool duplicateCheck, const MailImporter::MessageStatus &status); Q_REQUIRED_RESULT virtual bool importMessage(const KArchiveFile *file, const QString &folderPath, int &nbTotal, int &fileDone); virtual void clear(); virtual void clearCountDuplicate(); Q_REQUIRED_RESULT virtual int countDuplicates() const; Q_REQUIRED_RESULT virtual QString topLevelFolder() const; protected: MailImporter::FilterInfo *mInfo = nullptr; }; } #endif // FILTERIMPORTERBASE_H diff --git a/src/mailimporter/filterinfo.h b/src/mailimporter/filterinfo.h index 884f9e6..38a585f 100644 --- a/src/mailimporter/filterinfo.h +++ b/src/mailimporter/filterinfo.h @@ -1,61 +1,63 @@ #ifndef FILTERINFO_H #define FILTERINFO_H /*************************************************************************** filters.h - description ------------------- begin : Fri Jun 30 2000 copyright : (C) 2000 by Hans Dijkema email : kmailcvt@hum.org ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* Copyright (c) 2012-2019 Montel Laurent */ #include "mailimporter_export.h" #include #include namespace MailImporter { class FilterInfoGui; - +/** + * @brief The FilterInfo class + */ class MAILIMPORTER_EXPORT FilterInfo { public: FilterInfo(); ~FilterInfo(); void setFilterInfoGui(FilterInfoGui *filterinfogui); void setStatusMessage(const QString &status); void setFrom(const QString &from); void setTo(const QString &to); void setCurrent(const QString ¤t); void setCurrent(int percent = 0); void setOverall(int percent = 0); void addInfoLogEntry(const QString &log); void addErrorLogEntry(const QString &log); void clear(); void alert(const QString &message); static void terminateASAP(); Q_REQUIRED_RESULT bool shouldTerminate() const; Q_REQUIRED_RESULT QString rootCollectionName() const; QWidget *parentWidget() const; void setRemoveDupMessage(bool removeDupMessage); Q_REQUIRED_RESULT bool removeDupMessage() const; private: class Private; Private *const d; }; } #endif /* FILTERINFO_H */ diff --git a/src/mailimporter/filterinfogui.h b/src/mailimporter/filterinfogui.h index 32d8a61..7f0eef3 100644 --- a/src/mailimporter/filterinfogui.h +++ b/src/mailimporter/filterinfogui.h @@ -1,46 +1,50 @@ /* Copyright (c) 2012-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FILTERINFOGUI_H #define FILTERINFOGUI_H #include "filters.h" namespace MailImporter { +/** + * @brief The FilterInfoGui class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT FilterInfoGui { public: explicit FilterInfoGui(); virtual ~FilterInfoGui(); virtual void setStatusMessage(const QString &status); virtual void setFrom(const QString &from); virtual void setTo(const QString &to); virtual void setCurrent(const QString ¤t); virtual void setCurrent(int percent = 0); virtual void setOverall(int percent = 0); virtual void addInfoLogEntry(const QString &log); virtual void addErrorLogEntry(const QString &log); virtual void clear(); virtual void alert(const QString &message); virtual QWidget *parent() const; }; } #endif /* FILTERINFOGUI_H */ diff --git a/src/mailimporter/filters.h b/src/mailimporter/filters.h index adf40d0..5b3fc3c 100644 --- a/src/mailimporter/filters.h +++ b/src/mailimporter/filters.h @@ -1,73 +1,77 @@ /*************************************************************************** filters.h - description ------------------- begin : Fri Jun 30 2000 copyright : (C) 2000 by Hans Dijkema email : kmailcvt@hum.org ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* Copyright (c) 2012-2019 Montel Laurent */ #ifndef FILTERS_H #define FILTERS_H #ifndef MAX_LINE #define MAX_LINE 4096 #endif #include "filterinfo.h" #include "filters.h" #include "mailimporter_export.h" #include #include namespace MailImporter { +/** + * @brief The Filter class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT Filter { public: explicit Filter(const QString &name, const QString &author, const QString &info = QString()); virtual ~Filter(); virtual void import() = 0; Q_REQUIRED_RESULT QString author() const; Q_REQUIRED_RESULT QString name() const; Q_REQUIRED_RESULT QString info() const; void setAuthor(const QString &); void setName(const QString &); void setInfo(const QString &); void clear(); void setFilterInfo(MailImporter::FilterInfo *info); MailImporter::FilterInfo *filterInfo() const; void setFilterImporter(MailImporter::FilterImporterBase *importer); MailImporter::FilterImporterBase *filterImporter() const; void clearCountDuplicate(); Q_REQUIRED_RESULT int countDuplicates() const; void setMailDir(const QString &mailDir); Q_REQUIRED_RESULT QString mailDir() const; protected: static int countDirectory(const QDir &dir, bool searchHiddenDirectory); bool importMessage(const QString &folderName, const QString &msgPath, bool duplicateCheck, MailImporter::MessageStatus status = MailImporter::MessageStatus()); private: class Private; Private *const d; }; } #endif diff --git a/src/mailimporter/filters/filterbalsa.h b/src/mailimporter/filters/filterbalsa.h index 1441463..ffb0635 100644 --- a/src/mailimporter/filters/filterbalsa.h +++ b/src/mailimporter/filters/filterbalsa.h @@ -1,46 +1,50 @@ /* Copyright (c) 2012-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FILTERBALSA_H #define FILTERBALSA_H #include "filters.h" namespace MailImporter { class FilterBalsaPrivate; +/** + * @brief The FilterBalsa class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT FilterBalsa : public Filter { public: FilterBalsa(); ~FilterBalsa() override; void import() override; void importMails(const QString &maildir); Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); QString localMailDirPath(); private: void importDirContents(const QString &); void importFiles(const QString &); void processDirectory(const QString &path); MailImporter::MessageStatus statusFromFile(const QString &filename); FilterBalsaPrivate *const d; }; } #endif // FILTERBALSA_H diff --git a/src/mailimporter/filters/filterclawsmail.h b/src/mailimporter/filters/filterclawsmail.h index 1cda4ba..b8cdf83 100644 --- a/src/mailimporter/filters/filterclawsmail.h +++ b/src/mailimporter/filters/filterclawsmail.h @@ -1,47 +1,47 @@ /* Copyright (c) 2012-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILIMPORTER_FILTER_CLAWSMAILS_H #define MAILIMPORTER_FILTER_CLAWSMAILS_H #include #include "filtersylpheed.h" +namespace MailImporter { /** * Imports Sylpheed mail folder with maildir format recursively, recreating the folder structure. * @author Danny Kukawka */ -namespace MailImporter { class MAILIMPORTER_EXPORT FilterClawsMail : public FilterSylpheed { public: FilterClawsMail(); ~FilterClawsMail() override; Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); /* return local mail dir from folderlist.xml*/ Q_REQUIRED_RESULT QString localMailDirPath() override; Q_REQUIRED_RESULT bool excludeFile(const QString &file) override; Q_REQUIRED_RESULT QString defaultInstallFolder() const override; Q_REQUIRED_RESULT QString markFile() const override; }; } #endif diff --git a/src/mailimporter/filters/filterevolution.h b/src/mailimporter/filters/filterevolution.h index 8ea771c..1ac866c 100644 --- a/src/mailimporter/filters/filterevolution.h +++ b/src/mailimporter/filters/filterevolution.h @@ -1,46 +1,46 @@ /* * filter_evolution.h * Author : Simon MARTIN * Copyright (c) 2004 Simon MARTIN * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MAILIMPORTER_FILTER_EVOLUTION_H #define MAILIMPORTER_FILTER_EVOLUTION_H #include "filters.h" +namespace MailImporter { /** * Imports Evolution mboxes recursively, keeping the folder structure. * @author Simon MARTIN */ -namespace MailImporter { class MAILIMPORTER_EXPORT FilterEvolution : public Filter { public: FilterEvolution(); ~FilterEvolution() override; void import() override; void importMails(const QString &maildir); Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); private: void importDirContents(const QString &, const QString &, const QString &); void importMBox(const QString &, const QString &, const QString &); }; } #endif diff --git a/src/mailimporter/filters/filterevolution_v2.h b/src/mailimporter/filters/filterevolution_v2.h index 90bff6d..acd46b1 100644 --- a/src/mailimporter/filters/filterevolution_v2.h +++ b/src/mailimporter/filters/filterevolution_v2.h @@ -1,46 +1,46 @@ /*************************************************************************** filter_evolution_v2.h - Evolution 2.0.x mail import ------------------- begin : Januar 26 2005 copyright : (C) 2005 by Danny Kukawka (inspired and partly copied from filter_evolution) ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_EVOLUTION_V2_H #define MAILIMPORTER_FILTER_EVOLUTION_V2_H #include "filters.h" + +namespace MailImporter { /** * Imports Evolution v2.x mail folder recursively, keeping the folder structure. * @author Danny Kukawka */ - -namespace MailImporter { class MAILIMPORTER_EXPORT FilterEvolution_v2 : public Filter { public: FilterEvolution_v2(); ~FilterEvolution_v2() override; void import() override; void importMails(const QString &maildir); Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); private: void importDirContents(const QString &, const QString &, const QString &); void importMBox(const QString &, const QString &, const QString &); Q_REQUIRED_RESULT bool excludeFiles(const QString &file); }; } #endif diff --git a/src/mailimporter/filters/filterevolution_v3.h b/src/mailimporter/filters/filterevolution_v3.h index 59113f1..36c48a0 100644 --- a/src/mailimporter/filters/filterevolution_v3.h +++ b/src/mailimporter/filters/filterevolution_v3.h @@ -1,46 +1,50 @@ /* Copyright (c) 2012-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILIMPORTER_FILTER_EVOLUTION_V3_H #define MAILIMPORTER_FILTER_EVOLUTION_V3_H #include "filters.h" namespace MailImporter { class FilterEvolution_v3Private; +/** + * @brief The FilterEvolution_v3 class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT FilterEvolution_v3 : public Filter { public: FilterEvolution_v3(); ~FilterEvolution_v3() override; void import() override; void importMails(const QString &maildir); Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); private: void importDirContents(const QString &); void importFiles(const QString &); void processDirectory(const QString &path); MailImporter::MessageStatus statusFromFile(const QString &filename); FilterEvolution_v3Private *const d; }; } #endif diff --git a/src/mailimporter/filters/filtericedove.h b/src/mailimporter/filters/filtericedove.h index 9dd06bd..86e3156 100644 --- a/src/mailimporter/filters/filtericedove.h +++ b/src/mailimporter/filters/filtericedove.h @@ -1,38 +1,42 @@ /* Copyright (c) 2015-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FILTERICEDOVE_H #define FILTERICEDOVE_H #include "filterthunderbird.h" namespace MailImporter { +/** + * @brief The FilterIcedove class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT FilterIcedove : public FilterThunderbird { public: FilterIcedove(); ~FilterIcedove() override; Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); protected: Q_REQUIRED_RESULT QString defaultInstallFolder() const override; Q_REQUIRED_RESULT QString settingsPath() override; }; } #endif // FILTERICEDOVE_H diff --git a/src/mailimporter/filters/filterkmail_maildir.h b/src/mailimporter/filters/filterkmail_maildir.h index db0207d..c181ddd 100644 --- a/src/mailimporter/filters/filterkmail_maildir.h +++ b/src/mailimporter/filters/filterkmail_maildir.h @@ -1,47 +1,47 @@ /*************************************************************************** filter_kmail_maildir.h - Kmail maildir mail import ------------------- begin : April 06 2005 copyright : (C) 2005 by Danny Kukawka email : danny.kukawka@web.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* Copyright (c) 2012-2019 Montel Laurent */ #ifndef MAILIMPORTER_FILTER_KMAIL_MAILDIR_H #define MAILIMPORTER_FILTER_KMAIL_MAILDIR_H #include "filters.h" +namespace MailImporter { +class FilterKMail_maildirPrivate; /** * Imports KMail mail folder with maildir format recursively, recreating the folder structure. * @author Danny Kukawka */ -namespace MailImporter { -class FilterKMail_maildirPrivate; class MAILIMPORTER_EXPORT FilterKMail_maildir : public Filter { public: FilterKMail_maildir(); ~FilterKMail_maildir() override; void import() override; void importMails(const QString &maildir); private: void processDirectory(const QString &path); void importDirContents(const QString &); void importFiles(const QString &); FilterKMail_maildirPrivate *const d; }; } #endif diff --git a/src/mailimporter/filters/filterkmailarchive.h b/src/mailimporter/filters/filterkmailarchive.h index e24092b..d1e3e68 100644 --- a/src/mailimporter/filters/filterkmailarchive.h +++ b/src/mailimporter/filters/filterkmailarchive.h @@ -1,48 +1,51 @@ /* Copyright 2009,2010 Klarälvdalens Datakonsult AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef MAILIMPORTER_FILTER_KMAIL_ARCHIVE_H #define MAILIMPORTER_FILTER_KMAIL_ARCHIVE_H #include "filters.h" class KArchiveFile; class KArchiveDirectory; namespace MailImporter { class FilterKMailArchivePrivate; +/** + * @brief The FilterKMailArchive class + */ class MAILIMPORTER_EXPORT FilterKMailArchive : public Filter { public: FilterKMailArchive(); ~FilterKMailArchive() override; void import() override; void importMails(const QString &archiveFile); private: Q_REQUIRED_RESULT bool importDirectory(const KArchiveDirectory *directory, const QString &folderPath); Q_REQUIRED_RESULT bool importFolder(const KArchiveDirectory *folder, const QString &folderPath); Q_REQUIRED_RESULT bool importMessage(const KArchiveFile *file, const QString &folderPath); int countFiles(const KArchiveDirectory *directory) const; FilterKMailArchivePrivate *const d; }; } #endif diff --git a/src/mailimporter/filters/filterlnotes.h b/src/mailimporter/filters/filterlnotes.h index bbc4767..368ff72 100644 --- a/src/mailimporter/filters/filterlnotes.h +++ b/src/mailimporter/filters/filterlnotes.h @@ -1,45 +1,46 @@ /*************************************************************************** filter_lnotes.h - Lotus Notes Structured Text mail import ------------------- begin : Wed Feb 16, 2005 copyright : (C) 2005 by Robert Rockers email : kconfigure@rockerssoft.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_LNOTES_H #define MAILIMPORTER_FILTER_LNOTES_H #include "filters.h" -/**imports Lotus Notes Structured Text Archives and archvies messages into KMail - *@author Robert Rockers - */ namespace MailImporter { class FilterLNotesPrivate; +/** + * imports Lotus Notes Structured Text Archives and archvies messages into KMail + * @author Robert Rockers + */ class MAILIMPORTER_EXPORT FilterLNotes : public Filter { public: FilterLNotes(); ~FilterLNotes() override; /** Standard import filter... starting line for our import */ void import() override; private: FilterLNotesPrivate *const d; /** * This is were all the real action is gonna be handled. * Gets called once for EACH file imported */ void ImportLNotes(const QString &file); }; } #endif diff --git a/src/mailimporter/filters/filtermailapp.h b/src/mailimporter/filters/filtermailapp.h index 9730434..5226bc5 100644 --- a/src/mailimporter/filters/filtermailapp.h +++ b/src/mailimporter/filters/filtermailapp.h @@ -1,46 +1,46 @@ /*************************************************************************** filter_mailapp.h - OS X Mail App import ------------------- copyright : (C) 2004 by Chris Howells email : howells@kde.org Derived from code by: copyright : (C) 2003 by Laurence Anderson email : l.d.anderson@warwick.ac.uk ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_MAILAPP_H #define MAILIMPORTER_FILTER_MAILAPP_H #include "filters.h" +namespace MailImporter { +class FilterMailAppPrivate; /** *imports mbox archives messages into KMail *@author Chris Howells */ -namespace MailImporter { -class FilterMailAppPrivate; class MAILIMPORTER_EXPORT FilterMailApp : public Filter { public: FilterMailApp(); ~FilterMailApp() override; void import() override; void importMails(const QString &maildir); private: FilterMailAppPrivate *const d; void traverseDirectory(const QString &); }; } #endif diff --git a/src/mailimporter/filters/filtermailmangzip.h b/src/mailimporter/filters/filtermailmangzip.h index 6c0a422..80a5f58 100644 --- a/src/mailimporter/filters/filtermailmangzip.h +++ b/src/mailimporter/filters/filtermailmangzip.h @@ -1,36 +1,40 @@ /* Copyright (c) 2013-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MAILIMPORTER_FILTER_MAILMANGZIP_H #define MAILIMPORTER_FILTER_MAILMANGZIP_H #include "filters.h" namespace MailImporter { +/** + * @brief The FilterMailmanGzip class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT FilterMailmanGzip : public Filter { public: FilterMailmanGzip(); ~FilterMailmanGzip() override; void importMails(const QStringList &filenames); void import() override; }; } #endif diff --git a/src/mailimporter/filters/filtermbox.h b/src/mailimporter/filters/filtermbox.h index c0e87c0..53ee636 100644 --- a/src/mailimporter/filters/filtermbox.h +++ b/src/mailimporter/filters/filtermbox.h @@ -1,39 +1,39 @@ /*************************************************************************** filter_mbox.h - mbox mail import ------------------- begin : Sat Apr 5 2003 copyright : (C) 2003 by Laurence Anderson email : l.d.anderson@warwick.ac.uk ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_MBOX_H #define MAILIMPORTER_FILTER_MBOX_H #include "filters.h" +namespace MailImporter { /** * imports mbox archives messages into KMail * @author Laurence Anderson */ -namespace MailImporter { class MAILIMPORTER_EXPORT FilterMBox : public Filter { public: FilterMBox(); ~FilterMBox() override; void importMails(const QStringList &filenames); void import() override; }; } #endif diff --git a/src/mailimporter/filters/filteroe.h b/src/mailimporter/filters/filteroe.h index 76f06b8..6ca46ce 100644 --- a/src/mailimporter/filters/filteroe.h +++ b/src/mailimporter/filters/filteroe.h @@ -1,87 +1,87 @@ /*************************************************************************** filter_oe.h - Outlook Express mail import ------------------- begin : Sat Feb 1 2003 copyright : (C) 2003 by Laurence Anderson email : l.d.anderson@warwick.ac.uk ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_OE_H #define MAILIMPORTER_FILTER_OE_H #include "filters.h" #include +#include "mailimporter_utils.h" +namespace MailImporter { /** *imports outlook text messages into KMail *@author Laurence Anderson */ -#include "mailimporter_utils.h" -namespace MailImporter { class MAILIMPORTER_EXPORT FilterOE : public Filter { public: FilterOE(); ~FilterOE() override; void import() override; void importMails(const QString &maildir); private: void importMailBox(const QString &fileName); void mbxImport(QDataStream &ds); void dbxImport(QDataStream &ds); void dbxReadIndex(QDataStream &ds, int filePos); void dbxReadDataBlock(QDataStream &ds, int filePos); void dbxReadEmail(QDataStream &ds, int filePos); /** helperfunctions for folder structure support */ Q_REQUIRED_RESULT QString parseFolderOEString(QDataStream &ds, int filePos); Q_REQUIRED_RESULT QString getFolderName(const QString &filename); /** which file (of totalFiles) is now in the work? */ int currentFile; /** total number of files that get imported */ int totalFiles; /** total emails in current file */ int totalEmails; /** which email (of totalFiles) is now in the work? */ int currentEmail; /** number of imported mails with flag 0x04 */ int count0x04; /** number of imported mails with flag 0x84 */ int count0x84; /** true if the folderstructure is parsed */ bool parsedFolder; /** true if the current parsing file is the folder file */ bool currentIsFolderFile; /** Folder structure with following 4 entries: 1. descriptive folder name 2. filename 3. ID of current folder 4. ID of parent folder */ typedef FolderStructureBase<4> FolderStructure; /** matrix with information about the folder structure*/ QList folderStructure; typedef QList::Iterator FolderStructureIterator; /** name of the current folder */ QString folderName; /** name of the chosen folder */ }; } #endif diff --git a/src/mailimporter/filters/filteropera.h b/src/mailimporter/filters/filteropera.h index d8be90a..35805d8 100644 --- a/src/mailimporter/filters/filteropera.h +++ b/src/mailimporter/filters/filteropera.h @@ -1,45 +1,45 @@ /*************************************************************************** filter_opera.h - Opera mail import ------------------- begin : Januar 26 2005 copyright : (C) 2005 by Danny Kukawka email : danny.kukawka@web.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_OPERA_H #define MAILIMPORTER_FILTER_OPERA_H #include "filters.h" #include +namespace MailImporter { /** *imports opera account-archives into KMail *@author Danny Kukawka */ -namespace MailImporter { class MAILIMPORTER_EXPORT FilterOpera : public Filter { public: FilterOpera(); ~FilterOpera() override; void import() override; void importMails(const QString &maildir); Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); private: void importBox(const QDir &importDir, const QStringList &, const QString &accountName = QString()); void importRecursive(const QDir &maildir, const QString &accountName = QString()); }; } #endif diff --git a/src/mailimporter/filters/filterplain.h b/src/mailimporter/filters/filterplain.h index 8d0827e..21ed65d 100644 --- a/src/mailimporter/filters/filterplain.h +++ b/src/mailimporter/filters/filterplain.h @@ -1,38 +1,38 @@ /*************************************************************************** FilterPlain.h - Plain mail import ------------------- begin : Fri Jun 24 2002 copyright : (C) 2002 by Laurence Anderson email : l.d.anderson@warwick.ac.uk ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_PLAIN_H #define MAILIMPORTER_FILTER_PLAIN_H #include "filters.h" +namespace MailImporter { /** *imports Plain text messages into KMail *@author laurence */ -namespace MailImporter { class MAILIMPORTER_EXPORT FilterPlain : public Filter { public: FilterPlain(); ~FilterPlain() override; void import() override; void importMails(const QString &mailDir); }; } #endif diff --git a/src/mailimporter/filters/filterpmail.h b/src/mailimporter/filters/filterpmail.h index bdc4e24..d260964 100644 --- a/src/mailimporter/filters/filterpmail.h +++ b/src/mailimporter/filters/filterpmail.h @@ -1,73 +1,76 @@ /*************************************************************************** FilterPMail.h - Pegasus-Mail import ------------------- begin : Sat Jan 6 2001 copyright : (C) 2001 by Holger Schurig email : holgerschurig@gmx.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_PMAIL_H #define MAILIMPORTER_FILTER_PMAIL_H #include #include "filters.h" #include "mailimporter_utils.h" namespace MailImporter { +/** + * @brief The FilterPMail class + */ class MAILIMPORTER_EXPORT FilterPMail : public Filter { public: FilterPMail(); ~FilterPMail() override; void import() override; void importMails(const QString &chosenDir); protected: /** this looks for all files with the filemask 'mask' and calls the 'workFunc' on each of them */ void processFiles(const QString &mask, void (FilterPMail::*workFunc)(const QString &)); /** this function imports one *.CNM message */ void importNewMessage(const QString &file); /** this function imports one mail folder file (*.PMM) */ void importMailFolder(const QString &file); /** imports a 'unix' format mail folder (*.MBX) */ void importUnixMailFolder(const QString &file); /** this function recreate the folder structure */ bool parseFolderMatrix(const QString &chosenDir); /** this function parse the folder structure */ QString getFolderName(const QString &ID); private: /** the working directory */ QDir dir; /** Folder structure here has 5 entries. */ typedef FolderStructureBase<5> FolderStructure; /** List with the folder matrix, which contains following strings: 1. type (2 for root-folder, 1 for folder, 0 for mailarchiv) 2. type (1 for root-folder, 3 for folder, 0 for mailarchiv) 3. "ID:flag:filename" of folder/archiv 4. "ID:name" of parent folder 5. name of folder/archiv */ QList folderMatrix; typedef QList::Iterator FolderStructureIterator; bool folderParsed = false; /** which file (of totalFiles) is now in the work? */ int currentFile = 0; /** total number of files that get imported */ int totalFiles = 0; }; } #endif diff --git a/src/mailimporter/filters/filterseamonkey.h b/src/mailimporter/filters/filterseamonkey.h index c5e3253..2533267 100644 --- a/src/mailimporter/filters/filterseamonkey.h +++ b/src/mailimporter/filters/filterseamonkey.h @@ -1,37 +1,41 @@ /* Copyright (C) 2017-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FilterSeaMonkey_H #define FilterSeaMonkey_H #include "filterthunderbird.h" namespace MailImporter { +/** + * @brief The FilterSeaMonkey class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT FilterSeaMonkey : public FilterThunderbird { public: FilterSeaMonkey(); ~FilterSeaMonkey() override; Q_REQUIRED_RESULT static QString defaultSettingsPath(); protected: Q_REQUIRED_RESULT QString defaultInstallFolder() const override; Q_REQUIRED_RESULT QString settingsPath() override; }; } #endif // FilterSeaMonkey_H diff --git a/src/mailimporter/filters/filtersylpheed.h b/src/mailimporter/filters/filtersylpheed.h index 4b621c6..c53e6fb 100644 --- a/src/mailimporter/filters/filtersylpheed.h +++ b/src/mailimporter/filters/filtersylpheed.h @@ -1,60 +1,60 @@ /*************************************************************************** filter_sylpheed.h - Sylpheed maildir mail import ------------------- begin : April 07 2005 copyright : (C) 2005 by Danny Kukawka email : danny.kukawka@web.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* Copyright (c) 2012-2019 Montel Laurent */ #ifndef MAILIMPORTER_FILTER_SYLPHEED_H #define MAILIMPORTER_FILTER_SYLPHEED_H #include #include "filters.h" +namespace MailImporter { +class FilterSylpheedPrivate; /** * Imports Sylpheed mail folder with maildir format recursively, recreating the folder structure. * @author Danny Kukawka */ -namespace MailImporter { -class FilterSylpheedPrivate; class MAILIMPORTER_EXPORT FilterSylpheed : public Filter { public: FilterSylpheed(); ~FilterSylpheed() override; Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString isMailerFound(); void import() override; virtual void importMails(const QString &maildir); /* return local mail dir from folderlist.xml*/ virtual QString localMailDirPath(); Q_REQUIRED_RESULT virtual bool excludeFile(const QString &file); virtual QString defaultInstallFolder() const; virtual QString markFile() const; private: void importDirContents(const QString &); void importFiles(const QString &); void processDirectory(const QString &path); void readMarkFile(const QString &, QHash &); MailImporter::MessageStatus msgFlagsToString(unsigned long flags); FilterSylpheedPrivate *const d; }; } #endif diff --git a/src/mailimporter/filters/filterthebat.h b/src/mailimporter/filters/filterthebat.h index d3aadb0..428ab23 100644 --- a/src/mailimporter/filters/filterthebat.h +++ b/src/mailimporter/filters/filterthebat.h @@ -1,47 +1,47 @@ /*************************************************************************** filter_thebat.h - TheBat! mail import ------------------- begin : April 07 2005 copyright : (C) 2005 by Danny Kukawka email : danny.kukawka@web.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* Copyright (c) 2012-2019 Montel Laurent */ #ifndef MAILIMPORTER_FILTER_THEBAT_H #define MAILIMPORTER_FILTER_THEBAT_H #include "filters.h" #include "mailimporter_export.h" +namespace MailImporter { +class FilterTheBatPrivate; /** * Imports The Bat! mail folder recursively, recreating the folder structure. * @author Danny Kukawka */ -namespace MailImporter { -class FilterTheBatPrivate; class MAILIMPORTER_EXPORT FilterTheBat : public Filter { public: FilterTheBat(); ~FilterTheBat() override; void import() override; void importMails(const QString &maildir); private: void importDirContents(const QString &); void importFiles(const QString &); void processDirectory(const QString &path); FilterTheBatPrivate *const d; }; } #endif diff --git a/src/mailimporter/filters/filterthunderbird.h b/src/mailimporter/filters/filterthunderbird.h index 96b42df..3287870 100644 --- a/src/mailimporter/filters/filterthunderbird.h +++ b/src/mailimporter/filters/filterthunderbird.h @@ -1,54 +1,54 @@ /*************************************************************************** filter_thunderbird.h - Thunderbird mail import ------------------- begin : Januar 26 2005 copyright : (C) 2005 by Danny Kukawka email : danny.kukawka@web.de ***************************************************************************/ /* Copyright (c) 2012-2019 Montel Laurent */ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MAILIMPORTER_FILTER_THUNDERBIRD_H #define MAILIMPORTER_FILTER_THUNDERBIRD_H #include "filters.h" +namespace MailImporter { /** * Imports Thunderbird mail folder recursively, keeping the folder structure. * @author Danny Kukawka */ -namespace MailImporter { class MAILIMPORTER_EXPORT FilterThunderbird : public Filter { public: FilterThunderbird(); ~FilterThunderbird() override; void import() override; void importMails(const QString &maildir); Q_REQUIRED_RESULT static QString defaultSettingsPath(); Q_REQUIRED_RESULT static QString defaultProfile(const QString &defaultSettingPath, QWidget *parent = nullptr); Q_REQUIRED_RESULT static QMap listProfile(QString ¤tProfile, const QString &defaultSettingPath); Q_REQUIRED_RESULT static QString isMailerFound(); protected: Q_REQUIRED_RESULT virtual QString defaultInstallFolder() const; Q_REQUIRED_RESULT virtual QString settingsPath(); private: void importDirContents(const QString &, const QString &, const QString &); void importMBox(const QString &, const QString &, const QString &); Q_REQUIRED_RESULT bool excludeFiles(const QString &file); }; } #endif diff --git a/src/mailimporter/importmailswidget.h b/src/mailimporter/importmailswidget.h index acc6544..4ad8727 100644 --- a/src/mailimporter/importmailswidget.h +++ b/src/mailimporter/importmailswidget.h @@ -1,51 +1,55 @@ /* Copyright (c) 2012-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef IMPORTMAILSWIDGET_H #define IMPORTMAILSWIDGET_H #include #include "mailimporter_export.h" class QListWidgetItem; namespace MailImporter { class ImportMailsWidgetPrivate; +/** + * @brief The ImportMailsWidget class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT ImportMailsWidget : public QWidget { Q_OBJECT public: explicit ImportMailsWidget(QWidget *parent = nullptr); ~ImportMailsWidget(); void setStatusMessage(const QString &status); void setFrom(const QString &from); void setTo(const QString &to); void setCurrent(const QString ¤t); void setCurrent(int percent); void setOverall(int percent); void addItem(QListWidgetItem *item); void setLastCurrentItem(); void clear(); void addInfoLogEntry(const QString &log); void addErrorLogEntry(const QString &log); private: ImportMailsWidgetPrivate *const d; }; } #endif // IMPORTMAILSWIDGET_H diff --git a/src/mailimporter/messagestatus.h b/src/mailimporter/messagestatus.h index e5b4a13..3a294ea 100644 --- a/src/mailimporter/messagestatus.h +++ b/src/mailimporter/messagestatus.h @@ -1,50 +1,54 @@ /* Copyright (C) 2017-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef MESSAGESTATUS_H #define MESSAGESTATUS_H #include "mailimporter_export.h" #include namespace MailImporter { +/** + * @brief The MessageStatus class + * @author Laurent Montel + */ class MAILIMPORTER_EXPORT MessageStatus { public: MessageStatus(); ~MessageStatus(); void setRead(bool state); Q_REQUIRED_RESULT bool isRead() const; void setDeleted(bool state); Q_REQUIRED_RESULT bool isDeleted() const; void setReplied(bool state); Q_REQUIRED_RESULT bool isReplied() const; void setForwarded(bool state); Q_REQUIRED_RESULT bool isForwarded() const; private: bool mRead = false; bool mDeleted = false; bool mReplied = false; bool mForwarded = false; }; } #endif // MESSAGESTATUS_H diff --git a/src/mailimporterakonadi/filterimporterakonadi.h b/src/mailimporterakonadi/filterimporterakonadi.h index 02d9b75..2d73aa7 100644 --- a/src/mailimporterakonadi/filterimporterakonadi.h +++ b/src/mailimporterakonadi/filterimporterakonadi.h @@ -1,78 +1,82 @@ /* Copyright (C) 2017-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FILTERIMPORTERAKONADI_H #define FILTERIMPORTERAKONADI_H #include #include #include #include #include "mailimporterakonadi_export.h" #include namespace MailImporter { +/** + * @brief The FilterImporterAkonadi class + * @author Laurent Montel + */ class MAILIMPORTERAKONADI_EXPORT FilterImporterAkonadi : public MailImporter::FilterImporterBase { public: FilterImporterAkonadi(MailImporter::FilterInfo *info); ~FilterImporterAkonadi() override; bool importMessage(const QString &folderName, const QString &msgPath, bool duplicateCheck, const MailImporter::MessageStatus &status) override; void clear() override; void clearCountDuplicate() override; int countDuplicates() const override; static Akonadi::MessageStatus convertToAkonadiMessageStatus(const MailImporter::MessageStatus &status); Akonadi::Collection rootCollection() const; void setRootCollection(const Akonadi::Collection &collection); QString topLevelFolder() const override; bool importMessage(const KArchiveFile *file, const QString &folderPath, int &nbTotal, int &fileDone) override; private: /** * Creates a hierachy of collections based on the given path string. The collection * hierachy will be placed under the root collection. * For example, if the folderParseString "foo/bar/test" is passsed to this method, it * will make sure the root collection has a subcollection named "foo", which in turn * has a subcollection named "bar", which again has a subcollection named "test". * The "test" collection will be returned. * An invalid collection will be returned in case of an error. */ Akonadi::Collection parseFolderString(const QString &folderParseString); /** * Checks for duplicate messages in the collection by message ID. * returns true if a duplicate was detected. * NOTE: Only call this method if a message ID exists, otherwise * you could get false positives. */ bool checkForDuplicates(const QString &msgID, const Akonadi::Collection &msgCollection, const QString &messageFolder); /** * Adds a single subcollection to the given base collection and returns it. * Use parseFolderString() instead if you want to create hierachies of collections. */ Akonadi::Collection addSubCollection(const Akonadi::Collection &baseCollection, const QString &newCollectionPathName); bool addAkonadiMessage(const Akonadi::Collection &collection, const KMime::Message::Ptr &message, Akonadi::MessageStatus status); QMultiMap mMessageFolderMessageIDMap; QMap mMessageFolderCollectionMap; Akonadi::Collection mRootCollection; int mCountDuplicates = 0; }; } #endif // FILTERIMPORTERAKONADI_H