MailImporter

filterpmail.h
1/*
2 filterpmail.h - Pegasus-Mail import
3
4 SPDX-FileCopyrightText: 2001 Holger Schurig <holgerschurig@gmx.de>
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#pragma once
10
11#include <QDir>
12
13#include "filters.h"
14#include "mailimporter_utils.h"
15namespace MailImporter
16{
17/**
18 * @brief The FilterPMail class
19 */
20class MAILIMPORTER_EXPORT FilterPMail : public Filter
21{
22public:
24 ~FilterPMail() override;
25
26 void import() override;
27 void importMails(const QString &chosenDir);
28
29protected:
30 /** this looks for all files with the filemask 'mask' and calls the 'workFunc' on each of them */
31 void processFiles(const QString &mask, void (FilterPMail::*workFunc)(const QString &));
32 /** this function imports one *.CNM message */
33 void importNewMessage(const QString &file);
34 /** this function imports one mail folder file (*.PMM) */
35 void importMailFolder(const QString &file);
36 /** imports a 'unix' format mail folder (*.MBX) */
37 void importUnixMailFolder(const QString &file);
38 /** this function recreate the folder structure */
39 bool parseFolderMatrix(const QString &chosenDir);
40 /** this function parse the folder structure */
41 QString getFolderName(const QString &ID);
42
43private:
44 /** the working directory */
45 QDir dir;
46
47 /** Folder structure here has 5 entries. */
49 /** List with the folder matrix, which contains following strings:
50 1. type (2 for root-folder, 1 for folder, 0 for mailarchiv)
51 2. type (1 for root-folder, 3 for folder, 0 for mailarchiv)
52 3. "ID:flag:filename" of folder/archive
53 4. "ID:name" of parent folder
54 5. name of folder/archive
55 */
56 QList<FolderStructure> folderMatrix;
57 using FolderStructureIterator = QList<FolderStructure>::Iterator;
58
59 bool folderParsed = false;
60
61 /** which file (of totalFiles) is now in the work? */
62 int currentFile = 0;
63 /** total number of files that get imported */
64 int totalFiles = 0;
65};
66}
The FilterPMail class.
Definition filterpmail.h:21
The Filter class.
Definition filters.h:29
Glorified QString[N] for (a) understandability (b) older gcc compatibility.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:39 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.