2 This file is part of KAddressBook.
3 Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution.
24 #ifndef SEARCHMANAGER_H
25 #define SEARCHMANAGER_H
27 #include <QtCore/QObject>
29 #include <kabc/stdaddressbook.h>
31 #include <libkdepim/distributionlist.h>
35 class SearchManager
: public QObject
47 SearchManager( KABC::AddressBook
*ab
,
48 QObject
*parent
, const char *name
= 0 );
51 This method takes a pattern and searches for a match of the specified
52 field of all available contacts. The result is propagated via
55 @param pattern The search string.
56 @param field The field which shall be compared with the search string.
57 @param type The type for the matching.
59 void search( const QString
&pattern
, const KABC::Field::List
&fields
, Type type
= Contains
);
62 Returns the contacts which matched the last search query.
64 KABC::Addressee::List
contacts() const;
67 sets the distribution list to be shown
69 void setSelectedDistributionList( const QString
&name
);
72 Returns all the distribution lists.
74 KPIM::DistributionList::List
distributionLists() const;
77 Returns the name of all the distribution lists.
79 QStringList
distributionListNames() const;
83 Emitted whenever the contacts have changed.
85 void contactsUpdated();
91 KABC::Addressee::List mContacts
;
92 QString mSelectedDistributionList
;
93 KPIM::DistributionList::List mDistributionLists
;
94 KABC::AddressBook
*mAddressBook
;
97 KABC::Field::List mFields
;