Merge branch 'master' of git://anongit.kde.org/kdepim
[kdepim.git] / kalarm / find.h
blob809bfbe8959694c11fd339920611acef3ac2923b
1 /*
2 * find.h - search facility
3 * Program: kalarm
4 * Copyright © 2005-2009 by David Jarvie <djarvie@kde.org>
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.
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.
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.
21 #ifndef FIND_H
22 #define FIND_H
24 #include <QObject>
25 #include <QPointer>
26 #include <QStringList>
27 #include <QModelIndex>
29 class QCheckBox;
30 class KFindDialog;
31 class KFind;
32 class KSeparator;
33 class EventListView;
36 class Find : public QObject
38 Q_OBJECT
39 public:
40 explicit Find(EventListView* parent);
41 ~Find();
42 void display();
43 void findNext(bool forward) { findNext(forward, false, false); }
45 Q_SIGNALS:
46 void active(bool);
48 private Q_SLOTS:
49 void slotFind();
50 void slotKFindDestroyed() { Q_EMIT active(false); }
51 void slotSelectionChanged();
53 private:
54 void findNext(bool forward, bool checkEnd, bool fromCurrent);
55 QModelIndex nextItem(const QModelIndex&, bool forward) const;
57 EventListView* mListView; // parent list view
58 QPointer<KFindDialog> mDialog;
59 QCheckBox* mArchived;
60 QCheckBox* mLive;
61 KSeparator* mActiveArchivedSep;
62 QCheckBox* mMessageType;
63 QCheckBox* mFileType;
64 QCheckBox* mCommandType;
65 QCheckBox* mEmailType;
66 QCheckBox* mAudioType;
67 KFind* mFind;
68 QStringList mHistory; // list of history items for Find dialog
69 QString mLastPattern; // pattern used in last search
70 QString mStartID; // ID of first alarm searched if 'from cursor' was selected
71 long mOptions; // OR of find dialog options
72 bool mNoCurrentItem; // there is no current item for the purposes of searching
73 bool mFound; // true if any matches have been found
76 #endif // FIND_H
78 // vim: et sw=4: