.TH "KServiceType" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KServiceType \- A service type is the generic notion for a mimetype, a type of service instead of a type of file.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kservicetype.h>\fP
.PP
Inherits \fBKSycocaEntry\fP.
.PP
Inherited by \fBKMimeType\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "typedef \fBKSharedPtr\fP< \fBKServiceType\fP > \fBPtr\fP"
.br
.ti -1c
.RI "typedef \fBQValueList\fP< \fBPtr\fP > \fBList\fP"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKServiceType\fP (const \fBQString\fP &_fullpath, const \fBQString\fP &_name, const \fBQString\fP &_icon, const \fBQString\fP &_comment)"
.br
.ti -1c
.RI "\fBKServiceType\fP (const \fBQString\fP &_fullpath)"
.br
.ti -1c
.RI "\fBKServiceType\fP (\fBKDesktopFile\fP *config)"
.br
.ti -1c
.RI "\fBKServiceType\fP (\fBQDataStream\fP &_str, int \fBoffset\fP)"
.br
.ti -1c
.RI "\fBQString\fP \fBicon\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBcomment\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBname\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBdesktopEntryPath\fP () const "
.br
.ti -1c
.RI "bool \fBisDerived\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBparentServiceType\fP () const "
.br
.ti -1c
.RI "bool \fBinherits\fP (const \fBQString\fP &servTypeName) const "
.br
.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 QVariant::Type \fBpropertyDef\fP (const \fBQString\fP &_name) const "
.br
.ti -1c
.RI "virtual \fBQStringList\fP \fBpropertyDefNames\fP () const "
.br
.ti -1c
.RI "virtual const \fBQMap\fP< \fBQString\fP, QVariant::Type > & \fBpropertyDefs\fP () const "
.br
.ti -1c
.RI "virtual void \fBsave\fP (\fBQDataStream\fP &)"
.br
.ti -1c
.RI "virtual void \fBload\fP (\fBQDataStream\fP &)"
.br
.ti -1c
.RI "\fBPtr\fP \fBparentType\fP ()"
.br
.ti -1c
.RI "void \fBaddService\fP (\fBKService::Ptr\fP service)"
.br
.ti -1c
.RI "\fBKService::List\fP \fBservices\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBPtr\fP \fBserviceType\fP (const \fBQString\fP &_name)"
.br
.ti -1c
.RI "static \fBKService::List\fP \fBoffers\fP (const \fBQString\fP &_servicetype)"
.br
.ti -1c
.RI "static \fBList\fP \fBallServiceTypes\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

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

.in +1c
.ti -1c
.RI "\fBQString\fP \fBm_strName\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBm_strIcon\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBm_strComment\fP"
.br
.ti -1c
.RI "\fBQMap\fP< \fBQString\fP, \fBQVariant\fP > \fBm_mapProps\fP"
.br
.ti -1c
.RI "\fBQMap\fP< \fBQString\fP, QVariant::Type > \fBm_mapPropDefs\fP"
.br
.ti -1c
.RI "bool \fBm_bValid\fP:1"
.br
.ti -1c
.RI "bool \fBm_bDerived\fP:1"
.br
.in -1c
.SH "Detailed Description"
.PP 
A service type is the generic notion for a mimetype, a type of service instead of a type of file. 

For instance, KOfficeFilter is a service type. It is associated to services according to the user profile (\fBkuserprofile.h\fP). Service types are stored as desktop files in $KDEHOME/share/servicetypes. 
.PP
\fBSee also:\fP
.RS 4
\fBKService\fP 
.RE
.PP

.PP
Definition at line 45 of file kservicetype.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KServiceType::KServiceType (const \fBQString\fP & _fullpath, const \fBQString\fP & _name, const \fBQString\fP & _icon, const \fBQString\fP & _comment)"
.PP
Constructor. 
.PP
You may pass in arguments to create a servicetype with specific properties. 
.PP
\fBParameters:\fP
.RS 4
\fI_fullpath\fP the path of the service type's desktop file 
.br
\fI_name\fP the name of the service type 
.br
\fI_icon\fP the icon name of the service type (can be null) 
.br
\fI_comment\fP a comment (can be null) 
.RE
.PP

