MailImporter

filters.h
1/*
2 SPDX-FileCopyrightText: 2000 Hans Dijkema <kmailcvt@hum.org>
3 SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9
10#ifndef MAX_LINE
11#define MAX_LINE 4096
12#endif
13
14#include "filterinfo.h"
15#include "mailimporter_export.h"
16
17#include <MailImporter/FilterImporterBase>
18
19#include <QDir>
20#include <memory>
21
22namespace MailImporter
23{
24/**
25 * @brief The Filter class
26 * @author Laurent Montel <montel@kde.org>
27 */
28class MAILIMPORTER_EXPORT Filter
29{
30public:
31 explicit Filter(const QString &name, const QString &author, const QString &info = QString());
32 virtual ~Filter();
33 virtual void import() = 0;
34
35 [[nodiscard]] QString author() const;
36 [[nodiscard]] QString name() const;
37 [[nodiscard]] QString info() const;
38
39 void setAuthor(const QString &);
40 void setName(const QString &);
41 void setInfo(const QString &);
42
43 void clear();
44 void setFilterInfo(MailImporter::FilterInfo *info);
45
46 MailImporter::FilterInfo *filterInfo() const;
47
48 void setFilterImporter(MailImporter::FilterImporterBase *importer);
49 MailImporter::FilterImporterBase *filterImporter() const;
50
51 void clearCountDuplicate();
52 [[nodiscard]] int countDuplicates() const;
53
54 void setMailDir(const QString &mailDir);
55 [[nodiscard]] QString mailDir() const;
56
57protected:
58 static int countDirectory(const QDir &dir, bool searchHiddenDirectory);
59 [[nodiscard]] bool
60 importMessage(const QString &folderName, const QString &msgPath, bool duplicateCheck, const MessageStatus &status = MailImporter::MessageStatus());
61
62private:
63 class FilterPrivate;
64 std::unique_ptr<FilterPrivate> const d;
65};
66}
The FilterImporterBase class.
The FilterInfo class.
Definition filterinfo.h:21
The Filter class.
Definition filters.h:29
The MessageStatus class.
Q_SCRIPTABLE CaptureState status()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.