00001 /* 00002 Copyright 2010 Ulrich Weigelt <ulrich.weigelt@gmx.de> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #ifndef FILTERLOGENTRY_H 00019 #define FILTERLOGENTRY_H 00020 00021 //Qt headers 00022 #include <qstring.h> 00023 #include <qdom.h> 00024 00025 //KDE headers 00026 #include <kdebug.h> 00027 #include <KDateTime> 00028 00029 //KShowmail headers 00030 #include "types.h" 00031 #include "constants.h" 00032 00033 using namespace Types; 00034 00042 class FilterLogEntry{ 00043 00044 public: 00045 00049 FilterLogEntry(); 00050 00062 FilterLogEntry( FilterAction_Type action, const KDateTime& dateTime, const QString& sender, const QString& account, const QString& subject, const QString& mailbox = QString(), KindOfMailDeleting kindDelete = DelFilter, const QString& filter = QString() ); 00063 00068 FilterLogEntry( const FilterLogEntry& ent ); 00069 00073 ~FilterLogEntry(); 00074 00079 FilterLogEntry& operator=( const FilterLogEntry& ent ); 00080 00086 bool operator==( const FilterLogEntry& ent ) const; 00087 00093 bool operator!=( const FilterLogEntry& ent ) const; 00094 00100 bool operator>( const FilterLogEntry& ent ) const; 00101 00107 bool operator>=( const FilterLogEntry& ent ) const; 00108 00114 bool operator<( const FilterLogEntry& ent ) const; 00115 00121 bool operator<=( const FilterLogEntry& ent ) const; 00122 00126 void print(); 00127 00133 bool isOlder( uint days ); 00134 00140 void save( QDomDocument& doc, QDomElement& parent ); 00141 00146 KDateTime getDate() const; 00147 00152 QString getSender() const; 00153 00158 QString getAccount() const; 00159 00164 QString getSubject() const; 00165 00170 QString getMailbox() const; 00171 00175 QString getFilter() const; 00176 00181 KindOfMailDeleting getKindOfDeleting() const; 00182 00190 int compare( const FilterLogEntry& other, LogViewSort property ) const; 00191 00192 private: 00193 00197 FilterAction_Type act; 00198 00202 KDateTime sentDateTime; 00203 00207 QString sender; 00208 00212 QString account; 00213 00217 QString subject; 00218 00222 QString mailbox; 00223 00227 KindOfMailDeleting kindDel; 00228 00232 QString filter; 00233 00234 }; 00235 00236 #endif