.TH "KService" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KService \- Represent a service, i.e.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kservice.h>\fP
.PP
Inherits \fBKSycocaEntry\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef \fBKSharedPtr\fP< \fBKService\fP > \fBPtr\fP"
.br
.ti -1c
.RI "typedef \fBQValueList\fP< \fBPtr\fP > \fBList\fP"
.br
.ti -1c
.RI "enum \fBDCOPServiceType_t\fP { \fBDCOP_None\fP =  0, \fBDCOP_Unique\fP, \fBDCOP_Multi\fP, \fBDCOP_Wait\fP }"
.br
.RI "\fI.IP "\(bu" 2
None - This service has no DCOP support 
.IP "\(bu" 2
Unique - This service provides a unique DCOP service. 
.PP
\fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKService\fP (const  \fBQString\fP &_name, const  \fBQString\fP &_exec, const  \fBQString\fP &_icon)"
.br
.RI "\fIConstruct a temporary service with a given name, exec-line and icon. \fP"
.ti -1c
.RI "\fBKService\fP (const  \fBQString\fP &_fullpath)"
.br
.RI "\fIConstruct a service and take all information from a config file. \fP"
.ti -1c
.RI "\fBKService\fP (\fBKDesktopFile\fP *config)"
.br
.RI "\fIConstruct a service and take all information from a desktop file. \fP"
.ti -1c
.RI "\fBKService\fP (\fBQDataStream\fP &_str, int \fBoffset\fP)"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBtype\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBname\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBexec\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBlibrary\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBinit\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBicon\fP () const "
.br
.ti -1c
.RI "\fBQPixmap\fP \fBpixmap\fP (\fBKIcon::Group\fP _group, int _force_size=0, int _state=0, \fBQString\fP *_path=0L) const "
.br
.ti -1c
.RI "bool \fBterminal\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBterminalOptions\fP () const "
.br
.ti -1c
.RI "bool \fBsubstituteUid\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBusername\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBdesktopEntryPath\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBdesktopEntryName\fP () const "
.br
.ti -1c
.RI "\fBDCOPServiceType_t\fP \fBDCOPServiceType\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBpath\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBcomment\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBgenericName\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBkeywords\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBcategories\fP () const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBserviceTypes\fP () const "
.br
.ti -1c
.RI "bool \fBhasServiceType\fP (const  \fBQString\fP &_service) const "
.br
.ti -1c
.RI "bool \fBallowAsDefault\fP () const "
.br
.ti -1c
.RI "bool \fBallowMultipleFiles\fP () const "
.br
.ti -1c
.RI "int \fBinitialPreference\fP () const "
.br
.RI "\fIWhat preference to associate with this service initially (before the user has had any chance to define a profile for it) The bigger the value, the most preferred the service is. \fP"
.ti -1c
.RI "void \fBsetInitialPreference\fP (int i)"
.br
.ti -1c
.RI "bool \fBnoDisplay\fP () const "
.br
.RI "\fIWhether the entry should be suppressed in menus. \fP"
.ti -1c
.RI "\fBQString\fP \fBparentApp\fP () const "
.br
.RI "\fIName of the application this service belongs to. \fP"
.ti -1c
.RI "virtual \fBQVariant\fP \fBproperty\fP (const  \fBQString\fP &_name) const "
.br
.ti -1c
.RI "virtual \fBQStringList\fP \fBpropertyNames\fP () const "
.br
.ti -1c
.RI "bool \fBisValid\fP () const "
.br
.ti -1c
.RI "virtual void \fBload\fP (\fBQDataStream\fP &)"
.br
.ti -1c
.RI "virtual void \fBsave\fP (\fBQDataStream\fP &)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBPtr\fP \fBserviceByName\fP (const  \fBQString\fP &_name)"
.br
.RI "\fIFind a service by name, i.e. \fP"
.ti -1c
.RI "\fBPtr\fP \fBserviceByDesktopPath\fP (const  \fBQString\fP &_name)"
.br
.RI "\fIFind a service by its relative path to the applnk or services directory, for instance 'Internet/konqbrowser.desktop'. \fP"
.ti -1c
.RI "\fBPtr\fP \fBserviceByDesktopName\fP (const  \fBQString\fP &_name)"
.br
.RI "\fIFind a service by the name of its desktop file, not depending on its actual location (as long as it's under the applnk or service directories). \fP"
.ti -1c
.RI "\fBList\fP \fBallServices\fP ()"
.br
.ti -1c
.RI "\fBList\fP \fBallInitServices\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBinit\fP (\fBKDesktopFile\fP *config)"
.br
.ti -1c
.RI "\fBQStringList\fP & \fBaccessServiceTypes\fP ()"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKBuildSycoca\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
Represent a service, i.e. 

an application bound to one or several mimetypes (or servicetypes) as written in its desktop entry file.
.PP
A service may be a library, too. The starting point you need is often the static methods.
.PP
\fBAuthor:\fP
.RS 4
Torben Weis <weis@kde.org> 
.RE
.PP

.PP
Definition at line 43 of file kservice.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKService::DCOPServiceType_t\fP"
.PP
.IP "\(bu" 2
None - This service has no DCOP support 
.IP "\(bu" 2
Unique - This service provides a unique DCOP service. 
.PP
The service name is equal to the desktopEntryName. 
.IP "\(bu" 2
Multi - This service provides a DCOP service which can be run with multiple instances in parallel. The service name of an instance is equal to the desktopEntryName + '-' + the PID of the process. 
.IP "\(bu" 2
Wait - This service has no DCOP support, the launcher will wait till it is finished. 
.PP
Definition at line 162 of file kservice.h.
.PP
Referenced by DCOPServiceType().
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KService::KService (const \fBQString\fP & _name, const \fBQString\fP & _exec, const \fBQString\fP & _icon)"
.PP
Construct a temporary service with a given name, exec-line and icon. Definition at line 58 of file kservice.cpp.
.PP
References KSycocaEntry::m_bDeleted.
.SS "KService::KService (const \fBQString\fP & _fullpath)"
.PP
Construct a service and take all information from a config file. \fBParameters:\fP
.RS 4
\fI_fullpath\fP Full path to the config file. 
.RE
.PP
Definition at line 74 of file kservice.cpp.
.PP
References init().
.SS "KService::KService (\fBKDesktopFile\fP * config)"
.PP
Construct a service and take all information from a desktop file. Definition at line 82 of file kservice.cpp.
.PP
References init().
.SH "Member Function Documentation"
.PP 
.SS "virtual \fBQString\fP KService::type () const\fC [inline, virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
the type of the service ('Application' or 'Service'). 
.RE
.PP
Definition at line 85 of file kservice.h.
.SS "virtual \fBQString\fP KService::name () const\fC [inline, virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
the name of the service. 
.RE
.PP
Implements \fBKSycocaEntry\fP.
.PP
Definition at line 89 of file kservice.h.
.SS "\fBQString\fP KService::exec () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the command that the service executes. 
.RE
.PP
Definition at line 93 of file kservice.h.
.PP
Referenced by KRun::processDesktopExec().
.SS "\fBQString\fP KService::library () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the name of the library that contains the services implementation. 
.RE
.PP
Definition at line 98 of file kservice.h.
.SS "\fBQString\fP KService::init () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the name of the init function to call in this service during startup of \fBKDE\fP. (KControl modules only) 
.RE
.PP
Definition at line 103 of file kservice.h.
.PP
Referenced by KService().
.SS "\fBQString\fP KService::icon () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the icon associated with the service. 
.RE
.PP
Definition at line 108 of file kservice.h.
.SS "\fBQPixmap\fP KService::pixmap (\fBKIcon::Group\fP _group, int _force_size = 0, int _state = 0, \fBQString\fP * _path = 0L) const"
.PP
\fBReturns:\fP
.RS 4
a pixmap for this service (finds and loads \fBicon()\fP) 
.RE
.PP
Definition at line 260 of file kservice.cpp.
.PP
References KIconLoader::addExtraDesktopThemes(), KIconLoader::extraDesktopThemesAdded(), KGlobal::iconLoader(), QPixmap::isNull(), KIconLoader::loadIcon(), and pixmap().
.PP
Referenced by pixmap().
.SS "bool KService::terminal () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true if the service is to be run in a terminal. 
.RE
.PP
Definition at line 117 of file kservice.h.
.PP
Referenced by KRun::processDesktopExec().
.SS "\fBQString\fP KService::terminalOptions () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
any options associated with the terminal the service runs in, if it requires a terminal.
.RE
.PP
The service must be a tty-oriented program. Definition at line 124 of file kservice.h.
.PP
Referenced by KRun::processDesktopExec().
.SS "bool KService::substituteUid () const"
.PP
\fBReturns:\fP
.RS 4
true if the service has to be run under a different uid. 
.RE
.PP
Definition at line 528 of file kservice.cpp.
.PP
References QVariant::isValid(), property(), and QVariant::toBool().
.PP
Referenced by KRun::processDesktopExec().
.SS "\fBQString\fP KService::username () const"
.PP
\fBReturns:\fP
.RS 4
the username under which the service has to be run. 
.RE
.PP
Definition at line 533 of file kservice.cpp.
.PP
References QString::isEmpty(), QVariant::isValid(), property(), and QVariant::toString().
.PP
Referenced by KRun::processDesktopExec().
.SS "\fBQString\fP KService::desktopEntryPath () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the path to the location where the service desktop entry is stored.
.RE
.PP
This is a relative path if the desktop entry was found in any of the locations pointed to by $KDEDIRS (e.g. 'Internet/kppp.desktop') It is a full path if the desktop entry originates from another location. Definition at line 143 of file kservice.h.
.PP
References KSycocaEntry::entryPath().
.PP
Referenced by KRun::run().
.SS "\fBQString\fP KService::desktopEntryName () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the filename of the service desktop entry without any extension. E.g. 'kppp' 
.RE
.PP
Definition at line 149 of file kservice.h.
.PP
Referenced by KRun::run().
.SS "\fBDCOPServiceType_t\fP KService::DCOPServiceType () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
The \fBDCOPServiceType\fP supported by this service. 
.RE
.PP
Definition at line 167 of file kservice.h.
.PP
References DCOPServiceType_t.
.SS "\fBQString\fP KService::path () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the working directory to run the program in. 
.RE
.PP
Definition at line 172 of file kservice.h.
.SS "\fBQString\fP KService::comment () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the descriptive comment for the service, if there is one. 
.RE
.PP
Definition at line 177 of file kservice.h.
.SS "\fBQString\fP KService::genericName () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the generic name for the service, if there is one. (e.g. 'Mail Client') 
.RE
.PP
Definition at line 183 of file kservice.h.
.SS "\fBQStringList\fP KService::keywords () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
a list of descriptive keywords the service, if there are any. 
.RE
.PP
Definition at line 188 of file kservice.h.
.SS "\fBQStringList\fP KService::categories () const"
.PP
\fBReturns:\fP
.RS 4
a list of VFolder categories. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 578 of file kservice.cpp.
.SS "\fBQStringList\fP KService::serviceTypes () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the service types that this service supports. 
.RE
.PP
Definition at line 199 of file kservice.h.
.SS "bool KService::hasServiceType (const \fBQString\fP & _service) const"
.PP
\fBParameters:\fP
.RS 4
\fI_service\fP The name of the service type you are interested in determining whether this services supports.
.RE
.PP
\fBReturns:\fP
.RS 4
true if the service you specified is supported, otherwise \fCfalse\fP. 
.RE
.PP
Definition at line 333 of file kservice.cpp.
.PP
References KServiceType::serviceType().
.SS "bool KService::allowAsDefault () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
true if the service may be used as a default setting, for example in a file manager. Usually that is the case, but some services may only be started when the user selected them. This kind of services returns \fCfalse\fP here. 
.RE
.PP
Definition at line 215 of file kservice.h.
.SS "bool KService::allowMultipleFiles () const"
.PP
\fBReturns:\fP
.RS 4
true if multiple files may be passed to this service at startup. False if only one file at a time may be passed. 
.RE
.PP
Definition at line 569 of file kservice.cpp.
.PP
References QString::find().
.SS "int KService::initialPreference () const\fC [inline]\fP"
.PP
What preference to associate with this service initially (before the user has had any chance to define a profile for it) The bigger the value, the most preferred the service is. Definition at line 228 of file kservice.h.
.SS "bool KService::noDisplay () const"
.PP
Whether the entry should be suppressed in menus. Definition at line 545 of file kservice.cpp.
.PP
References QMap< QString, QVariant >::end(), and QMap< QString, QVariant >::find().
.PP
Referenced by KServiceGroup::childCount(), and KServiceGroup::entries().
.SS "\fBQString\fP KService::parentApp () const"
.PP
Name of the application this service belongs to. (Usefull for e.g. plugins) 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 559 of file kservice.cpp.
.PP
References QMap< QString, QVariant >::end(), and QMap< QString, QVariant >::find().
.SS "\fBQVariant\fP KService::property (const \fBQString\fP & _name) const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
the requested properties. Some often used properties have convenience access functions like \fBexec\fP(), \fBserviceTypes\fP etc.
.RE
.PP
It depends upon the \fBserviceTypes\fP() of this service which properties a service can have.
.PP
\fBSee also:\fP
.RS 4
\fBKServiceType\fP 
.RE
.PP
Definition at line 380 of file kservice.cpp.
.PP
References QMap< QString, QVariant >::end(), KSycocaEntry::entryPath(), QMap< QString, QVariant >::find(), and QString::toInt().
.PP
Referenced by substituteUid(), and username().
.SS "\fBQStringList\fP KService::propertyNames () const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
the list of all properties that this service can have. That means, that some properties may be empty. 
.RE
.PP
Definition at line 471 of file kservice.cpp.
.PP
References QMap< QString, QVariant >::begin(), and QMap< QString, QVariant >::end().
.SS "bool KService::isValid () const\fC [inline, virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
true if the service is valid (e.g. name is not empty) 
.RE
.PP
Implements \fBKSycocaEntry\fP.
.PP
Definition at line 267 of file kservice.h.
.SS "\fBKService::Ptr\fP KService::serviceByName (const \fBQString\fP & _name)\fC [static]\fP"
.PP
Find a service by name, i.e. the translated Name field. You should really not use this method, since the name is translated.
.PP
\fBReturns:\fP
.RS 4
a pointer to the requested service or 0 if the service is unknown. \fIVery\fP \fIimportant\fP: Don't store the result in a KService* ! 
.RE
.PP
Definition at line 505 of file kservice.cpp.
.PP
References KSycocaEntry::Ptr.
.SS "\fBKService::Ptr\fP KService::serviceByDesktopPath (const \fBQString\fP & _name)\fC [static]\fP"
.PP
Find a service by its relative path to the applnk or services directory, for instance 'Internet/konqbrowser.desktop'. Better not use it for menu entries though, since the user can move them. It's ok to use it for services though (e.g. 'http_cache_cleaner.desktop')
.PP
\fBReturns:\fP
.RS 4
a pointer to the requested service or 0 if the service is unknown. \fIVery\fP \fIimportant\fP: Don't store the result in a KService* ! 
.RE
.PP
Definition at line 511 of file kservice.cpp.
.PP
References KSycocaEntry::Ptr.
.SS "\fBKService::Ptr\fP KService::serviceByDesktopName (const \fBQString\fP & _name)\fC [static]\fP"
.PP
Find a service by the name of its desktop file, not depending on its actual location (as long as it's under the applnk or service directories). For instance 'konqbrowser' or 'kcookiejar'. Note that the '.desktop' extension is implicit.
.PP
This is the recommended method (safe even if the user moves stuff) but note that it assumes that no two entries have the same filename.
.PP
\fBReturns:\fP
.RS 4
a pointer to the requested service or 0 if the service is unknown. \fIVery\fP \fIimportant\fP: Don't store the result in a KService* ! 
.RE
.PP
Definition at line 517 of file kservice.cpp.
.PP
References KSycocaEntry::Ptr.
.PP
Referenced by KRun::foundMimeType(), KURIFilterData::iconName(), and KRun::runCommand().
.SS "\fBKService::List\fP KService::allServices ()\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
the whole list of services.
.RE
.PP
Useful for being able to to display them in a list box, for example. More memory consuming than the ones above, don't use unless really necessary. Definition at line 500 of file kservice.cpp.
.SS "\fBKService::List\fP KService::allInitServices ()\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
all services that require initialisation.
.RE
.PP
Only needed by 'kcminit' Definition at line 523 of file kservice.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
