• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KNewStuff

KNS::Engine

KNS::Engine Class Reference

#include <engine.h>

List of all members.


Detailed Description

The KNewStuff2 engine is the top-level class to handle GHNS and DXS workflows.

An engine implements GHNS workflows, which consist of discrete steps performed by the inherited engine. Depending on the provider, traditional GHNS or DXS are used transparently. This class is the one which applications should use. In most cases, either upload() or download() will be called by the application to upload or download data.

Definition at line 40 of file engine.h.


Public Member Functions

 Engine (QWidget *parent=0)
 ~Engine ()
KNS::Entry::List downloadDialogModal (QWidget *parent=0)
KNS::Entry * uploadDialogModal (const QString &file)
void downloadDialog ()
void uploadDialog (const QString &file)
bool init (const QString &config)

Static Public Member Functions

static KNS::Entry::List download ()
static KNS::Entry * upload (const QString &file)

Friends

class EnginePrivate

Constructor & Destructor Documentation

Engine::Engine ( QWidget *  parent = 0  )  [explicit]

Engine constructor.

As many engines as needed can be instantiated, although one should use the static methods download() and upload() instead.

Definition at line 93 of file engine.cpp.

Engine::~Engine (  ) 

Engine destructor.

Deletes an engine and frees all memory occupied by it.

Definition at line 98 of file engine.cpp.


Member Function Documentation

KNS::Entry::List Engine::downloadDialogModal ( QWidget *  parent = 0  ) 

Synchronous way of starting the download workflow.

Starts the download workflow. This workflow will turn up a dialog where the user can select entries for installation and deinstallation. This method is a modal one. It will return all affected entries as a list.

Returns:
List of installed or deinstalled entries

Definition at line 193 of file engine.cpp.

KNS::Entry::List Engine::download (  )  [static]

Recommended download workflow entry point.

This method is a static convenience wrapper around downloadDialogModal() which does not require the manual construction of an engine object. The engine will be configured to load appname.knsrc. The resulting entry list must not be freed, as the engine will continue to keep track of it.

Returns:
List of installed or deinstalled entries NOTE: this is a copy of each entry because this call deletes it's own engine which deletes the original entries, so you need to delete the entries returned in the list
See also:
downloadDialogModal()

Definition at line 166 of file engine.cpp.

KNS::Entry * Engine::uploadDialogModal ( const QString &  file  ) 

Synchronous way of starting the upload workflow.

Starts the upload workflow. This workflow will offer provider selection and afterwards upload all files associated with an entry. This method is a modal one. It will return the uploaded entry.

Returns:
Uploaded entry, or null in case of failures

Definition at line 258 of file engine.cpp.

KNS::Entry * Engine::upload ( const QString &  file  )  [static]

Recommended upload workflow entry point.

This method is a static convenience wrapper around uploadDialogModal() which does not require the manual construction of an engine object. The engine will be configured to load appname.knsrc. The resulting entry must not be freed, as the engine will continue to keep track of it.

Returns:
Uploaded entry, or null in case of failures
See also:
uploadDialogModal()

Definition at line 244 of file engine.cpp.

void Engine::downloadDialog (  ) 

Asynchronous way of starting the download workflow.

This method should be used whenever a blocking application with a non-blocking GUI during GHNS operations is not suitable. Affected entries will be reported by signals.

See also:
downloadDialogModal()

Definition at line 205 of file engine.cpp.

void Engine::uploadDialog ( const QString &  file  ) 

Asynchronous way of starting the upload workflow.

This method should be used whenever a blocking application with a non-blocking GUI during GHNS operations is not suitable. The affected entry will be reported by signals.

See also:
uploadDialogModal()

Definition at line 271 of file engine.cpp.

bool Engine::init ( const QString &  config  ) 

Definition at line 238 of file engine.cpp.


Friends And Related Function Documentation

friend class EnginePrivate [friend]

Definition at line 140 of file engine.h.


The documentation for this class was generated from the following files:
  • engine.h
  • engine.cpp

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal