From b289dd9bf618a2512cbf15b2a6fc4ae77e4792c8 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 19 Jun 2016 12:27:38 +0200 Subject: Moved mailpreprocessors to a shared location --- common/mailpreprocessor.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 common/mailpreprocessor.h (limited to 'common/mailpreprocessor.h') diff --git a/common/mailpreprocessor.h b/common/mailpreprocessor.h new file mode 100644 index 0000000..715e336 --- /dev/null +++ b/common/mailpreprocessor.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2015 Christian Mollekopf + * + * 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. + */ +#include "sink_export.h" + +#include "pipeline.h" + +class SINK_EXPORT MailPropertyExtractor : public Sink::EntityPreprocessor +{ +public: + virtual ~MailPropertyExtractor(){} + virtual void newEntity(Sink::ApplicationDomain::Mail &mail, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE; + virtual void modifiedEntity(const Sink::ApplicationDomain::Mail &oldMail, Sink::ApplicationDomain::Mail &newMail,Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE; +private: + void updatedIndexedProperties(Sink::ApplicationDomain::Mail &mail); +}; + +class SINK_EXPORT MimeMessageMover : public Sink::EntityPreprocessor +{ +public: + MimeMessageMover(); + virtual ~MimeMessageMover(){} + + void newEntity(Sink::ApplicationDomain::Mail &mail, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE; + void modifiedEntity(const Sink::ApplicationDomain::Mail &oldMail, Sink::ApplicationDomain::Mail &newMail, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE; + void deletedEntity(const Sink::ApplicationDomain::Mail &mail, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE; + +private: + QString moveMessage(const QString &oldPath, const Sink::ApplicationDomain::Mail &mail); +}; -- cgit v1.2.3