headerlistquicksearch.h
00001 /* -*- mode: C++ -*- 00002 This file is part of KMail, the KDE mail client. 00003 Copyright (c) 2004 Till Adam <adam@kde.org> 00004 00005 KMail 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 KMail is distributed in the hope that it will be useful, but 00011 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 In addition, as a special exception, the copyright holders give 00020 permission to link the code of this program with any edition of 00021 the TQt library by Trolltech AS, Norway (or with modified versions 00022 of TQt that use the same license as TQt), and distribute linked 00023 combinations including the two. You must obey the GNU General 00024 Public License in all respects for all of the code used other than 00025 TQt. If you modify this file, you may extend this exception to 00026 your version of the file, but you are not obligated to do so. If 00027 you do not wish to do so, delete this exception statement from 00028 your version. 00029 */ 00030 00031 #ifndef KMAILHEADERLISQUICKSEARCH_H 00032 #define KMAILHEADERLISQUICKSEARCH_H 00033 00034 #include "kmmsgbase.h" // for KMMsgStatus 00035 #include "kmsearchpattern.h" 00036 #include <tdelistviewsearchline.h> 00037 #include <tqvaluevector.h> 00038 class TQComboBox; 00039 class TQLabel; 00040 class TDEListView; 00041 class TDEActionCollection; 00042 00043 namespace KMail { 00044 00045 class HeaderListQuickSearch : public TDEListViewSearchLine 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 HeaderListQuickSearch( TQWidget *parent, 00051 TDEListView *listView, 00052 TDEActionCollection *actionCollection, 00053 const char *name = 0 ); 00054 virtual ~HeaderListQuickSearch(); 00055 00060 bool eventFilter( TQObject *watched, TQEvent *event ); 00061 00065 TQString currentSearchTerm() const; 00066 00070 int currenStatus() const; 00071 00072 public slots: 00073 void reset(); 00074 00075 signals: 00076 void requestFullSearch(); 00077 00078 protected: 00083 virtual bool itemMatches(const TQListViewItem *item, const TQString &s) const; 00084 00085 private slots: 00090 void slotStatusChanged( int index ); 00091 00092 private: 00094 void inserStatus(KMail::StatusValueTypes which); 00095 TQComboBox *mStatusCombo; 00096 KMMsgStatus mStatus; 00097 TQValueVector<TQString> statusList; 00098 mutable TQString mCurrentSearchTerm; 00099 }; 00100 00101 } 00102 00103 #endif