filteractionjob.h

00001 /*
00002     Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef AKONADI_FILTERACTIONJOB_H
00021 #define AKONADI_FILTERACTIONJOB_H
00022 
00023 #include <mailtransport/mailtransport_export.h>
00024 
00025 #include <akonadi/item.h>
00026 #include <akonadi/transactionsequence.h>
00027 
00028 namespace Akonadi {
00029 
00030 class Collection;
00031 class ItemFetchScope;
00032 class Job;
00033 
00072 class MAILTRANSPORT_EXPORT FilterAction
00073 {
00074   public:
00080     virtual ~FilterAction();
00081 
00089     virtual Akonadi::ItemFetchScope fetchScope() const = 0;
00090 
00095     virtual bool itemAccepted( const Akonadi::Item &item ) const = 0;
00096 
00101     virtual Akonadi::Job *itemAction( const Akonadi::Item &item ) const = 0;
00102 };
00103 
00125 class MAILTRANSPORT_EXPORT FilterActionJob : public TransactionSequence
00126 {
00127   Q_OBJECT
00128 
00129   public:
00137     FilterActionJob( const Item &item, FilterAction *functor, QObject *parent = 0 );
00138 
00146     FilterActionJob( const Item::List &items, FilterAction *functor, QObject *parent = 0 );
00147 
00156     FilterActionJob( const Collection &collection, FilterAction *functor, QObject *parent = 0 );
00157 
00161     ~FilterActionJob();
00162 
00163   protected:
00164     /* reimpl */
00165     virtual void doStart();
00166 
00167   private:
00168     //@cond PRIVATE
00169     class Private;
00170     Private *const d;
00171 
00172     Q_PRIVATE_SLOT( d, void fetchResult( KJob* ) )
00173     //@endcond
00174 };
00175 
00176 } // namespace Akonadi
00177 
00178 #endif // AKONADI_FILTERACTIONJOB_H
KDE Home | KDE Accessibility Home | Description of Access Keys