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 <tqobject.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 TQObject *parent, const char *name = 0 );
00051
00061 void search( const TQString &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 void setSelectedDistributionList( const TQString &name );
00074
00078 KPIM::DistributionList::List distributionLists() const;
00079
00083 TQStringList distributionListNames() const;
00084 #endif
00085
00086 signals:
00090 void contactsUpdated();
00091
00092 public slots:
00093 void reload();
00094
00095 private:
00096 KABC::Addressee::List mContacts;
00097 #ifdef KDEPIM_NEW_DISTRLISTS
00098 TQString mSelectedDistributionList;
00099 KPIM::DistributionList::List mDistributionLists;
00100 #endif
00101 KABC::AddressBook *mAddressBook;
00102
00103 TQString mPattern;
00104 KABC::Field::List mFields;
00105 Type mType;
00106 };
00107
00108 }
00109
00110 #endif
|