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

KDECore

KServiceType Class Reference

A service type is, well, a type of service, where a service is an application or plugin. More...

#include <kservicetype.h>

Inheritance diagram for KServiceType:
KSycocaEntry KMimeType KFolderMimeType

List of all members.

Public Types

typedef QList< Ptr > List
typedef KSharedPtr< KServiceType > Ptr

Public Member Functions

QString comment () const
KDE_DEPRECATED QString desktopEntryPath () const
bool inherits (const QString &servTypeName) const
bool isDerived () const
 KServiceType (QDataStream &_str, int offset)
 KServiceType (KDesktopFile *config)
QString parentServiceType () const
Ptr parentType ()
QVariant::Type propertyDef (const QString &_name) const
QStringList propertyDefNames () const
QMap< QString, QVariant::Type > propertyDefs () const
int serviceOffersOffset () const
void setServiceOffersOffset (int offset)
virtual ~KServiceType ()

Static Public Member Functions

static List allServiceTypes ()
static Ptr serviceType (const QString &_name)

Protected Member Functions

 KServiceType (KServiceTypePrivate &dd, const QString &_name, const QString &_comment)
 KServiceType (KServiceTypePrivate &dd)

Detailed Description

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

Definition at line 43 of file kservicetype.h.


Member Typedef Documentation

typedef QList<Ptr> KServiceType::List

Reimplemented from KSycocaEntry.

Reimplemented in KMimeType.

Definition at line 47 of file kservicetype.h.

typedef KSharedPtr<KServiceType> KServiceType::Ptr

Reimplemented from KSycocaEntry.

Reimplemented in KMimeType.

Definition at line 46 of file kservicetype.h.


Constructor & Destructor Documentation

KServiceType::KServiceType ( KDesktopFile *  config  )  [explicit]

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

Parameters:
config the configuration file

Definition at line 44 of file kservicetype.cpp.

KServiceType::KServiceType ( QDataStream &  _str,
int  offset 
)

For internal use only.

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

Definition at line 99 of file kservicetype.cpp.

KServiceType::~KServiceType (  )  [virtual]

Definition at line 130 of file kservicetype.cpp.

KServiceType::KServiceType ( KServiceTypePrivate &  dd  )  [protected]

Construct a servicetype from another servicetype's private object.

Parameters:
dd the private object

Definition at line 104 of file kservicetype.cpp.

KServiceType::KServiceType ( KServiceTypePrivate &  dd,
const QString &  _name,
const QString &  _comment 
) [protected]

Construct a servicetype based on another servicetype's private object.

Allows the name and comment to be overridden.

Parameters:
dd the private object
_name the name of the service type
_comment a comment (can be empty)

Definition at line 35 of file kservicetype.cpp.


Member Function Documentation

KServiceType::List KServiceType::allServiceTypes (  )  [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

Definition at line 199 of file kservicetype.cpp.

QString KServiceType::comment (  )  const

Returns the descriptive comment associated, if any.

Returns:
the comment, or QString()

Definition at line 235 of file kservicetype.cpp.

QString KServiceType::desktopEntryPath (  )  const

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

Definition at line 242 of file kservicetype.cpp.

bool KServiceType::inherits ( const QString &  servTypeName  )  const

Checks whether this service type is or inherits from servTypeName.

Returns:
true if this servicetype is or inherits from servTypeName

Definition at line 140 of file kservicetype.cpp.

bool KServiceType::isDerived (  )  const

Checks whether this service type inherits another one.

Returns:
true if this service type inherits another one
See also:
parentServiceType()

Definition at line 247 of file kservicetype.cpp.

QString KServiceType::parentServiceType (  )  const

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()

Definition at line 134 of file kservicetype.cpp.

KServiceType::Ptr KServiceType::parentType (  ) 

For internal use only.

Pointer to parent service type

Definition at line 204 of file kservicetype.cpp.

QVariant::Type KServiceType::propertyDef ( const QString &  _name  )  const

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

Parameters:
_name the name of the property
Returns:
the property type, or null if not found
See also:
propertyDefNames

Definition at line 181 of file kservicetype.cpp.

QStringList KServiceType::propertyDefNames (  )  const

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>

Definition at line 188 of file kservicetype.cpp.

QMap< QString, QVariant::Type > KServiceType::propertyDefs (  )  const

For internal use only.

(for KBuildServiceTypeFactory)

Definition at line 253 of file kservicetype.cpp.

int KServiceType::serviceOffersOffset (  )  const

For internal use only.

Definition at line 229 of file kservicetype.cpp.

KServiceType::Ptr KServiceType::serviceType ( const QString &  _name  )  [static]

Returns a pointer to the servicetype '_name' or 0L if the service type is unknown.

VERY IMPORTANT : don't store the result in a KServiceType * !

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

Definition at line 194 of file kservicetype.cpp.

void KServiceType::setServiceOffersOffset ( int  offset  ) 

For internal use only.

only used by kbuildsycoca Register offset into offers list

Definition at line 222 of file kservicetype.cpp.


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

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • 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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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