• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kmail

kmfiltermgr.h

Go to the documentation of this file.
00001 /*
00002  * kmail: KDE mail client
00003  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  *
00019  */
00020 #ifndef kmfiltermgr_h
00021 #define kmfiltermgr_h
00022 
00023 #include "kmfilteraction.h" // for KMFilterAction::ReturnCode
00024 #include "kmfolder.h"
00025 
00026 class KMFilter;
00027 class KMFilterDlg;
00028 
00029 class KMFilterMgr: public QObject
00030 {
00031   Q_OBJECT
00032 
00033 public:
00034   KMFilterMgr(bool popFilter = false);
00035   virtual ~KMFilterMgr();
00036 
00038   void clear();
00039 
00040   enum FilterSet { NoSet = 0x0, Inbound = 0x1, Outbound = 0x2, Explicit = 0x4,
00041                    All = Inbound|Outbound|Explicit };
00042 
00044   void readConfig(void);
00045 
00047   void writeConfig(bool withSync=true);
00048 
00052   void openDialog( QWidget *parent, bool checkForEmptyFilterList = true );
00053 
00056   void createFilter( const QByteArray & field, const QString & value );
00057 
00058   bool beginFiltering(KMMsgBase *msgBase) const;
00059   int moveMessage(KMMessage *msg) const;
00060   void endFiltering(KMMsgBase *msgBase) const;
00061 
00067   bool atLeastOneFilterAppliesTo( unsigned int accountID ) const;
00068 
00074   bool atLeastOneIncomingFilterAppliesTo( unsigned int accountID ) const;
00075 
00079   bool atLeastOneOnlineImapFolderTarget();
00080 
00083   const QString createUniqueName( const QString & name );
00084 
00088   void appendFilters( const QList<KMFilter*> &filters,
00089                       bool replaceIfNameExists = false );
00090 
00093   void setFilters( const QList<KMFilter*> &filters );
00094 
00096   const QList<KMFilter*> & filters() const { return mFilters; }
00097 
00112   int process( KMMessage * msg, FilterSet aSet = Inbound,
00113            bool account = false, uint accountId = 0 );
00114 
00119   int process( KMMessage * msg, const KMFilter * filter );
00120 
00123   int process( quint32 serNum, const KMFilter * filter );
00124 
00125   void cleanup();
00126 
00129   void ref();
00135   void deref(bool force = false);
00136 
00141   int tempOpenFolder(KMFolder* aFolder);
00142 
00145   void beginUpdate() {}
00146 
00148   void endUpdate();
00149 
00151 #ifndef NDEBUG
00152   void dump() const;
00153 #endif
00154 
00159   bool folderRemoved(KMFolder* aFolder, KMFolder* aNewFolder);
00160 
00163   void folderCreated(KMFolder*) {}
00164 
00166   void setShowLaterMsgs( bool show ) {
00167     mShowLater = show;
00168   }
00169 
00171   bool showLaterMsgs() const {
00172     return mShowLater;
00173   }
00174 public slots:
00175   void slotFolderRemoved( KMFolder *aFolder );
00176 
00177 signals:
00178   void filterListUpdated();
00179 
00180 private:
00181   int processPop( KMMessage * msg ) const;
00183   bool isMatching( KMMessage * msg, const KMFilter * filter );
00184   bool isMatching( quint32 serNum, const KMFilter * filter );
00185 
00186   QPointer<KMFilterDlg> mEditDialog;
00187   QVector<KMFolder *> mOpenFolders;
00188   QList<KMFilter *> mFilters;
00189   bool bPopFilter;
00190   bool mShowLater;
00191   bool mDirtyBufferedFolderTarget;
00192   bool mBufferedFolderTarget;
00193 
00194   int mRefCount;
00195 };
00196 
00197 #endif /*kmfiltermgr_h*/

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal