Qt API | Qtopia API | Qtopia Documentation |

# ServiceRequest Class Reference

The ServiceRequest class allows applications to request services from other applications. More...

`#include <qtopia/services.h>`

Inherits QDataStream.

List of all member functions.

## Public Members

- ServiceRequest ()
- ServiceRequest ( const QString & service, const QCString & message )
- ServiceRequest ( const ServiceRequest & orig )
- ~ServiceRequest ()
- bool send () const
- bool isNull () const
- void setService ( const QString & service )
- QString service () const
- QStrList channels ( bool automatics = TRUE ) const
- QCString channel ( const QString & appname = QString::null, bool automatics = TRUE ) const
- QStringList apps ( bool automatics = TRUE ) const
- QString app ( const QString & appname = QString::null, bool automatics = TRUE ) const
- void setMessage ( const QCString & message )
- QCString message () const
- const QByteArray data () const
- ServiceRequest & operator= ( const ServiceRequest & orig )

## Detailed Description

The ServiceRequest class allows applications to request services from other applications.

A ServiceRequest encapsulates a Service and the message to be sent to that service. It is similar to a QCopEnvelope, but uses service names rather than direct application names.

Since ServiceRequest inherits QDataStream, you can write data to the request before sending it with send().

See also Service and Qtopia Classes.

## Member Function Documentation

### ServiceRequest::ServiceRequest ()

Construct a null service request. You will need to call setService() and setMessage() before send(), but you may write to the service beforehand.

### ServiceRequest::ServiceRequest ( const QString & service, const QCString & message )

Construct a service request that will send message to a service when you call send(). You may write to the service beforehand.

### ServiceRequest::ServiceRequest ( const ServiceRequest & orig )

Copy constructor. Any data previously written to the orig service will be in the copy.

### ServiceRequest::~ServiceRequest ()

Destructs the service request. Unlike QCopEnvelope, the request is NOT automatically sent.

### QString ServiceRequest::app ( const QString & appname = QString::null, bool automatics = TRUE ) const

See Service::app().

### QStringList ServiceRequest::apps ( bool automatics = TRUE ) const

See Service::apps().

### QCString ServiceRequest::channel ( const QString & appname = QString::null, bool automatics = TRUE ) const

See Service::channel().

### QStrList ServiceRequest::channels ( bool automatics = TRUE ) const

See Service::channels().

### const QByteArray ServiceRequest::data () const

Returns the current stored data. Before you modify the returned value, you must call QArray::detach().

### bool ServiceRequest::isNull () const

Returns TRUE if either the service or message is not set.

### ServiceRequest & ServiceRequest::operator= ( const ServiceRequest & orig )

Assignment operator. Any data previously written to the orig service will be in the copy.

### bool ServiceRequest::send () const

Sends the request. Returns FALSE if the request was null.

### void ServiceRequest::setMessage ( const QCString & message )

Sets the message to be sent to the service.

### void ServiceRequest::setService ( const QString & service )

Sets the service to which the request will be sent.

This file is part of the Qtopia , copyright © 1995-2002 Trolltech, all rights reserved.