Home · All Classes · Annotated · Functions

QCopObject Class Reference

The QCopObject class provides an interface to messages on a QCop channel which simplifies remote signal and slot invocations More...

#include <QCopObject>

Inherits QObject.

Inherited by InputMethodService, PushService, QCopObjectService, and smsappService.

Public Types

Public Functions

Static Public Members

Protected Types

Protected Functions

Additional Inherited Members


Detailed Description

The QCopObject class provides an interface to messages on a QCop channel which simplifies remote signal and slot invocations

The QCopObject class provides an interface for sending messages on a QCop channel which simplifies remote signal and slot invocations.

See also QCopObjectService and QCopEnvelope.


Member Type Documentation

enum QCopObject::ChannelSelector

Select which of the sender or receiver in QCopObject::connect is the channel.

ConstantValueDescription
QCopObject::AutoDetect0Automatically detect from the arguments (the default).
QCopObject::SenderIsChannel1The sender is the channel, so the receiver is treated as local even if it is an instance of QCopObject. This is normally only needed if both sender and receiver are instances of QCopObject.
QCopObject::ReceiverIsChannel2The receiver is the channel, so the sender is treated as local even if it is an instance of QCopObject. This is normally only needed if both sender and receiver are instances of QCopObject.

enum QCopObject::PublishType

Type of members to publish via QCopObject.

ConstantValueDescription
QCopObject::Signals0Publish only signals.
QCopObject::Slots1Publish only public slots.
QCopObject::SignalsAndSlots2Publish both signals and public slots.


Member Function Documentation

QCopObject::QCopObject ( const QString & channel, QObject * parent = 0 )

Construct a QCop message object for channel and attach it to parent. If channel is empty, then messages are taken from the application's appMessage channel.

QCopObject::~QCopObject ()

Destroy this QCop messaging object.

bool QCopObject::connect ( QObject * sender, const QByteArray & signal, QObject * receiver, const QByteArray & member, QCopObject::ChannelSelector selector = AutoDetect )   [static]

Connect signal on sender to member on receiver. If either sender or receiver are instances of QCopObject, this function will arrange for the signal to be delivered over a QCop channel. If both sender and receiver are local, this function is identical to QObject::connect().

The selector argument allows the caller to disambiguate the case where both sender and receiver are instances of QCopObject.

If the same signal is connected to same slot multiple times, then signal delivery will happen that many times.

See also QCopObject::ChannelSelector.

bool QCopObject::isConnected ( const QByteArray & signal )

Determine if the message on the QCop channel corresponding to signal has been connected to a local slot.

QString QCopObject::memberToMessage ( const QByteArray & member )   [virtual protected]

Convert a signal or slot member name into a QCop message name. The default implementation strips the signal or slot prefix number from member and then normalizes the name to convert types such as const QString& into QString.

bool QCopObject::publish ( const QByteArray & member )   [protected]

Publish the signal or slot called member on this object on the QCop channel represented by this QCopObject.

If member is a slot, then whenever an application sends a message to the channel with that name, the system will arrange for the slot to be invoked.

If member is a signal, then whenever this object emits that signal, the system will arrange for a message with that name to be sent on the channel.

Returns false if member does not refer to a valid signal or slot.

void QCopObject::publishAll ( QCopObject::PublishType type )   [protected]

Publish all signals or public slots on this object within subclasses of QCopObject. This is typically called from a subclass constructor. The type indicates if all signals, all public slots, or both, should be published. Private and protected slots will never be published.

QString QCopObject::receiveChannel ( const QString & channel )   [virtual protected]

Convert channel into a new name to use for receiving messages. The default implementation returns channel.

QCopSendEnvelope QCopObject::send ( const QByteArray & member )

Send a message on the QCop channel which will cause the invocation of member on receiving objects. The return value can be used to add arguments to the message before transmission.

void QCopObject::send ( const QByteArray & member, QVariant arg1 )

This is an overloaded member function, provided for convenience.

Send a message on the QCop channel which will cause the invocation of the single-argument member on receiving objects, with the argument arg1.

void QCopObject::send ( const QByteArray & member, QVariant arg1, QVariant arg2 )

This is an overloaded member function, provided for convenience.

Send a message on the QCop channel which will cause the invocation of the double-argument member on receiving objects, with the arguments arg1 and arg2.

void QCopObject::send ( const QByteArray & member, QVariant arg1, QVariant arg2, QVariant arg3 )

This is an overloaded member function, provided for convenience.

Send a message on the QCop channel which will cause the invocation of the triple-argument member on receiving objects, with the arguments arg1, arg2, and arg3.

void QCopObject::send ( const QByteArray & member, const QList<QVariant> & args )

This is an overloaded member function, provided for convenience.

Send a message on the QCop channel which will cause the invocation of the multi-argument member on receiving objects, with the argument list args.

QStringList QCopObject::sendChannels ( const QString & channel )   [virtual protected]

Convert channel into a list of names to use for sending messages. The default implementation returns a list containing just channel.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7