# class KServiceType

###

Module | kdecore
Namespace |
Class | KServiceType
Inherits | KSycocaEntry

A service type is, well, a type of service, where a service is an application or plugin. For instance, "KOfficeFilter", which is the type of all koffice filters, is a service type. In order to discover services of a given type, using KServiceTypeTrader. Service types are stored as desktop files in $KDEDIR/share/servicetypes.

See also KService, KServiceTypeTrader

### methods

- KServiceType (config)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  config | KDesktopFile |

  Construct a service type and take all information from a desktop file.

  config - the configuration file

- KServiceType (_str, offset)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  _str | QDataStream |
  offset | int |

  Internal construct a service from a stream. The stream must already be positionned at the correct offset

- KServiceType (dd)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dd | KServiceTypePrivate |

  Internal construct a service from a stream. The stream must already be positionned at the correct offset

- KServiceType (dd, _name, _comment)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dd | KServiceTypePrivate |
  _name | QString |
  _comment | QString |

  Constructor for KMimeType.

  _name - the name of the service type

  _comment - a comment (can be empty)

- KServiceType (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KDesktopFile |

- allServiceTypes ( )

  returns KServiceType.List
  static

  Returns a list of all the supported servicetypes. 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. Returns the list of all services

- comment ( )

  returns QString

  Returns the descriptive comment associated, if any. Returns the comment, or QString()

- desktopEntryPath ( )

  returns QString

  Returns the relative path to the desktop entry file responsible for this servicetype. For instance inode/directory.desktop, or kpart.desktop Returns the path of the desktop file

- inherits (servTypeName)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  servTypeName | QString |

  Checks whether this service type is or inherits from servTypeName. Returns true if this servicetype is or inherits from servTypeName

- isDerived ( )

  returns bool

  Checks whether this service type inherits another one. Returns true if this service type inherits another one

  See also parentServiceType()

- parentServiceType ( )

  returns QString

  If this service type inherits from another service type, return the name of the parent. Returns the parent service type, or QString. null if not set

  See also isDerived()

- parentType ( )

  returns KServiceType.Ptr

  Internal Pointer to parent service type

- propertyDef (_name)

  returns QVariant.Type

  Argument | Type | Default
  --- | --- | ---
  _name | QString |

  Returns the type of the property definition with the given _name.

  _name - the name of the property Returns the property type, or null if not found

  See also propertyDefNames

- propertyDefNames ( )

  returns QStringList

  Returns the list of all property definitions for this servicetype. Those are properties of the services implementing this servicetype. For instance,

      [PropertyDef.X-KDevelop-Version]
      Type=int

  means that all kdevelop plugins have in their .desktop file a line like

      X-KDevelop-Version=<some value>

- propertyDefs ( )

  returns QMap<QString,QVariant::Type>

  Internal (for KBuildServiceTypeFactory)

- serviceOffersOffset ( )

  returns int

  Internal

- serviceType (_name)

  returns KServiceType.Ptr
  static

  Argument | Type | Default
  --- | --- | ---
  _name | QString |

  Returns a pointer to the servicetype '_name' or 0 if the service type is unknown. VERY IMPORTANT : don't store the result in a KServiceType * !

  _name - the name of the service type to search Returns the pointer to the service type, or 0

- setServiceOffersOffset (offset)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  offset | int |

  Internal only used by kbuildsycoca Register offset into offers list