SVN_SILENT made messages (.desktop file)
[kdepim.git] / mailimporter / filter_pmail.h
blob53b7f21c6fc6e0f4b910f57e48bcc5b9c36c922a
1 /***************************************************************************
2 FilterPMail.h - Pegasus-Mail import
3 -------------------
4 begin : Sat Jan 6 2001
5 copyright : (C) 2001 by Holger Schurig
6 email : holgerschurig@gmx.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #ifndef MAILIMPORTER_FILTER_PMAIL_HXX
19 #define MAILIMPORTER_FILTER_PMAIL_HXX
21 #include <QDir>
23 #include "filters.h"
24 #include "mailimporter_utils.h"
25 namespace MailImporter {
26 class MAILIMPORTER_EXPORT FilterPMail : public Filter
28 public:
29 explicit FilterPMail();
30 ~FilterPMail();
32 void import();
33 void importMails( const QString & chosenDir );
35 protected:
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);
49 private:
50 /** the working directory */
51 QDir dir;
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;
65 bool folderParsed;
67 /** which file (of totalFiles) is now in the work? */
68 int currentFile;
69 /** total number of files that get imported */
70 int totalFiles;
74 #endif