Home · All Classes · All Namespaces · Modules · Functions · Files
Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
Tp::PendingOperation Class Reference

The PendingOperation class is a base class for pending asynchronous operations. More...

#include <TelepathyQt/PendingOperation>

Inheritance diagram for Tp::PendingOperation:
Inheritance graph
[legend]

Signals

void finished (Tp::PendingOperation *operation)
 

Public Member Functions

virtual ~PendingOperation ()
 
bool isFinished () const
 
bool isValid () const
 
bool isError () const
 
QString errorName () const
 
QString errorMessage () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual  ~QObject ()
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval)
 
void killTimer (int id)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *receiver, const char *method)
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 
 QObject (QObject *parent, const char *name)
 
void insertChild (QObject *object)
 
void removeChild (QObject *object)
 
bool isA (const char *className) const
 
const char * className () const
 
const char * name () const
 
const char * name (const char *defaultName) const
 
void setName (const char *name)
 

Protected Slots

void setFinished ()
 
void setFinishedWithError (const QString &name, const QString &message)
 
void setFinishedWithError (const QDBusError &error)
 

Protected Member Functions

 PendingOperation (const SharedPtr< RefCounted > &object)
 
SharedPtr< RefCountedobject () const
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void disconnectNotify (const char *signal)
 
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The PendingOperation class is a base class for pending asynchronous operations.

This class represents an incomplete asynchronous operation, such as a D-Bus method call. When the operation has finished, it emits finished(). The slot or slots connected to the finished() signal may obtain additional information from the pending operation.

In simple cases, like a D-Bus method with no 'out' arguments or for which all 'out' arguments are to be ignored (so the possible results are success with no extra information, or failure with an error code), the trivial subclass PendingVoid can be used.

For pending operations that produce a result, another subclass of PendingOperation can be used, with additional methods that provide that result to the library user.

After finished() is emitted, the PendingOperation is automatically deleted using deleteLater(), so library users must not explicitly delete this object.

The design is loosely based on KDE's KJob.

See Asynchronous Object Model

Constructor & Destructor Documentation

Tp::PendingOperation::~PendingOperation ( )
virtual

Class destructor.

Tp::PendingOperation::PendingOperation ( const SharedPtr< RefCounted > &  object)
protected

Construct a new PendingOperation object.

Parameters
objectThe object on which this pending operation takes place.

Member Function Documentation

bool Tp::PendingOperation::isFinished ( ) const

Return whether or not the request has finished processing.

The signal finished() is emitted when this changes from false to true.

Equivalent to (isValid() || isError()).

Returns
true if the request has finished, false otherwise.
See also
finished()
bool Tp::PendingOperation::isValid ( ) const

Return whether or not the request completed successfully. If the request has not yet finished processing (isFinished() returns false), this cannot yet be known, and false will be returned.

Equivalent to (isFinished() && !isError()).

Returns
true if the request has finished processing and has completed successfully, false otherwise.
bool Tp::PendingOperation::isError ( ) const

Return whether or not the request resulted in an error.

If the request has not yet finished processing (isFinished() returns false), this cannot yet be known, and false will be returned.

Equivalent to (isFinished() && !isValid()).

Returns
true if the request has finished processing and has resulted in an error, false otherwise.
QString Tp::PendingOperation::errorName ( ) const

If isError() returns true, returns the D-Bus error with which the operation failed. If the operation succeeded or has not yet finished, returns an empty string.

Returns
A D-Bus error name, or an empty string.
QString Tp::PendingOperation::errorMessage ( ) const

If isError() would return true, returns a debugging message associated with the error, which may be an empty string. Otherwise, return an empty string.

Returns
A debugging message, or an empty string.
void Tp::PendingOperation::finished ( Tp::PendingOperation operation)
signal

Emitted when the pending operation finishes, i.e. when isFinished() changes from false to true.

Parameters
operationThis operation object, from which further information may be obtained.
SharedPtr< RefCounted > Tp::PendingOperation::object ( ) const
protected

Return the object on which this pending operation takes place.

Returns
A pointer to a RefCounted object.
void Tp::PendingOperation::setFinished ( )
protectedslot

Record that this pending operation has finished successfully, and emit the finished() signal next time the event loop runs.

void Tp::PendingOperation::setFinishedWithError ( const QString name,
const QString message 
)
protectedslot

Record that this pending operation has finished with an error, and emit the finished() signal next time the event loop runs.

Parameters
nameThe D-Bus error name, which must be non-empty.
messageThe debugging message.
void Tp::PendingOperation::setFinishedWithError ( const QDBusError error)
protectedslot

Record that this pending operation has finished with an error, and emit the finished() signal next time the event loop runs.

Parameters
errorThe error.
See also
finished()


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.6