Diffstat (limited to 'kabc/plugins/ldap/resourceldap.h') (more/less context) (show whitespace changes)
-rw-r--r-- | kabc/plugins/ldap/resourceldap.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/kabc/plugins/ldap/resourceldap.h b/kabc/plugins/ldap/resourceldap.h new file mode 100644 index 0000000..0625f30 --- a/dev/null +++ b/kabc/plugins/ldap/resourceldap.h | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | This file is part of libkabc. | ||
3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Library General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Library General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Library General Public License | ||
16 | along with this library; see the file COPYING.LIB. If not, write to | ||
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | Enhanced Version of the file for platform independent KDE tools. | ||
23 | Copyright (c) 2004 Ulf Schenk | ||
24 | |||
25 | $Id$ | ||
26 | */ | ||
27 | |||
28 | #ifndef KABC_RESOURCELDAP_H | ||
29 | #define KABC_RESOURCELDAP_H | ||
30 | |||
31 | |||
32 | #include <lber.h> | ||
33 | #include <ldap.h> | ||
34 | |||
35 | #include "addressbook.h" | ||
36 | #include "resource.h" | ||
37 | |||
38 | class KConfig; | ||
39 | |||
40 | namespace KABC { | ||
41 | |||
42 | class ResourceLDAP : public Resource | ||
43 | { | ||
44 | public: | ||
45 | |||
46 | ResourceLDAP( const KConfig* ); | ||
47 | |||
48 | virtual void writeConfig( KConfig* ); | ||
49 | |||
50 | virtual bool doOpen(); | ||
51 | virtual void doClose(); | ||
52 | |||
53 | virtual Ticket *requestSaveTicket(); | ||
54 | |||
55 | virtual bool load(); | ||
56 | virtual bool save( Ticket * ); | ||
57 | |||
58 | virtual void removeAddressee( const Addressee& addr ); | ||
59 | |||
60 | void setUser( const QString &user ); | ||
61 | QString user() const; | ||
62 | |||
63 | void setPassword( const QString &password ); | ||
64 | QString password() const; | ||
65 | |||
66 | void setDn( const QString &dn ); | ||
67 | QString dn() const; | ||
68 | |||
69 | void setHost( const QString &host ); | ||
70 | QString host() const; | ||
71 | |||
72 | void setPort( int port ); | ||
73 | int port() const; | ||
74 | |||
75 | void setFilter( const QString &filter ); | ||
76 | QString filter() const; | ||
77 | |||
78 | void setIsAnonymous( bool value ); | ||
79 | bool isAnonymous() const; | ||
80 | |||
81 | void setAttributes( const QMap<QString, QString> &attributes ); | ||
82 | QMap<QString, QString> attributes() const; | ||
83 | |||
84 | private: | ||
85 | QString mUser; | ||
86 | QString mPassword; | ||
87 | QString mDn; | ||
88 | QString mHost; | ||
89 | QString mFilter; | ||
90 | int mPort; | ||
91 | bool mAnonymous; | ||
92 | QMap<QString, QString> mAttributes; | ||
93 | |||
94 | LDAP *mLdap; | ||
95 | }; | ||
96 | |||
97 | } | ||
98 | |||
99 | #endif | ||