kabc Library API Documentation

resourceldapkio.h

00001 /*
00002     This file is part of libkabc.
00003     Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef KABC_RESOURCELDAP_H
00022 #define KABC_RESOURCELDAP_H
00023 
00024 #include <kabc/resource.h>
00025 #include <kio/job.h>
00026 
00027 class KConfig;
00028 
00029 namespace KABC {
00030 
00031 class ResourceLDAPKIO : public Resource
00032 {
00033   Q_OBJECT
00034 
00035   public:
00036     ResourceLDAPKIO( const KConfig* );
00037     virtual ~ResourceLDAPKIO() {}
00038 
00042     virtual void init();
00043 
00044     virtual void writeConfig( KConfig* );
00045 
00046     virtual bool doOpen();
00047     virtual void doClose();
00048 
00049     virtual Ticket *requestSaveTicket();
00050     virtual void releaseSaveTicket( Ticket* );
00051 
00052     virtual bool readOnly() const { return true; }
00053 
00054     virtual bool load();
00055     virtual bool asyncLoad();
00056     virtual bool save( Ticket * );
00057     virtual bool asyncSave( Ticket * );
00058 
00059     virtual void removeAddressee( const Addressee& addr );
00060 
00061     void setUser( const QString &user );
00062     QString user() const;
00063 
00064     void setPassword( const QString &password );
00065     QString password() const;
00066 
00067     void setDn( const QString &dn );
00068     QString dn() const;
00069 
00070     void setHost( const QString &host );
00071     QString host() const;
00072 
00073     void setPort( int port );
00074     int port() const;
00075 
00076     void setFilter( const QString &filter );
00077     QString filter() const;
00078 
00079     void setIsAnonymous( bool value );
00080     bool isAnonymous() const;
00081 
00082     void setAttributes( const QMap<QString, QString> &attributes );
00083     QMap<QString, QString> attributes() const;
00084 
00085   protected slots:
00086     void entries( KIO::Job*, const KIO::UDSEntryList& );
00087     void data( KIO::Job*, const QByteArray& );
00088     void result( KIO::Job* );
00089 
00090   private:
00091     QString mUser;
00092     QString mPassword;
00093     QString mDn;
00094     QString mHost;
00095     QString mFilter;
00096     int mPort;
00097     bool mAnonymous;
00098     QMap<QString, QString> mAttributes;
00099 
00100     KURL mLDAPUrl;
00101     int mGetCounter;
00102     bool mErrorOccured;
00103     QString mErrorMsg;
00104     QMap<KIO::Job*, QByteArray> mJobMap;
00105 
00106     class ResourceLDAPKIOPrivate;
00107     ResourceLDAPKIOPrivate *d;
00108 };
00109 
00110 }
00111 
00112 #endif
KDE Logo
This file is part of the documentation for kabc Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Aug 4 05:28:14 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003