kaddressbook
ldapsearchdialog.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef LDAPSEARCHDIALOG_H
00022 #define LDAPSEARCHDIALOG_H
00023
00024 #include "config.h"
00025
00026 #include <qptrlist.h>
00027
00028 #include <kabc/addressbook.h>
00029 #include <ldapclient.h>
00030 #include <kdialogbase.h>
00031
00032 #ifdef KDEPIM_NEW_DISTRLISTS
00033 #include <libkdepim/distributionlist.h>
00034 #endif
00035
00036 class KAddressBookTableView;
00037 class KComboBox;
00038 class KLineEdit;
00039
00040 class QCheckBox;
00041 class QListView;
00042 class QPushButton;
00043 class KABCore;
00044 class ContactListItem;
00045
00046 namespace KABC {
00047 class Resource;
00048 }
00049
00050 class LDAPSearchDialog : public KDialogBase
00051 {
00052 Q_OBJECT
00053
00054 public:
00055 LDAPSearchDialog( KABC::AddressBook *ab, KABCore *core, QWidget* parent, const char* name = 0 );
00056 ~LDAPSearchDialog();
00057
00058 bool isOK() const { return mIsOK; }
00059
00060 void restoreSettings();
00061
00062 signals:
00063 void addresseesAdded();
00064
00065 protected slots:
00066 void slotAddResult( const KPIM::LdapObject& obj );
00067 void slotSetScope( bool rec );
00068 void slotStartSearch();
00069 void slotStopSearch();
00070 void slotSearchDone();
00071 void slotError( const QString& );
00072 virtual void slotHelp();
00073 virtual void slotUser1();
00074 virtual void slotUser2();
00075 void slotSelectAll();
00076 void slotUnselectAll();
00082 KABC::Addressee::List importContactsUnlessTheyExist( const QValueList<ContactListItem*>& items, KABC::Resource * const resource );
00083
00084 protected:
00085 QString selectedEMails() const;
00086
00087 virtual void closeEvent( QCloseEvent* );
00088
00089 private:
00090 void saveSettings();
00091 static KABC::Addressee convertLdapAttributesToAddressee( const KPIM::LdapAttrMap& attrs );
00092 #ifdef KDEPIM_NEW_DISTRLISTS
00093 KPIM::DistributionList selectDistributionList();
00094 #endif
00095
00096 QString makeFilter( const QString& query, const QString& attr, bool startsWith );
00097
00098 void cancelQuery();
00099
00100 int mNumHosts;
00101 QPtrList<KPIM::LdapClient> mLdapClientList;
00102 bool mIsOK;
00103 KABC::AddressBook *mAddressBook;
00104 KABCore *mCore;
00105
00106 KComboBox* mFilterCombo;
00107 KComboBox* mSearchType;
00108 KLineEdit* mSearchEdit;
00109
00110 QCheckBox* mRecursiveCheckbox;
00111 QListView* mResultListView;
00112 QPushButton* mSearchButton;
00113 class Private;
00114 Private* const d;
00115 };
00116
00117 #endif
|