engine.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KNEWSTUFF_ENGINE_H
00021 #define KNEWSTUFF_ENGINE_H
00022
00023 #include <qmap.h>
00024 #include <qobject.h>
00025 #include <qstring.h>
00026
00027 #include "entry.h"
00028 #include "provider.h"
00029
00030 namespace KIO { class Job; }
00031
00032 class KNewStuff;
00033
00034 namespace KNS {
00035
00036 class DownloadDialog;
00037 class UploadDialog;
00038 class ProviderDialog;
00039
00040 class Engine : public QObject
00041 {
00042 Q_OBJECT
00043 public:
00044 Engine( KNewStuff *, const QString &, QWidget *parentWidget = 0 );
00045 virtual ~Engine();
00046
00047 QString type() const { return mType; }
00048
00049 QWidget *parentWidget() const { return mParentWidget; }
00050
00051 void download();
00052 void upload( const QString &fileName = QString::null, const QString &previewName = QString::null );
00053
00054 void download( Entry * );
00055
00056 void requestMetaInformation( Provider * );
00057
00058 void upload( Entry * );
00059
00060 protected slots:
00061 void getMetaInformation( Provider::List *providers );
00062 void selectUploadProvider( Provider::List *providers );
00063
00064 void slotNewStuffJobData( KIO::Job *job, const QByteArray &data );
00065 void slotNewStuffJobResult( KIO::Job *job );
00066
00067 void slotDownloadJobResult( KIO::Job *job );
00068
00069 void slotUploadPayloadJobResult( KIO::Job *job );
00070 void slotUploadMetaJobResult( KIO::Job *job );
00071
00072 protected:
00073 bool createMetaFile( Entry * );
00074
00075 private:
00076 QWidget *mParentWidget;
00077
00078 ProviderLoader *mProviderLoader;
00079
00080 QMap<KIO::Job *,QString> mNewStuffJobData;
00081 QMap<KIO::Job *,Provider *> mProviderJobs;
00082
00083 QPtrList<Entry> mNewStuffList;
00084
00085 DownloadDialog *mDownloadDialog;
00086 UploadDialog *mUploadDialog;
00087 ProviderDialog *mProviderDialog;
00088
00089 QString mDownloadDestination;
00090
00091 Provider *mUploadProvider;
00092
00093 QString mUploadMetaFile;
00094 QString mUploadFile;
00095 QString mPreviewFile;
00096
00097 KNewStuff *mNewStuff;
00098
00099 QString mType;
00100 };
00101
00102 }
00103
00104 #endif
This file is part of the documentation for korganizer Library Version 3.2.2.