engine.h
/*
This file is part of KOrganizer.
Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KNEWSTUFF_ENGINE_H
#define KNEWSTUFF_ENGINE_H
#include <qmap.h>
#include <qobject.h>
#include <qstring.h>
#include "entry.h"
#include "provider.h"
namespace KIO { class Job; }
class KNewStuff;
namespace KNS {
class DownloadDialog;
class UploadDialog;
class ProviderDialog;
class KDE_EXPORT Engine : public QObject
{
Q_OBJECT
struct Private;
public:
Engine( KNewStuff *newStuff, const QString &type, QWidget *parentWidget = 0 );
Engine( KNewStuff *newStuff, const QString &type, const QString &providerList, QWidget *parentWidget = 0 );
virtual ~Engine();
QString type() const { return mType; }
QWidget *parentWidget() const { return mParentWidget; }
void download();
void upload( const QString &fileName = QString::null, const QString &previewName = QString::null );
void download( Entry *entry );
void requestMetaInformation( Provider *provider );
void upload( Entry *entry );
void ignoreInstallResult(bool ignore);
signals:
void uploadFinished( bool result );
protected slots:
void getMetaInformation( Provider::List *providers );
void selectUploadProvider( Provider::List *providers );
void slotNewStuffJobData( KIO::Job *job, const QByteArray &data );
void slotNewStuffJobResult( KIO::Job *job );
void slotDownloadJobResult( KIO::Job *job );
void slotUploadPayloadJobResult( KIO::Job *job );
void slotUploadPreviewJobResult (KIO::Job *job );
void slotUploadMetaJobResult( KIO::Job *job );
protected:
bool createMetaFile( Entry * );
private:
QWidget *mParentWidget;
ProviderLoader *mProviderLoader;
QMap<KIO::Job *,QString> mNewStuffJobData;
QMap<KIO::Job *,Provider *> mProviderJobs;
QPtrList<Entry> mNewStuffList;
DownloadDialog *mDownloadDialog;
UploadDialog *mUploadDialog;
ProviderDialog *mProviderDialog;
QString mDownloadDestination;
Provider *mUploadProvider;
QString mUploadMetaFile;
QString mUploadFile;
QString mPreviewFile;
QString mProviderList;
Private* d;
QString mType;
};
}
#endif
KNS::Entry
KNewStuff data entry container.
Definition: entry.h:44
KNS::UploadDialog
KNewStuff file upload dialog.
Definition: uploaddialog.h:47
KNewStuff
This class provides the functionality to download and upload "new stuff".
Definition: knewstuff.h:69
KNS::Engine::parentWidget
QWidget * parentWidget() const
Returns the previously set parent widget.
Definition: engine.h:91
KNS::Engine::type
QString type() const
Returns the previously set data type.
Definition: engine.h:84
KNS::ProviderDialog
Dialog displaying a list of Hotstuff providers.
Definition: providerdialog.h:43
KNS::ProviderLoader
KNewStuff provider loader.
Definition: provider.h:172
KNS::Engine
Central class combining all possible KNewStuff operations.
Definition: engine.h:51
KNS::Provider
KNewStuff provider container.
Definition: provider.h:46
KNS::DownloadDialog
Common download dialog for data browsing and installation.
Definition: downloaddialog.h:57

KDE Home | KDE Accessibility Home | Description of Access Keys