.PP
Definition at line 109 of file kservicetype.cpp.
.PP
References QString::isEmpty().
.SS "KServiceType::KServiceType (const \fBQString\fP & _fullpath)"
.PP
Construct a service type and take all informations from a config file. 
.PP
\fBParameters:\fP
.RS 4
\fI_fullpath\fP path of the desktop file, set to '' if calling from a inherited constructor. 
.RE
.PP

.PP
Definition at line 43 of file kservicetype.cpp.
.SS "KServiceType::KServiceType (\fBKDesktopFile\fP * config)"
.PP
Construct a service type and take all informations from a deskop file. 
.PP
\fBParameters:\fP
.RS 4
\fIconfig\fP the configuration file 
.RE
.PP

.PP
Definition at line 51 of file kservicetype.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KServiceType::icon () const\fC [inline]\fP"
.PP
Returns the icon associated with this service type. 
.PP
Some derived classes offer special functions which take for example an URL and returns a special icon for this URL. An example is \fBKMimeType\fP, \fBKFolderType\fP and others. 
.PP
\fBReturns:\fP
.RS 4
the name of the icon, can be QString::null. 
.RE
.PP

.PP
Definition at line 94 of file kservicetype.h.
.PP
Referenced by KDEDesktopMimeType::icon(), KFolderType::icon(), KDEDesktopMimeType::pixmap(), and KMimeType::pixmap().
.SS "\fBQString\fP KServiceType::comment () const\fC [inline]\fP"
.PP
Returns the descriptive comment associated, if any. 
.PP
\fBReturns:\fP
.RS 4
the comment, or QString::null 
.RE
.PP

.PP
Reimplemented in \fBKMimeType\fP.
.PP
Definition at line 100 of file kservicetype.h.
.SS "\fBQString\fP KServiceType::name () const\fC [inline, virtual]\fP"
.PP
Returns the name of this service type. 
.PP
\fBReturns:\fP
.RS 4
the name of the service type 
.RE
.PP

.PP
Implements \fBKSycocaEntry\fP.
.PP
Definition at line 106 of file kservicetype.h.
.PP
Referenced by inherits(), and KMimeType::is().
.SS "\fBQString\fP KServiceType::desktopEntryPath () const\fC [inline]\fP"
.PP
Returns the relative path to the desktop entry file responsible for this servicetype. 
.PP
For instance inode/directory.desktop, or kpart.desktop 
.PP
\fBReturns:\fP
.RS 4
the path of the desktop file 
.RE
.PP

.PP
Definition at line 114 of file kservicetype.h.
.PP
References KSycocaEntry::entryPath().
.SS "bool KServiceType::isDerived () const\fC [inline]\fP"
.PP
Checks whether this service type inherits another one. 
.PP
\fBReturns:\fP
.RS 4
true if this service type inherits another one 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBparentServiceType()\fP 
.RE
.PP

.PP
Definition at line 121 of file kservicetype.h.
.SS "\fBQString\fP KServiceType::parentServiceType () const"
.PP
If this service type inherits from another service type, return the name of the parent. 
.PP
\fBReturns:\fP
.RS 4
the parent service type, or \fBQString\fP:: null if not set 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBisDerived()\fP 
.RE
.PP

.PP
Definition at line 151 of file kservicetype.cpp.
.PP
References property(), and QVariant::toString().
.PP
Referenced by inherits().
.SS "bool KServiceType::inherits (const \fBQString\fP & servTypeName) const"
.PP
Checks whether this service type is or inherits from \fCservTypeName\fP. 
.PP
\fBReturns:\fP
.RS 4
true if this servicetype is or inherits from \fCservTypeName\fP 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 157 of file kservicetype.cpp.
.PP
References QString::isEmpty(), name(), parentServiceType(), and serviceType().
.SS "\fBQVariant\fP KServiceType::property (const \fBQString\fP & _name) const\fC [virtual]\fP"
.PP
Returns the requested property. 
.PP
Some often used properties have convenience access functions like \fBname()\fP, \fBcomment()\fP etc.
.PP
\fBParameters:\fP
.RS 4
\fI_name\fP the name of the property 
.RE
.PP
\fBReturns:\fP
.RS 4
the property, or invalid if not found 
.RE
.PP

