kaddressbook

ldapsearchdialog.h

00001 /* ldapsearchdialogimpl.h - LDAP access
00002  *      Copyright (C) 2002 Klarälvdalens Datakonsult AB
00003  *
00004  *      Author: Steffen Hansen <hansen@kde.org>
00005  *
00006  * This file is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This file is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #ifndef LDAPSEARCHDIALOG_H
00022 #define LDAPSEARCHDIALOG_H
00023 
00024 #include <qptrlist.h>
00025 
00026 #include <kabc/addressbook.h>
00027 #include <ldapclient.h>
00028 #include <kdialogbase.h>
00029 
00030 class KAddressBookTableView;
00031 class KComboBox;
00032 class KLineEdit;
00033 
00034 class QCheckBox;
00035 class QListView;
00036 class QPushButton;
00037 class KABCore;
00038 
00039 class LDAPSearchDialog : public KDialogBase
00040 {
00041   Q_OBJECT
00042 
00043   public:
00044     LDAPSearchDialog( KABC::AddressBook *ab, KABCore *core, QWidget* parent, const char* name = 0 );
00045     ~LDAPSearchDialog();
00046 
00047     bool isOK() const { return mIsOK; }
00048 
00049     void restoreSettings();
00050 
00051   signals:
00052     void addresseesAdded();
00053 
00054   protected slots:
00055     void slotAddResult( const KPIM::LdapObject& obj );
00056     void slotSetScope( bool rec );
00057     void slotStartSearch();
00058     void slotStopSearch();
00059     void slotSearchDone();
00060     void slotError( const QString& );
00061     virtual void slotHelp();
00062     virtual void slotUser1();
00063     void slotSelectAll();
00064     void slotUnselectAll();
00065 
00066   protected:
00067     QString selectedEMails() const;
00068 
00069     virtual void closeEvent( QCloseEvent* );
00070 
00071   private:
00072     void saveSettings();
00073 
00074     QString makeFilter( const QString& query, const QString& attr, bool startsWith );
00075 
00076     void cancelQuery();
00077 
00078     int mNumHosts;
00079     QPtrList<KPIM::LdapClient> mLdapClientList;
00080     bool mIsOK;
00081     KABC::AddressBook *mAddressBook;
00082     KABCore *mCore;
00083 
00084     KComboBox* mFilterCombo;
00085     KComboBox* mSearchType;
00086     KLineEdit* mSearchEdit;
00087 
00088     QCheckBox* mRecursiveCheckbox;
00089     QListView* mResultListView;
00090     QPushButton* mSearchButton;
00091 };
00092 
00093 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys