Need to store config when changing units, if not very bad things happen
[kdepim.git] / kaddressbook / ldapsearchdialog.h
blobadb98c2350fd91ede5ae8049026c185542f8bb74
1 /* ldapsearchdialogimpl.h - LDAP access
2 * Copyright (C) 2002 Klarälvdalens 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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef LDAPSEARCHDIALOG_H
22 #define LDAPSEARCHDIALOG_H
24 #include <qptrlist.h>
26 #include <kabc/addressbook.h>
27 #include <ldapclient.h>
28 #include <kdialogbase.h>
30 class KAddressBookTableView;
31 class KComboBox;
32 class KLineEdit;
34 class QCheckBox;
35 class QListView;
36 class QPushButton;
37 class KABCore;
39 class LDAPSearchDialog : public KDialogBase
41 Q_OBJECT
43 public:
44 LDAPSearchDialog( KABC::AddressBook *ab, KABCore *core, QWidget* parent, const char* name = 0 );
45 ~LDAPSearchDialog();
47 bool isOK() const { return mIsOK; }
49 void restoreSettings();
51 signals:
52 void addresseesAdded();
54 protected slots:
55 void slotAddResult( const KPIM::LdapObject& obj );
56 void slotSetScope( bool rec );
57 void slotStartSearch();
58 void slotStopSearch();
59 void slotSearchDone();
60 void slotError( const QString& );
61 virtual void slotHelp();
62 virtual void slotUser1();
63 void slotSelectAll();
64 void slotUnselectAll();
66 protected:
67 QString selectedEMails() const;
69 virtual void closeEvent( QCloseEvent* );
71 private:
72 void saveSettings();
74 QString makeFilter( const QString& query, const QString& attr, bool startsWith );
76 void cancelQuery();
78 int mNumHosts;
79 QPtrList<KPIM::LdapClient> mLdapClientList;
80 bool mIsOK;
81 KABC::AddressBook *mAddressBook;
82 KABCore *mCore;
84 KComboBox* mFilterCombo;
85 KComboBox* mSearchType;
86 KLineEdit* mSearchEdit;
88 QCheckBox* mRecursiveCheckbox;
89 QListView* mResultListView;
90 QPushButton* mSearchButton;
93 #endif