• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

KDBusServiceStarter Class Reference

#include <kdbusservicestarter.h>

List of all members.


Detailed Description

A generic DBUS service starter, using KServiceTypeTrader.

The default implementation starts new processes, but this interface can also be reimplemented by specific applications to provide dlopened in-process DBus objects. This interface is similar to the startServiceByName() function found in QDBusBusService, but with the added benefit of using KTrader (and, therefore, additional constraints and the ability to search the standard KDE dirs).

Author:
David Faure <faure@kde.org>

Definition at line 37 of file kdbusservicestarter.h.


Public Member Functions

int findServiceFor (const QString &serviceType, const QString &constraint=QString(), QString *error=0, QString *dbusService=0, int flags=0)
virtual int startServiceFor (const QString &serviceType, const QString &constraint=QString(), QString *error=0, QString *dbusService=0, int flags=0)

Static Public Member Functions

static KDBusServiceStarter * self ()

Protected Member Functions

 KDBusServiceStarter ()
virtual ~KDBusServiceStarter ()

Constructor & Destructor Documentation

KDBusServiceStarter::KDBusServiceStarter (  )  [protected]

Definition at line 50 of file kdbusservicestarter.cpp.

KDBusServiceStarter::~KDBusServiceStarter (  )  [protected, virtual]

Definition at line 58 of file kdbusservicestarter.cpp.


Member Function Documentation

int KDBusServiceStarter::findServiceFor ( const QString &  serviceType,
const QString &  constraint = QString(),
QString *  error = 0,
QString *  dbusService = 0,
int  flags = 0 
)

Check if a given DBus service is available - from the serviceType it's supposed to implement.

The trader is queried to find the preferred application for this serviceType, with the constraint that its X-DBus-ServiceName property must be defined. Then the DBus server is checked. If the service is not available, this method will call startServiceFor to start it.

Parameters:
serviceType the type of service we're looking for
constraint see KServiceTypeTrader
error On failure, error contains a description of the error that occurred. If the pointer is 0, the argument will be ignored
dbusService On success, dbusService contains the DBus service name under which this service is available. If the pointer is 0 the argument will be ignored
flags for future extensions (currently unused)
Returns:
an error code indicating success (== 0) or failure (> 0).

Definition at line 62 of file kdbusservicestarter.cpp.

KDBusServiceStarter * KDBusServiceStarter::self (  )  [static]

Definition at line 41 of file kdbusservicestarter.cpp.

int KDBusServiceStarter::startServiceFor ( const QString &  serviceType,
const QString &  constraint = QString(),
QString *  error = 0,
QString *  dbusService = 0,
int  flags = 0 
) [virtual]

Find an implementation of the given serviceType, and start it, to use its DBus interface.

The default implementation uses KServiceTypeTrader to find the preferred Application, and then starts it using KToolInvocation::startService...

However applications (like kontact) can reimplement this method, to provide an in-process way of loading the implementation for this service type.

Parameters:
serviceType the type of service we're looking for
constraint see KServiceTypeTrader
error On failure, error contains a description of the error that occurred. If the pointer is 0, the argument will be ignored
dbusService On success, dbusService contains the DBus service name under which this service is available. If the pointer is 0 the argument will be ignored
flags for future extensions (currently unused)
Returns:
an error code indicating success (== 0) or failure (> 0).

Definition at line 98 of file kdbusservicestarter.cpp.


The documentation for this class was generated from the following files:
  • kdbusservicestarter.h
  • kdbusservicestarter.cpp

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal