libkdepim

ldapsearchdialog.h

00001 /* ldapsearchdialogimpl.h - LDAP access
00002  *      Copyright (C) 2002 Klar�vdalens 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 <tqptrlist.h>
00025 
00026 #include <ldapclient.h>
00027 #include <kdialogbase.h>
00028 #include <klineedit.h>
00029 
00030 class KComboBox;
00031 
00032 class TQCheckBox;
00033 class TQListView;
00034 class TQPushButton;
00035 
00036 namespace KPIM {
00037 
00038 class LDAPSearchDialog : public KDialogBase
00039 { 
00040   Q_OBJECT
00041   TQ_OBJECT
00042 
00043   public:
00044     LDAPSearchDialog( TQWidget* parent, const char* name = 0 );
00045     ~LDAPSearchDialog();
00046 
00047     bool isOK() const { return mIsOK; }
00048 
00049     void restoreSettings();
00050 
00051     void setSearchText( const TQString &text ) { mSearchEdit->setText( text ); }
00052     TQString selectedEMails() const;
00053   signals:
00054     void addresseesAdded();
00055 
00056   protected slots:
00057     void slotAddResult( const KPIM::LdapObject& obj );
00058     void slotSetScope( bool rec );
00059     void slotStartSearch();
00060     void slotStopSearch();
00061     void slotSearchDone();
00062     void slotError( const TQString& );
00063     virtual void slotHelp();
00064     virtual void slotUser1();
00065     virtual void slotUser2();
00066     virtual void slotUser3();
00067 
00068   protected:
00069 
00070     virtual void closeEvent( TQCloseEvent* );
00071 
00072   private:
00073     void saveSettings();
00074 
00075     TQString makeFilter( const TQString& query, const TQString& attr, bool startsWith );
00076 
00077     void cancelQuery();
00078 
00079     int mNumHosts;
00080     TQPtrList<KPIM::LdapClient> mLdapClientList;
00081     bool mIsOK;
00082     KComboBox* mFilterCombo;
00083     KComboBox* mSearchType;
00084     KLineEdit* mSearchEdit;
00085 
00086     TQCheckBox* mRecursiveCheckbox;
00087     TQListView* mResultListView;
00088     TQPushButton* mSearchButton;
00089 };
00090 
00091 
00092 }
00093 #endif