00001
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 <tqptrlist.h>
00027
00028 #include <tdeabc/addressbook.h>
00029 #include <ldapclient.h>
00030 #include <kdialogbase.h>
00031
00032 #ifdef TDEPIM_NEW_DISTRLISTS
00033 #include <libtdepim/distributionlist.h>
00034 #endif
00035
00036 class KAddressBookTableView;
00037 class KComboBox;
00038 class KLineEdit;
00039
00040 class TQCheckBox;
00041 class TQListView;
00042 class TQPushButton;
00043 class KABCore;
00044 class ContactListItem;
00045
00046 namespace TDEABC {
00047 class Resource;
00048 }
00049
00050 class LDAPSearchDialog : public KDialogBase
00051 {
00052 Q_OBJECT
00053
00054
00055 public:
00056 LDAPSearchDialog( TDEABC::AddressBook *ab, KABCore *core, TQWidget* parent, const char* name = 0 );
00057 ~LDAPSearchDialog();
00058
00059 bool isOK() const { return mIsOK; }
00060
00061 void restoreSettings();
00062
00063 signals:
00064 void addresseesAdded();
00065
00066 protected slots:
00067 void slotAddResult( const KPIM::LdapObject& obj );
00068 void slotSetScope( bool rec );
00069 void slotStartSearch();
00070 void slotStopSearch();
00071 void slotSearchDone();
00072 void slotError( const TQString& );
00073 virtual void slotHelp();
00074 virtual void slotUser1();
00075 virtual void slotUser2();
00076 void slotSelectAll();
00077 void slotUnselectAll();
00083 TDEABC::Addressee::List importContactsUnlessTheyExist( const TQValueList<ContactListItem*>& items, TDEABC::Resource * const resource );
00084
00085 protected:
00086 TQString selectedEMails() const;
00087
00088 virtual void closeEvent( TQCloseEvent* );
00089
00090 private:
00091 void saveSettings();
00092 static TDEABC::Addressee convertLdapAttributesToAddressee( const KPIM::LdapAttrMap& attrs );
00093 #ifdef TDEPIM_NEW_DISTRLISTS
00094 KPIM::DistributionList selectDistributionList();
00095 #endif
00096
00097 TQString makeFilter( const TQString& query, const TQString& attr, bool startsWith );
00098
00099 void cancelQuery();
00100
00101 int mNumHosts;
00102 TQPtrList<KPIM::LdapClient> mLdapClientList;
00103 bool mIsOK;
00104 TDEABC::AddressBook *mAddressBook;
00105 KABCore *mCore;
00106
00107 KComboBox* mFilterCombo;
00108 KComboBox* mSearchType;
00109 KLineEdit* mSearchEdit;
00110
00111 TQCheckBox* mRecursiveCheckbox;
00112 TQListView* mResultListView;
00113 TQPushButton* mSearchButton;
00114 class Private;
00115 Private* const d;
00116 };
00117
00118 #endif