Home · All Classes · All Functions ·

QServiceFilter Class Reference

The QServiceFilter class defines criteria for defining a sub-set of all available services. More...

    #include <QServiceFilter>

Public Types

enum CapabilityMatchRule { MatchAll, MatchLoadable }
enum VersionMatchRule { ExactVersionMatch, MinimumVersionMatch }

Public Functions

QServiceFilter ()
QServiceFilter ( const QServiceFilter & other )
QServiceFilter ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )
~QServiceFilter ()
QStringList capabilities () const
CapabilityMatchRule capabilityMatchRule () const
void clearCustomProperties ()
QString customProperty ( const QString & key ) const
QStringList customPropertyKeys () const
int interfaceMajorVersion () const
int interfaceMinorVersion () const
QString interfaceName () const
void removeCustomProperty ( const QString & key )
QString serviceName () const
void setCapabilities ( QServiceFilter::CapabilityMatchRule rule, const QStringList & capabilities = QStringList() )
void setCustomProperty ( const QString & key, const QString & value )
void setInterface ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )
void setServiceName ( const QString & serviceName )
VersionMatchRule versionMatchRule () const
QServiceFilter & operator= ( const QServiceFilter & other )

Related Non-Members

QDataStream & operator<< ( QDataStream & out, const QServiceFilter & sf )
QDataStream & operator>> ( QDataStream & in, QServiceFilter & sf )

Detailed Description

The QServiceFilter class defines criteria for defining a sub-set of all available services.

A QServiceFilter can be used to constrain the number of services when searching for services. Only those services that match all filter criteria are returned by QServiceManager::findInterfaces().

See also QServiceInterfaceDescriptor and QServiceManager.


Member Type Documentation

enum QServiceFilter::CapabilityMatchRule

This enum describes the capability matching rule.

ConstantValueDescription
QServiceFilter::MatchAll0The filter matches any services that requires all of the given capabilities. This implies that the returned service may require more capabilities than the specified ones. If this rule is provided alongside an empty capability search list the filter will match all available services regardless of their respective capabilities. Such a search is equivalent to a wildcard match. This is the default matching rules.
QServiceFilter::MatchLoadable1The filter matches any service that could be loaded if a client has all of the given capabilities. This includes services with no capabilities. If this rule is provided alongside an empty capability search list the returned services do not require any capabilities and thus can be accessed by any client.

enum QServiceFilter::VersionMatchRule

This enum describes how interface version matching is performed.

ConstantValueDescription
QServiceFilter::ExactVersionMatch0The filter matches any interface implementation that implements the exact version provided.
QServiceFilter::MinimumVersionMatch1The filter matches any interface implementation that implements either the given major/minor version or any subsequent version.


Member Function Documentation

QServiceFilter::QServiceFilter ()

Creates a new filter object that matches all service implementations.

QServiceFilter::QServiceFilter ( const QServiceFilter & other )

Creates a copy of QServiceFilter object contained in other.

QServiceFilter::QServiceFilter ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )

Creates a new filter object that matches all service implementations implementing interfaceName that match the specified version using the given rule.

QServiceFilter::~QServiceFilter ()

Destroys this instance of QServiceFilter.

QStringList QServiceFilter::capabilities () const

Returns the list of capabilities which are used to limit services searches.

The filter matches any services that requires the given or less capabilities and thus enabling clients to query for services for which they have the required capabilties.

See also setCapabilities(), capabilityMatchRule(), and QAbstractSecuritySession.

CapabilityMatchRule QServiceFilter::capabilityMatchRule () const

Returns the capability matching rule for this filter.

See also setCapabilities() and capabilities().

void QServiceFilter::clearCustomProperties ()

Clears all custom properties from the filter's set of constraints

See also removeCustomProperty().

QString QServiceFilter::customProperty ( const QString & key ) const

Returns the value for the custom property key; otherwise returns a null string.

See also setCustomProperty() and removeCustomProperty().

QStringList QServiceFilter::customPropertyKeys () const

Returns the list of custom keys which have been added to the filter.

int QServiceFilter::interfaceMajorVersion () const

Returns the major interface version for this filter.

See also setInterface().

int QServiceFilter::interfaceMinorVersion () const

Returns the minor interface version for this filter.

See also setInterface().

QString QServiceFilter::interfaceName () const

Returns the interface name for this filter.

See also setInterface().

void QServiceFilter::removeCustomProperty ( const QString & key )

Removes the custom property key from the filter's set of constraints

See also clearCustomProperties() and setCustomProperty().

QString QServiceFilter::serviceName () const

Returns the service name for this filter.

See also setServiceName().

void QServiceFilter::setCapabilities ( QServiceFilter::CapabilityMatchRule rule, const QStringList & capabilities = QStringList() )

Sets the list of capabilities which are used to constrain searches for services. The capabilities are matched according to the given rule.

See also capabilities() and QAbstractSecuritySession.

void QServiceFilter::setCustomProperty ( const QString & key, const QString & value )

The filter only matches implementations which have the custom property key with the given value. Such constraints are specified via the <customproperty> tag within the service xml.

See also customProperty() and removeCustomProperty().

void QServiceFilter::setInterface ( const QString & interfaceName, const QString & version = QString(), QServiceFilter::VersionMatchRule rule = QServiceFilter::MinimumVersionMatch )

Sets the filter to match any interface implementation that implements interfaceName with version version. The version is matched according to the given rule. If version is not set, the filter matches any version of the interface implementation.

This method does nothing if version is not a valid version string or if interfaceName is empty.

A valid version string has the format x.y whereby x and y are positive integer numbers.

void QServiceFilter::setServiceName ( const QString & serviceName )

The filter only matches implementations which are provided by the service specified by serviceName.

If the serviceName is empty the filter matches any service.

See also serviceName().

VersionMatchRule QServiceFilter::versionMatchRule () const

Returns the version match rule for this filter.

See also setInterface().

QServiceFilter & QServiceFilter::operator= ( const QServiceFilter & other )

Copies the content of the QServiceFilter object contained in other into this one.


Related Non-Members

QDataStream & operator<< ( QDataStream & out, const QServiceFilter & sf )

Writes service filter sf to the stream out and returns a reference to the stream.

QDataStream & operator>> ( QDataStream & in, QServiceFilter & sf )

Reads a service filter into sf from the stream in and returns a reference to the stream.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0 (Technical Preview)