.PP
Reimplemented in \fBKMimeType\fP.
.PP
Definition at line 174 of file kservicetype.cpp.
.PP
References QMap::end(), and QMap::find().
.PP
Referenced by parentServiceType(), and KMimeType::property().
.SS "\fBQStringList\fP KServiceType::propertyNames () const\fC [virtual]\fP"
.PP
Returns the list of all properties of this service type. 
.PP
\fBReturns:\fP
.RS 4
the list of properties 
.RE
.PP

.PP
Reimplemented in \fBKMimeType\fP.
.PP
Definition at line 194 of file kservicetype.cpp.
.PP
References QMap::begin(), and QMap::end().
.PP
Referenced by KMimeType::propertyNames().
.SS "bool KServiceType::isValid () const\fC [inline, virtual]\fP"
.PP
Checks whether the service type is valid. 
.PP
\fBReturns:\fP
.RS 4
true if the service is valid (e.g. name is not empty) 
.RE
.PP

.PP
Implements \fBKSycocaEntry\fP.
.PP
Definition at line 158 of file kservicetype.h.
.PP
Referenced by KMimeType::KMimeType().
.SS "QVariant::Type KServiceType::propertyDef (const \fBQString\fP & _name) const\fC [virtual]\fP"
.PP
Returns the type of the property with the given \fC_name\fP. 
.PP
\fBParameters:\fP
.RS 4
\fI_name\fP the name of the property 
.RE
.PP
\fBReturns:\fP
.RS 4
the property type, or null if not found 
.RE
.PP

.PP
Definition at line 210 of file kservicetype.cpp.
.PP
References QMap::end(), and QMap::find().
.SS "\fBKServiceType::Ptr\fP KServiceType::serviceType (const \fBQString\fP & _name)\fC [static]\fP"
.PP
Returns a pointer to the servicetype '_name' or 0L if the service type is unknown. 
.PP
VERY IMPORTANT : don't store the result in a KServiceType * ! 
.PP
\fBParameters:\fP
.RS 4
\fI_name\fP the name of the service type to search 
.RE
.PP
\fBReturns:\fP
.RS 4
the pointer to the service type, or 0 
.RE
.PP

.PP
Definition at line 230 of file kservicetype.cpp.
.PP
Referenced by KService::hasServiceType(), inherits(), and KService::initialPreferenceForMimeType().
.SS "\fBKService::List\fP KServiceType::offers (const \fBQString\fP & _servicetype)\fC [static]\fP"
.PP
Returns all services supporting the given servicetype name. 
.PP
This doesn't take care of the user profile. In fact it is used by \fBKServiceTypeProfile\fP, which is used by \fBKTrader\fP, and that's the one you should use. 
.PP
\fBParameters:\fP
.RS 4
\fI_servicetype\fP the name of the service type to search 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of all services of the given type 
.RE
.PP

.PP
Definition at line 251 of file kservicetype.cpp.
.PP
References endl(), QString::isEmpty(), kdWarning(), and KSycocaEntry::offset().
.PP
Referenced by KServiceTypeProfile::offers().
.SS "\fBKServiceType::List\fP KServiceType::allServiceTypes ()\fC [static]\fP"
.PP
Returns a list of all the supported servicetypes. 
.PP
Useful for showing the list of available servicetypes in a listbox, for example. More memory consuming than the ones above, don't use unless really necessary. 
.PP
\fBReturns:\fP
.RS 4
the list of all services 
.RE
.PP

.PP
Definition at line 320 of file kservicetype.cpp.

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