• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

knode

Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KNJobData Class Referenceabstract

#include <knjobdata.h>

Inheritance diagram for KNJobData:
Inheritance graph
[legend]

Public Types

enum  jobType {
  JTLoadGroups =1, JTFetchGroups, JTfetchNewHeaders, JTfetchArticle,
  JTpostArticle, JTmail, JTfetchSource
}
 

Signals

void finished (KNJobData *)
 

Public Member Functions

 KNJobData (jobType t, KNJobConsumer *c, KNServerInfo::Ptr a, KNJobItem::Ptr i)
 
 ~KNJobData ()
 
KNServerInfo::Ptr account () const
 
void cancel ()
 
bool canceled () const
 
void createProgressItem ()
 
KNJobItem::Ptr data () const
 
int error () const
 
QString errorString () const
 
virtual void execute ()=0
 
void notifyConsumer ()
 
void prepareForExecution ()
 
KPIM::ProgressItem * progressItem () const
 
void setComplete ()
 
void setError (int err, const QString &errMsg)
 
void setProgress (unsigned int progress)
 
void setStatus (const QString &msg)
 
bool success () const
 
jobType type () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Protected Member Functions

KUrl baseUrl () const
 
void emitFinished ()
 
void setupKIOJob (KIO::Job *job)
 
void setupKJob (KJob *job)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

KNServerInfo::Ptr a_ccount
 
KNJobConsumer * c_onsumer
 
KNJobItem::Ptr d_ata
 
bool mCanceled
 
int mError
 
QString mErrorString
 
QPointer< KJob > mJob
 
KPIM::ProgressItem * mProgressItem
 
jobType t_ype
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Abstract base class for all KNode internal jobs.

This class takes care of:

  • progress/status reporting and user interaction (cancellation).
  • error handling/reporting.
  • easy handling of associated KIO jobs. To imlpement a new job class, you need to sub-class this class and implement the execute() method.

Definition at line 101 of file knjobdata.h.

Member Enumeration Documentation

enum KNJobData::jobType
Enumerator
JTLoadGroups 
JTFetchGroups 
JTfetchNewHeaders 
JTfetchArticle 
JTpostArticle 
JTmail 
JTfetchSource 

Definition at line 109 of file knjobdata.h.

Constructor & Destructor Documentation

KNJobData::KNJobData ( jobType  t,
KNJobConsumer *  c,
KNServerInfo::Ptr  a,
KNJobItem::Ptr  i 
)

Definition at line 75 of file knjobdata.cpp.

KNJobData::~KNJobData ( )

Definition at line 88 of file knjobdata.cpp.

Member Function Documentation

KNServerInfo::Ptr KNJobData::account ( ) const
inline

Definition at line 122 of file knjobdata.h.

KUrl KNJobData::baseUrl ( ) const
protected

Returns a correctly set up KUrl according to the encryption and authentication settings for KIO slave operations.

Definition at line 185 of file knjobdata.cpp.

void KNJobData::cancel ( )

Cancels this job.

If the job is currently active, this cancels the associated KIO job and emits the finished signal.

Definition at line 105 of file knjobdata.cpp.

bool KNJobData::canceled ( ) const
inline

Returns true if the job has been canceled by the user.

Definition at line 132 of file knjobdata.h.

void KNJobData::createProgressItem ( )

Creates a KPIM::ProgressItem for this job.

Definition at line 149 of file knjobdata.cpp.

KNJobItem::Ptr KNJobData::data ( ) const
inline

Definition at line 123 of file knjobdata.h.

void KNJobData::emitFinished ( )
protected

Emits the finished() signal via a single-shot timer.

Definition at line 119 of file knjobdata.cpp.

int KNJobData::error ( ) const
inline

Returns the error code (see KIO::Error).

Definition at line 126 of file knjobdata.h.

QString KNJobData::errorString ( ) const
inline

Returns the error message.

Definition at line 128 of file knjobdata.h.

virtual void KNJobData::execute ( )
pure virtual

Performs the actual operation of a job, needs to be reimplemented for every job.

Note that a job might be executed multiple times e.g. in case of an authentication error.

Implemented in KNode::ArticlePostJob, KNode::ArticleFetchJob, KNode::ArticleListJob, KNode::GroupLoadJob, KNode::GroupListJob, and KNode::MailSendJob.

void KNJobData::finished ( KNJobData *  )
signal

Emitted when a job has been finished.

It's recommended to to emit it via emitFinished().

void KNJobData::notifyConsumer ( )

Definition at line 96 of file knjobdata.cpp.

void KNJobData::prepareForExecution ( )
inline

Definition at line 146 of file knjobdata.h.

KPIM::ProgressItem* KNJobData::progressItem ( ) const
inline

Returns the progress item for this job.

Definition at line 157 of file knjobdata.h.

void KNJobData::setComplete ( )
inline

Tells the progress item to indicate that the job has finished if available.

This causes the destruction of the progress item.

Definition at line 172 of file knjobdata.h.

void KNJobData::setError ( int  err,
const QString &  errMsg 
)

Set job error information.

Parameters
errThe error code (see KIO::Error).
errMsgA translated error message.

Definition at line 201 of file knjobdata.cpp.

void KNJobData::setProgress ( unsigned int  progress)
inline

Set the progress value of the progress item if available.

Parameters
progressThe new progress value.

Definition at line 168 of file knjobdata.h.

void KNJobData::setStatus ( const QString &  msg)
inline

Set the status message of the progress item if available.

Parameters
msgThe new status message.

Definition at line 164 of file knjobdata.h.

void KNJobData::setupKIOJob ( KIO::Job *  job)
protected

Sets TLS metadata and connects the given KIO job to the progress item.

Parameters
jobThe KIO job to setup.

Definition at line 135 of file knjobdata.cpp.

void KNJobData::setupKJob ( KJob *  job)
protected

Connects progress signals.

Parameters
jobThe KJob to setup.

Definition at line 124 of file knjobdata.cpp.

bool KNJobData::success ( ) const
inline

Returns true if the job finished successfully.

Definition at line 130 of file knjobdata.h.

jobType KNJobData::type ( ) const
inline

Definition at line 120 of file knjobdata.h.

Member Data Documentation

KNServerInfo::Ptr KNJobData::a_ccount
protected

Definition at line 203 of file knjobdata.h.

KNJobConsumer* KNJobData::c_onsumer
protected

Definition at line 210 of file knjobdata.h.

KNJobItem::Ptr KNJobData::d_ata
protected

Definition at line 202 of file knjobdata.h.

bool KNJobData::mCanceled
protected

Cancel status flag.

Definition at line 209 of file knjobdata.h.

int KNJobData::mError
protected

The job error code (see KIO::Error).

Definition at line 205 of file knjobdata.h.

QString KNJobData::mErrorString
protected

The error message.

Definition at line 207 of file knjobdata.h.

QPointer<KJob> KNJobData::mJob
protected

An associated KJob.

Definition at line 212 of file knjobdata.h.

KPIM::ProgressItem* KNJobData::mProgressItem
protected

The progress item representing this job to the user.

Definition at line 214 of file knjobdata.h.

jobType KNJobData::t_ype
protected

Definition at line 201 of file knjobdata.h.


The documentation for this class was generated from the following files:
  • knjobdata.h
  • knjobdata.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal