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 TQObject
00038 {
00039 Q_OBJECT
00040 TQ_OBJECT
00041
00042 public:
00043 enum Type {
00044 StartsWith,
00045 EndsWith,
00046 Contains,
00047 Equals
00048 };
00049
00050 SearchManager( KABC::AddressBook *ab,
00051 TQObject *parent, const char *name = 0 );
00052
00062 void search( const TQString &pattern, const KABC::Field::List &fields, Type type = Contains );
00063
00067 KABC::Addressee::List contacts() const;
00068
00069
00070 #ifdef KDEPIM_NEW_DISTRLISTS
00071
00074 void setSelectedDistributionList( const TQString &name );
00075
00079 KPIM::DistributionList::List distributionLists() const;
00080
00084 TQStringList distributionListNames() const;
00085 #endif
00086
00087 signals:
00091 void contactsUpdated();
00092
00093 public slots:
00094 void reload();
00095
00096 private:
00097 KABC::Addressee::List mContacts;
00098 #ifdef KDEPIM_NEW_DISTRLISTS
00099 TQString mSelectedDistributionList;
00100 KPIM::DistributionList::List mDistributionLists;
00101 #endif
00102 KABC::AddressBook *mAddressBook;
00103
00104 TQString mPattern;
00105 KABC::Field::List mFields;
00106 Type mType;
00107 };
00108
00109 }
00110
00111 #endif
|