• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdenewstuff
 

tdenewstuff

Public Member Functions | Protected Member Functions | List of all members
TDENewStuff Class Referenceabstract

#include <knewstuff.h>

Inheritance diagram for TDENewStuff:
TDENewStuffGeneric TDENewStuffSecure

Public Member Functions

 TDENewStuff (const TQString &type, TQWidget *parentWidget=0)
 
 TDENewStuff (const TQString &type, const TQString &providerList, TQWidget *parentWidget=0)
 
TQString type () const
 
TQWidget * parentWidget () const
 
void download ()
 
void upload ()
 
void upload (const TQString &fileName, const TQString previewName)
 
virtual bool install (const TQString &fileName)=0
 
virtual bool createUploadFile (const TQString &fileName)=0
 
virtual TQString downloadDestination (KNS::Entry *entry)
 

Protected Member Functions

KNS::Engine * engine ()
 

Detailed Description

This class provides the functionality to download and upload "new stuff".

Applications have to subclass TDENewStuff, implement the pure virtual functions and link to against libknewstuff.

By calling download() 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 install(). The location where the downloaded files are stored can be customized by reimplementing downloadDestination().

By calling upload() 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 createUploadFile() and transfered to the upload destination specified in the provider list.

Author
Cornelius Schumacher (schum.nosp@m.ache.nosp@m.r@kde.nosp@m..org)
Maintainer:
Josef Spillner (spill.nosp@m.ner@.nosp@m.kde.o.nosp@m.rg)
Since
3.3

Definition at line 69 of file knewstuff.h.

Constructor & Destructor Documentation

◆ TDENewStuff() [1/2]

TDENewStuff::TDENewStuff ( const TQString &  type,
TQWidget *  parentWidget = 0 
)

Constructor.

Parameters
typetype of data to be handled, should be something like korganizer/calendar, kword/template, kdesktop/wallpaper
parentWidgetparent widget of dialogs opened by the TDENewStuff engine

Definition at line 42 of file knewstuff.cpp.

◆ TDENewStuff() [2/2]

TDENewStuff::TDENewStuff ( const TQString &  type,
const TQString &  providerList,
TQWidget *  parentWidget = 0 
)

Constructor.

Parameters
typetype of data to be handled, should be something like korganizer/calendar, kword/template, kdesktop/wallpaper
providerListthe URL of the provider list
parentWidgetparent widget of dialogs opened by the TDENewStuff engine

Definition at line 47 of file knewstuff.cpp.

◆ ~TDENewStuff()

TDENewStuff::~TDENewStuff ( )
virtual

Definition at line 62 of file knewstuff.cpp.

Member Function Documentation

◆ createUploadFile()

virtual bool TDENewStuff::createUploadFile ( const TQString &  fileName)
pure virtual

Create a file to be uploaded to a "new stuff provider" and return the filename.

The format of the file is application specific. The only constraint is that the corresponding install() implementation is able to use the file.

Parameters
fileNamename of the file to be written
Returns
true on success, false on error.

Implemented in TDENewStuffGeneric, and TDENewStuffSecure.

◆ download()

void TDENewStuff::download ( )

Start download process.

Definition at line 67 of file knewstuff.cpp.

◆ downloadDestination()

TQString TDENewStuff::downloadDestination ( KNS::Entry *  entry)
virtual

Return a filename which should be used as destination for downloading the specified new stuff entry.

Reimplement this function, if you don't want the new stuff to be downloaded to a temporary file.

Reimplemented in TDENewStuffGeneric.

Definition at line 72 of file knewstuff.cpp.

◆ engine()

KNS::Engine * TDENewStuff::engine ( )
inlineprotected

Get the pointer to the engine.

Needed by subclasses to access the KNS::Engine object.

Definition at line 154 of file knewstuff.h.

◆ install()

virtual bool TDENewStuff::install ( const TQString &  fileName)
pure virtual

Install file to application.

The given fileName points to the file downloaded by the TDENewStuff engine. This is a temporary file by default. The application can do whatever is needed to handle the information contained in the file.

The function returns true, when the installation was successful and false if were errors.

Parameters
fileNamename of downloaded file

Implemented in TDENewStuffGeneric, and TDENewStuffSecure.

◆ parentWidget()

TQWidget * TDENewStuff::parentWidget ( ) const

Return parent widget.

Definition at line 57 of file knewstuff.cpp.

◆ type()

TQString TDENewStuff::type ( ) const

Return type of data.

Definition at line 52 of file knewstuff.cpp.

◆ upload() [1/2]

void TDENewStuff::upload ( )

Start upload process.

Definition at line 82 of file knewstuff.cpp.

◆ upload() [2/2]

void TDENewStuff::upload ( const TQString &  fileName,
const TQString  previewName 
)

Upload with pre-defined files.

Definition at line 87 of file knewstuff.cpp.


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

tdenewstuff

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

tdenewstuff

Skip menu "tdenewstuff"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdenewstuff by doxygen 1.9.4
This website is maintained by Timothy Pearson.