kalarm

find.h
1 /*
2  * find.h - search facility
3  * Program: kalarm
4  * Copyright © 2005,2006,2008 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef FIND_H
22 #define FIND_H
23 
24 #include <tqobject.h>
25 #include <tqguardedptr.h>
26 #include <tqstringlist.h>
27 
28 class TQCheckBox;
29 class KFindDialog;
30 class KFind;
31 class KSeparator;
32 class EventListViewBase;
33 class EventListViewItemBase;
34 
35 
36 class Find : public TQObject
37 {
38  TQ_OBJECT
39 
40  public:
41  explicit Find(EventListViewBase* parent);
42  ~Find();
43  void display();
44  void findNext(bool forward) { findNext(forward, true); }
45 
46  signals:
47  void active(bool);
48 
49  private slots:
50  void slotFind();
51  void slotKFindDestroyed() { emit active(false); }
52 
53  private:
54  void findNext(bool forward, bool sort, bool checkEnd = false, bool fromCurrent = false);
55  EventListViewItemBase* nextItem(EventListViewItemBase*, bool forward) const;
56 
57  EventListViewBase* mListView; // parent list view
58  TQGuardedPtr<KFindDialog> mDialog;
59  TQCheckBox* mExpired;
60  TQCheckBox* mLive;
61  KSeparator* mActiveExpiredSep;
62  TQCheckBox* mMessageType;
63  TQCheckBox* mFileType;
64  TQCheckBox* mCommandType;
65  TQCheckBox* mEmailType;
66  KFind* mFind;
67  TQStringList mHistory; // list of history items for Find dialog
68  TQString mLastPattern; // pattern used in last search
69  TQString mStartID; // ID of first alarm searched if 'from cursor' was selected
70  long mOptions; // OR of find dialog options
71  bool mNoCurrentItem; // there is no current item for the purposes of searching
72  bool mFound; // true if any matches have been found
73 };
74 
75 #endif // FIND_H
76