korganizer Library API Documentation

provider.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2002 Cornelius Schumacher <schumacher@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 #ifndef KNEWSTUFF_PROVIDER_H
00021 #define KNEWSTUFF_PROVIDER_H
00022 
00023 #include <qcstring.h>
00024 #include <qdom.h>
00025 #include <qobject.h>
00026 #include <qptrlist.h>
00027 #include <qstring.h>
00028 
00029 #include <kurl.h>
00030 
00031 namespace KIO { class Job; }
00032 
00033 namespace KNS {
00034 
00035 class Provider
00036 {
00037   public:
00038     typedef QPtrList<Provider> List;
00039 
00040     Provider();
00041     Provider( const QDomElement & );
00042     ~Provider();
00043     
00044     void setName( const QString & );
00045     QString name() const;
00046 
00047     void setDownloadUrl( const KURL & );
00048     KURL downloadUrl() const;
00049 
00050     void setUploadUrl( const KURL & );
00051     KURL uploadUrl() const;
00052 
00053     void setNoUploadUrl( const KURL & );
00054     KURL noUploadUrl() const;
00055 
00056     void setNoUpload( bool );
00057     bool noUpload() const;
00058 
00059   protected:
00060     void parseDomElement( const QDomElement & );
00061 
00062     QDomElement createDomElement( QDomDocument &, QDomElement &parent );
00063 
00064   private:
00065     QString mName;
00066     KURL mDownloadUrl;
00067     KURL mUploadUrl;
00068     KURL mNoUploadUrl;
00069     bool mNoUpload;
00070 };
00071 
00072 class ProviderLoader : public QObject
00073 {
00074     Q_OBJECT
00075   public:
00076     ProviderLoader( QWidget *parentWidget );
00077 
00078     void load( const QString &type );
00079 
00080   signals:
00081     void providersLoaded( Provider::List * );
00082 
00083   protected slots:
00084     void slotJobData( KIO::Job *, const QByteArray & );
00085     void slotJobResult( KIO::Job * );
00086 
00087   private:
00088     QWidget *mParentWidget;
00089     
00090     QCString mJobData;
00091     
00092     Provider::List mProviders;
00093 };
00094 
00095 }
00096 
00097 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:32 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001