Make me trust this output by using the original enums.
[kdepim.git] / kaddressbook / quicksearchwidget.h
blob6468a2f60102d02fd5ecac3aeb49b54c95fdbbe5
1 /*
2 This file is part of KAddressBook.
4 Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Library General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
11 This library is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301, USA.
22 #ifndef QUICKSEARCHWIDGET_H
23 #define QUICKSEARCHWIDGET_H
25 #include <QtGui/QWidget>
27 class KLineEdit;
29 /**
30 * @short The quick search widget from the toolbar
32 * This widget allows the user to filter for contacts
33 * that match a given string criteria.
34 * The filter string the user enters here is emitted to
35 * the ContactsFilterModel, which does the real filtering.
37 * @author Tobias Koenig <tokoe@kde.org>
39 class QuickSearchWidget : public QWidget
41 Q_OBJECT
43 public:
44 /**
45 * Creates the quick search widget.
47 * @param parent The parent widget.
49 QuickSearchWidget( QWidget *parent = 0 );
51 /**
52 * Destroys the quick search widget.
54 virtual ~QuickSearchWidget();
56 /**
57 * Returns the size hint of the quick search widget.
59 virtual QSize sizeHint() const;
61 Q_SIGNALS:
62 /**
63 * This signal is emitted whenever the user has changed
64 * the filter string in the line edit.
66 * @param filterString The new filter string.
68 void filterStringChanged( const QString &filterString );
70 /**
71 * This signal is emitted whenever the user pressed the
72 * arrow down key. In this case we set the focus on the
73 * item view that shows the contacts, so the user can
74 * navigate much faster.
76 void arrowDownKeyPressed();
78 private Q_SLOTS:
79 void resetTimer();
80 void delayedTextChanged();
82 protected:
83 virtual void keyPressEvent( QKeyEvent* );
85 private:
86 KLineEdit *mEdit;
87 QTimer *mTimer;
90 #endif