# knewstuff Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KNS::Engine Class Reference

Central class combining all possible KNewStuff operations. More...

`#include <engine.h>`

Inheritance diagram for KNS::Engine:

[legend]
Collaboration diagram for KNS::Engine:

[legend]
List of all members.

## Signals

void | uploadFinished (bool result)

## Public Member Functions

| 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
QWidget * | parentWidget () const
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)

## 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 Member Functions

bool | createMetaFile (Entry *)

## Detailed Description

Central class combining all possible KNewStuff operations.

In most cases, Engine objects are built and used internally. Using this class explicitely does however give fine-grained control about the upload and download operations.

Author:
  Cornelius Schumacher (schumacher@kde.org)

Maintainer:
  Josef Spillner (spillner@kde.org)

Definition at line 51 of file engine.h.

## Constructor & Destructor Documentation

KNS::Engine::Engine | ( | KNewStuff * | newStuff,
|  | const QString & | type,
|  | QWidget * | parentWidget = `0`
| ) |

Constructor.

Parameters:

  | newStuff | a KNewStuff object
  | type | the Hotstuff data type such as "korganizer/calendar"
  | parentWidget | the parent window

KNS::Engine::Engine | ( | KNewStuff * | newStuff,
|  | const QString & | type,
|  | const QString & | providerList,
|  | QWidget * | parentWidget = `0`
| ) |

Constructor.

Parameters:

  | newStuff | a KNewStuff object
  | type | the Hotstuff data type such as "korganizer/calendar"
  | providerList | the URL of the provider list
  | parentWidget | the parent window

virtual KNS::Engine::~Engine | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

QString KNS::Engine::type | ( |  | ) | const`[inline]`

Returns the previously set data type.

Returns:
  the Hotstuff data type

Definition at line 84 of file engine.h.

Referenced by KNewStuff::type().

QWidget* KNS::Engine::parentWidget | ( |  | ) | const`[inline]`

Returns the previously set parent widget.

Returns:
  parent widget

Definition at line 91 of file engine.h.

Referenced by KNewStuff::parentWidget().

void KNS::Engine::download | ( |  | ) |

| Initiates the download process, retrieving provider lists and invoking the download dialog. Referenced by KNewStuff::download().

void KNS::Engine::upload | ( | const QString & | fileName = `QString::null`,
|  | const QString & | previewName = `QString::null`
| ) |

Initiates the upload process, invoking the provider selection dialog and the file upload dialog.

Parameters:

  | fileName | name of the payload data file
  | previewName | name of the preview image file

Referenced by KNewStuff::upload().

void KNS::Engine::download | ( | Entry * | entry | ) |

Downloads the specified data file.

Parameters:

  | entry | the Hotstuff data object to be downloaded

void KNS::Engine::requestMetaInformation | ( | Provider * | provider | ) |

Asynchronous lookup of provider information such as upload and download locations, icon etc.

Parameters:

  | provider | the Hotstuff provider to request information from

void KNS::Engine::upload | ( | Entry * | entry | ) |

Uploads the specified data file to the provider-dependent location.

Parameters:

  | entry | the Hotstuff data object to be uploaded

void KNS::Engine::ignoreInstallResult | ( | bool | ignore | ) |

| Ignores the return value of the install method. Used internally to avoid showing of the success/failure dialog when installation is done in another place, like in KNewStuffSecure Referenced by KNewStuffSecure::downloadResource().

void KNS::Engine::uploadFinished | ( | bool | result | ) | `[signal]`

Emitted when the upload has finished.

Parameters:

  | result | indicates the success/failure of the upload

The documentation for this class was generated from the following file:

- engine.h

This file is part of the documentation for knewstuff Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:28:44 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003