find.h
00001 /* 00002 * find.h - search facility 00003 * Program: kalarm 00004 * Copyright © 2005,2006,2008 by David Jarvie <djarvie@kde.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef FIND_H 00022 #define FIND_H 00023 00024 #include <tqobject.h> 00025 #include <tqguardedptr.h> 00026 #include <tqstringlist.h> 00027 00028 class TQCheckBox; 00029 class KFindDialog; 00030 class KFind; 00031 class KSeparator; 00032 class EventListViewBase; 00033 class EventListViewItemBase; 00034 00035 00036 class Find : public TQObject 00037 { 00038 Q_OBJECT 00039 00040 public: 00041 explicit Find(EventListViewBase* parent); 00042 ~Find(); 00043 void display(); 00044 void findNext(bool forward) { findNext(forward, true); } 00045 00046 signals: 00047 void active(bool); 00048 00049 private slots: 00050 void slotFind(); 00051 void slotKFindDestroyed() { emit active(false); } 00052 00053 private: 00054 void findNext(bool forward, bool sort, bool checkEnd = false, bool fromCurrent = false); 00055 EventListViewItemBase* nextItem(EventListViewItemBase*, bool forward) const; 00056 00057 EventListViewBase* mListView; // parent list view 00058 TQGuardedPtr<KFindDialog> mDialog; 00059 TQCheckBox* mExpired; 00060 TQCheckBox* mLive; 00061 KSeparator* mActiveExpiredSep; 00062 TQCheckBox* mMessageType; 00063 TQCheckBox* mFileType; 00064 TQCheckBox* mCommandType; 00065 TQCheckBox* mEmailType; 00066 KFind* mFind; 00067 TQStringList mHistory; // list of history items for Find dialog 00068 TQString mLastPattern; // pattern used in last search 00069 TQString mStartID; // ID of first alarm searched if 'from cursor' was selected 00070 long mOptions; // OR of find dialog options 00071 bool mNoCurrentItem; // there is no current item for the purposes of searching 00072 bool mFound; // true if any matches have been found 00073 }; 00074 00075 #endif // FIND_H 00076