1 /***************************************************************************
2 FilterPMail.h - Pegasus-Mail import
5 copyright : (C) 2001 by Holger Schurig
6 email : holgerschurig@gmx.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #ifndef MAILIMPORTER_FILTER_PMAIL_HXX
19 #define MAILIMPORTER_FILTER_PMAIL_HXX
24 #include "mailimporter_utils.h"
25 namespace MailImporter
{
26 class MAILIMPORTER_EXPORT FilterPMail
: public Filter
29 explicit FilterPMail();
33 void importMails( const QString
& chosenDir
);
36 /** this looks for all files with the filemask 'mask' and calls the 'workFunc' on each of them */
37 void processFiles(const QString
& mask
, void(FilterPMail::* workFunc
)(const QString
&) );
38 /** this function imports one *.CNM message */
39 void importNewMessage(const QString
& file
);
40 /** this function imports one mail folder file (*.PMM) */
41 void importMailFolder(const QString
& file
);
42 /** imports a 'unix' format mail folder (*.MBX) */
43 void importUnixMailFolder(const QString
& file
);
44 /** this function recreate the folder structure */
45 bool parseFolderMatrix(const QString
& chosenDir
);
46 /** this function parse the folder structure */
47 QString
getFolderName(const QString
& ID
);
50 /** the working directory */
53 /** Folder structure here has 5 entries. */
54 typedef FolderStructureBase
<5> FolderStructure
;
55 /** List with the folder matrix, which contains following strings:
56 1. type (2 for root-folder, 1 for folder, 0 for mailarchiv)
57 2. type (1 for root-folder, 3 for folder, 0 for mailarchiv)
58 3. "ID:flag:filename" of folder/archiv
59 4. "ID:name" of parent folder
60 5. name of folder/archiv
62 QList
<FolderStructure
> folderMatrix
;
63 typedef QList
<FolderStructure
>::Iterator FolderStructureIterator
;
67 /** which file (of totalFiles) is now in the work? */
69 /** total number of files that get imported */