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
22 #ifndef QUICKSEARCHWIDGET_H
23 #define QUICKSEARCHWIDGET_H
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
45 * Creates the quick search widget.
47 * @param parent The parent widget.
49 explicit QuickSearchWidget(QWidget
*parent
= Q_NULLPTR
);
52 * Destroys the quick search widget.
54 virtual ~QuickSearchWidget();
57 * Returns the size hint of the quick search widget.
59 QSize
sizeHint() const Q_DECL_OVERRIDE
;
61 void updateQuickSearchText(const QString
&text
);
64 void slotFocusQuickSearch();
68 * This signal is emitted whenever the user has changed
69 * the filter string in the line edit.
71 * @param filterString The new filter string.
73 void filterStringChanged(const QString
&filterString
);
76 * This signal is emitted whenever the user pressed the
77 * arrow down key. In this case we set the focus on the
78 * item view that shows the contacts, so the user can
79 * navigate much faster.
81 void arrowDownKeyPressed();
85 void delayedTextChanged();
88 void keyPressEvent(QKeyEvent
*) Q_DECL_OVERRIDE
;