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 00060 FilterLogEntry( FilterAction_Type action, const KDateTime& dateTime, const QString& sender, const QString& account, const QString& subject, const QString& mailbox = QString() ); 00061 00066 FilterLogEntry( const FilterLogEntry& ent ); 00067 00071 ~FilterLogEntry(); 00072 00077 FilterLogEntry& operator=( const FilterLogEntry& ent ); 00078 00084 bool operator==( const FilterLogEntry& ent ) const; 00085 00091 bool operator!=( const FilterLogEntry& ent ) const; 00092 00098 bool operator>( const FilterLogEntry& ent ) const; 00099 00105 bool operator>=( const FilterLogEntry& ent ) const; 00106 00112 bool operator<( const FilterLogEntry& ent ) const; 00113 00119 bool operator<=( const FilterLogEntry& ent ) const; 00120 00124 void print(); 00125 00131 bool isOlder( uint days ); 00132 00138 void save( QDomDocument& doc, QDomElement& parent ); 00139 00144 KDateTime getDate() const; 00145 00150 QString getSender() const; 00151 00156 QString getAccount() const; 00157 00162 QString getSubject() const; 00163 00168 QString getMailbox() const; 00169 00177 int compare( const FilterLogEntry& other, LogViewSort property ) const; 00178 00179 private: 00180 00184 FilterAction_Type act; 00185 00189 KDateTime sentDateTime; 00190 00194 QString sender; 00195 00199 QString account; 00200 00204 QString subject; 00205 00209 QString mailbox; 00210 00211 }; 00212 00213 #endif