kaddressbook
searchmanager.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef SEARCHMANAGER_H
00025 #define SEARCHMANAGER_H
00026
00027 #include <config.h>
00028 #include <qobject.h>
00029
00030 #include <kabc/stdaddressbook.h>
00031 #ifdef KDEPIM_NEW_DISTRLISTS
00032 #include <libkdepim/distributionlist.h>
00033 #endif
00034
00035 namespace KAB {
00036
00037 class SearchManager : public QObject
00038 {
00039 Q_OBJECT
00040
00041 public:
00042 enum Type {
00043 StartsWith,
00044 EndsWith,
00045 Contains,
00046 Equals
00047 };
00048
00049 SearchManager( KABC::AddressBook *ab,
00050 QObject *parent, const char *name = 0 );
00051
00061 void search( const QString &pattern, const KABC::Field::List &fields, Type type = Contains );
00062
00066 KABC::Addressee::List contacts() const;
00067
00068
00069 #ifdef KDEPIM_NEW_DISTRLISTS
00070
00073 KPIM::DistributionList::List distributionLists() const;
00074
00078 QStringList distributionListNames() const;
00079 #endif
00080
00081 signals:
00085 void contactsUpdated();
00086
00087 public slots:
00088 void reload();
00089
00090 private:
00091 KABC::Addressee::List mContacts;
00092 #ifdef KDEPIM_NEW_DISTRLISTS
00093 KPIM::DistributionList::List mDistributionLists;
00094 #endif
00095 KABC::AddressBook *mAddressBook;
00096
00097 QString mPattern;
00098 KABC::Field::List mFields;
00099 Type mType;
00100 };
00101
00102 }
00103
00104 #endif
|