krop's commit fixes my problem in a better way, reverting
[kdepim.git] / libkdepim / ldapsearchdialog.h
blob08265dd6c1417538c1f096b274badb98a0a386cb
1 /* ldapsearchdialogimpl.h - LDAP access
2 * Copyright (C) 2002 Klar�vdalens Datakonsult AB
4 * Author: Steffen Hansen <hansen@kde.org>
6 * This file is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This file is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef LDAPSEARCHDIALOG_H
22 #define LDAPSEARCHDIALOG_H
24 #include <QtCore/QList>
26 #include <ldapclient.h>
27 #include <kdialog.h>
28 #include <klineedit.h>
30 class KComboBox;
32 class QCheckBox;
33 class QTreeWidget;
34 class QPushButton;
36 namespace KPIM {
38 class KDEPIM_EXPORT LdapSearchDialog : public KDialog
40 Q_OBJECT
42 public:
43 explicit LdapSearchDialog( QWidget *parent, const char *name = 0 );
44 ~LdapSearchDialog();
46 bool isOK() const
48 return mIsOK;
51 void restoreSettings();
53 void setSearchText( const QString &text )
55 mSearchEdit->setText( text );
58 QString selectedEMails() const;
60 signals:
61 void addresseesAdded();
63 protected slots:
64 void slotAddResult( const KPIM::LdapClient &client, const KLDAP::LdapObject &obj );
65 void slotSetScope( bool rec );
66 void slotStartSearch();
67 void slotStopSearch();
68 void slotSearchDone();
69 void slotError( const QString & );
70 virtual void slotButtonClicked( int button );
72 protected:
73 virtual void closeEvent( QCloseEvent * );
75 private:
76 void saveSettings();
78 QString makeFilter( const QString &query, const QString &attr, bool startsWith );
80 void cancelQuery();
82 int mNumHosts;
83 QList<KPIM::LdapClient *>mLdapClientList;
84 bool mIsOK;
85 KComboBox *mFilterCombo;
86 KComboBox *mSearchType;
87 KLineEdit *mSearchEdit;
89 QCheckBox *mRecursiveCheckbox;
90 QTreeWidget *mResultListView;
91 QPushButton *mSearchButton;
96 #endif