class KServiceType

# class KServiceType | A service type is the generic notion for a mimetype, a type of service instead of a type of file. More...
Definition | `#include <kservicetype.h>`
Inherits | KSycocaEntry (kdecore) [public ]
Inherited by | KDEDesktopMimeType, KExecMimeType, KFolderType, KMimeType
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- typedef KSharedPtr Ptr
- typedef QValueList List

#### Public Methods

- KServiceType ( const QString & _fullpath, const QString& _name, const QString& _icon, const QString& _comment)
- KServiceType ( const QString & _fullpath )
- KServiceType ( KDesktopFile *config)
- KServiceType ( QDataStream& _str, int offset )
- virtual ~KServiceType ()
- QString icon () const
- QString comment () const
- QString name () const
- QString desktopEntryPath () const
- bool isDerived () const
- QString parentServiceType () const
- bool inherits ( const QString& servTypeName ) const
- virtual QVariant property ( const QString& _name ) const
- virtual QStringList propertyNames () const
- bool isValid () const
- virtual QVariant::Type propertyDef ( const QString& _name ) const
- virtual QStringList propertyDefNames () const
- virtual const QMap<QString,QVariant::Type>& propertyDefs () const
- virtual void save ( QDataStream& )
- virtual void load ( QDataStream& )

#### Public Static Methods

- static Ptr serviceType ( const QString& _name )
- static KService::List offers ( const QString& _servicetype )
- static List allServiceTypes ()

#### Protected Methods

- void init ( KDesktopFile *config )
- virtual void virtual_hook ( int id, void* data )

#### Protected Members

- QString m_strName
- QString m_strIcon
- QString m_strComment
- QMap m_mapProps
- QMap m_mapPropDefs
- bool m_bValid
- bool m_bDerived

## Detailed Description

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 (kuserprofile.h)

typedef KSharedPtr<KServiceType> Ptr | ### Ptr

typedef QValueList List | ### List

KServiceType ( const QString & _fullpath, const QString& _name, const QString& _icon, const QString& _comment) | ### KServiceType

Constructor. You may pass in arguments to create a servicetype with specific properties

KServiceType ( const QString & _fullpath ) | ### KServiceType

Construct a service type and take all informations from a config file.

Parameters:

_fullpath | set to "" if calling from a inherited constructor.

KServiceType ( KDesktopFile *config) | ### KServiceType

Construct a service type and take all informations from a deskop file.

KServiceType ( QDataStream& _str, int offset ) | ### KServiceType

The stream must already be positionned at the correct offset

~KServiceType () | ### ~KServiceType

[virtual]

QString icon () | ### icon

[const]

Returns: the icon associated with this service type. Some derived classes offer special functions which take for example an URL and returns a special icon for this URL. An example is KMimeType, KFolderType and others.

QString comment () | ### comment

[const]

Returns: the descriptive comment associated, if any.

QString name () | ### name

[const]

Returns: the name of this service type.

Reimplemented from KSycocaEntry.

QString desktopEntryPath () | ### desktopEntryPath

[const]

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

bool isDerived () | ### isDerived

[const]

Returns: true if this service type inherits another one

QString parentServiceType () | ### parentServiceType

[const]

If this service type inherits from another service type, return the name of the parent. Otherwise QString::null.

bool inherits ( const QString& servTypeName ) | ### inherits

[const]

Returns: true if this servicetype is or inherits from `servTypeName`

QVariant property ( const QString& _name ) | ### property

[const virtual]

QStringList propertyNames () | ### propertyNames

[const virtual]

bool isValid () | ### isValid

[const]

Reimplemented from KSycocaEntry.

QVariant::Type propertyDef ( const QString& _name ) | ### propertyDef

[const virtual]

QStringList propertyDefNames () | ### propertyDefNames

[const virtual]

const QMap<QString,QVariant::Type>& propertyDefs () | ### propertyDefs

[const virtual]

void save ( QDataStream& ) | ### save

[virtual]

Save ourselves to the data stream.

Reimplemented from KSycocaEntry.

void load ( QDataStream& ) | ### load

[virtual]

Load ourselves from the data stream.

Reimplemented from KSycocaEntry.

Ptr serviceType ( const QString& _name ) | ### serviceType

[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 * !

KService::List offers ( const QString& _servicetype ) | ### offers

[static]

Returns: all services supporting the given servicetype name This doesn't take care of the user profile. In fact it is used by KServiceTypeProfile, which is used by KTrader, and that's the one you should use.

List allServiceTypes () | ### 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.

void init ( KDesktopFile *config ) | ### init

[protected]

QString m_strName | ### m_strName

[protected]

QString m_strIcon | ### m_strIcon

[protected]

QString m_strComment | ### m_strComment

[protected]

QMap<QString,QVariant> m_mapProps | ### m_mapProps

[protected]

QMap<QString,QVariant::Type> m_mapPropDefs | ### m_mapPropDefs

[protected]

bool m_bValid | ### m_bValid

[protected]

bool m_bDerived | ### m_bDerived

[protected]

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

Reimplemented from KSycocaEntry.

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:57 2003, using kdoc 2.0a54.