.PP
.TH "KNewStuff" kde3 "11 Jun 2005" "Version Version 3.4.1" "knewstuff Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KNewStuff \- This class provides the functionality to download and upload 'new stuff'.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <knewstuff.h>\fP
.PP
Inherited by \fBKNewStuffGeneric\fP, \fBKNewStuffSecure\fP, and TestNewStuff.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKNewStuff\fP (const \fBQString\fP &type, \fBQWidget\fP *parentWidget=0)"
.br
.ti -1c
.RI "\fBKNewStuff\fP (const \fBQString\fP &type, const \fBQString\fP &providerList, \fBQWidget\fP *parentWidget=0)"
.br
.ti -1c
.RI "\fBQString\fP \fBtype\fP () const "
.br
.ti -1c
.RI "\fBQWidget\fP * \fBparentWidget\fP () const "
.br
.ti -1c
.RI "void \fBdownload\fP ()"
.br
.ti -1c
.RI "void \fBupload\fP ()"
.br
.ti -1c
.RI "void \fBupload\fP (const \fBQString\fP &fileName, const \fBQString\fP previewName)"
.br
.ti -1c
.RI "virtual bool \fBinstall\fP (const \fBQString\fP &fileName)=0"
.br
.ti -1c
.RI "virtual bool \fBcreateUploadFile\fP (const \fBQString\fP &fileName)=0"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBdownloadDestination\fP (\fBKNS::Entry\fP *entry)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKNS::Engine\fP * \fBengine\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class provides the functionality to download and upload 'new stuff'. 

Applications have to subclass KNewStuff, implement the pure virtual functions and link to against libknewstuff.
.PP
By calling \fBdownload()\fP the download process is started which means that a list of 'providers' is fetched from a 'master server', information about new stuff is collected from the providers and presented to the user. Selected entries get downloaded and installed to the application. The required functions to install new stuff are provided by implementing \fBinstall()\fP. The location where the downloaded files are stored can be customized by reimplementing \fBdownloadDestination()\fP.
.PP
By calling \fBupload()\fP the upload process is started which means the user has to select a provider from the list fetched from the master server and to put in information about the entry to be uploaded. Then the file to be uploaded is fetched from the application by calling \fBcreateUploadFile()\fP and transfered to the upload destination specified in the provider list.
.PP
\fBAuthor:\fP
.RS 4
Cornelius Schumacher (schumacher@kde.org) 
.RE
.PP
\fBMaintainer:\fP.RS 4
Josef Spillner (spillner@kde.org)
.RE
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 69 of file knewstuff.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KNewStuff::KNewStuff (const \fBQString\fP & type, \fBQWidget\fP * parentWidget = \fC0\fP)"
.PP
Constructor. 
.PP
\fBParameters:\fP
.RS 4
\fItype\fP type of data to be handled, should be something like korganizer/calendar, kword/template, kdesktop/wallpaper 
.br
\fIparentWidget\fP parent widget of dialogs opened by the KNewStuff engine 
.RE
.PP

.PP
Definition at line 42 of file knewstuff.cpp.
.PP
References parentWidget(), and type().
.SS "KNewStuff::KNewStuff (const \fBQString\fP & type, const \fBQString\fP & providerList, \fBQWidget\fP * parentWidget = \fC0\fP)"
.PP
Constructor. 
.PP
\fBParameters:\fP
.RS 4
\fItype\fP type of data to be handled, should be something like korganizer/calendar, kword/template, kdesktop/wallpaper 
.br
\fIproviderList\fP the URL of the provider list 
.br
\fIparentWidget\fP parent widget of dialogs opened by the KNewStuff engine 
.RE
.PP

.PP
Definition at line 47 of file knewstuff.cpp.
.PP
References parentWidget(), and type().
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KNewStuff::type () const"
.PP
Return type of data. 
.PP
Definition at line 52 of file knewstuff.cpp.
.PP
References KNS::Engine::type().
.PP
Referenced by KNewStuff().
.SS "\fBQWidget\fP * KNewStuff::parentWidget () const"
.PP
Return parent widget. 
.PP
Definition at line 57 of file knewstuff.cpp.
.PP
References KNS::Engine::parentWidget().
.PP
Referenced by KNewStuffGeneric::downloadDestination(), KNewStuffSecure::install(), KNewStuff(), and KNewStuffSecure::removeTempDirectory().
.SS "void KNewStuff::download ()"
.PP
Start download process. 
.PP
Definition at line 67 of file knewstuff.cpp.
.PP
References KNS::Engine::download().
.PP
Referenced by KNewStuffSecure::downloadResource().
.SS "void KNewStuff::upload ()"
.PP
Start upload process. 
.PP
Definition at line 78 of file knewstuff.cpp.
.PP
References KNS::Engine::upload().
.SS "void KNewStuff::upload (const \fBQString\fP & fileName, const \fBQString\fP previewName)"
.PP
Upload with pre-defined files. 
.PP
Definition at line 83 of file knewstuff.cpp.
.PP
References KNS::Engine::upload().
.SS "virtual bool KNewStuff::install (const \fBQString\fP & fileName)\fC [pure virtual]\fP"
.PP
Install file to application. 
.PP
The given fileName points to the file downloaded by the KNewStuff engine. This is a temporary file by default. The application can do whatever is needed to handle the information contained in the file.
.PP
The function returns true, when the installation was successful and false if were errors.
.PP
\fBParameters:\fP
.RS 4
\fIfileName\fP name of downloaded file 
.RE
.PP

.PP
Implemented in \fBKNewStuffGeneric\fP, and \fBKNewStuffSecure\fP.
.SS "virtual bool KNewStuff::createUploadFile (const \fBQString\fP & fileName)\fC [pure virtual]\fP"
.PP
Create a file to be uploaded to a 'new stuff provider' and return the filename. 
.PP
The format of the file is application specific. The only constraint is that the corresponding \fBinstall()\fP implementation is able to use the file.
.PP
\fBParameters:\fP
.RS 4
\fIfileName\fP name of the file to be written 
.RE
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP on success, \fCfalse\fP on error. 
.RE
.PP

.PP
Implemented in \fBKNewStuffGeneric\fP, and \fBKNewStuffSecure\fP.
.SS "\fBQString\fP KNewStuff::downloadDestination (\fBKNS::Entry\fP * entry)\fC [virtual]\fP"
.PP
Return a filename which should be used as destination for downloading the specified new stuff entry. 
.PP
Reimplement this function, if you don't want the new stuff to be downloaded to a temporary file. 
.PP
Reimplemented in \fBKNewStuffGeneric\fP.
.PP
Definition at line 72 of file knewstuff.cpp.
.SS "\fBKNS::Engine\fP* KNewStuff::engine ()\fC [inline, protected]\fP"
.PP
Get the pointer to the engine. 
.PP
Needed by subclasses to access the \fBKNS::Engine\fP object. 
.PP
Definition at line 154 of file knewstuff.h.
.PP
Referenced by KNewStuffSecure::downloadResource(), and KNewStuffSecure::KNewStuffSecure().

.SH "Author"
.PP 
Generated automatically by Doxygen for knewstuff Library from the source code.
