Detailed Description
The QCopEnvelope class encapsulates and sends QCop messages.
This class is obsolete, and its direct equivalent is QtopiaIpcEnvelope. Consider using QtopiaIpcAdaptor or QtopiaServiceRequest instead of QtopiaIpcEnvelope, as they provide a better interface for sending QCop messages.
QCop messages allow applications to communicate with each other by sending messages using QCopEnvelope and receiving messages by connecting to a QCopChannel.
To send a message, use the following protocol:
QCopEnvelope e(channelname, messagename);
e << parameter1 << parameter2 << ...;
For messages without parameters, simply use:
QCopEnvelope e(channelname, messagename);
where:
- channelname is the channel name within Qtopia, commencing with "QPE/".
- messagename is a function identifier followed by a list of types in parentheses. No white space is permitted.
Note: Do not try to simplify this further as it may confuse some compilers.
To receive a message either:
- use the predefined QPE/Application/appname channel in the application. For further information refer to: QtopiaApplication::appMessage().
- create another channel and connect it to a slot using:
myChannel = new QCopChannel( "QPE/FooBar", this );
connect( myChannel, SIGNAL(received(QString,QByteArray)),
this, SLOT(fooBarMessage(QString,QByteArray)) );
See also: Qt Extended IPC and Services.
See also QtopiaIpcAdaptor and QtopiaServiceRequest.
Member Function Documentation
QCopEnvelope::QCopEnvelope ( const QString & channel, const QString & message )
Constructs a QCopEnvelope to write message to channel. If message has parameters then use operator<<() to add the parameters to the envelope.
QCopEnvelope::~QCopEnvelope ()
Writes the message and then destroys the QCopEnvelope.