Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KServiceType Class Reference

#include <kservicetype.h>

Inheritance diagram for KServiceType:

KSycocaEntry KShared KMimeType KDEDesktopMimeType KExecMimeType KFolderType List of all members.

Public Types

typedef KSharedPtr< KServiceType > Ptr
typedef QValueList< Ptr > List

Public Methods

 KServiceType (const QString &_fullpath, const QString &_name, const QString &_icon, const QString &_comment)
 KServiceType (const QString &_fullpath)
 KServiceType (KDesktopFile *config)
QString icon () const
QString comment () const
QString name () const
QString desktopEntryPath () const
bool isDerived () const
QString parentServiceType () const
bool inherits (const QString &servTypeName) const
bool isValid () const
virtual void save (QDataStream &)
virtual void load (QDataStream &)

Static Public Methods

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

Protected Methods

virtual void virtual_hook (int id, void *data)

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)

Definition at line 43 of file kservicetype.h.


Constructor & Destructor Documentation

KServiceType::KServiceType const QString &    _fullpath,
const QString &    _name,
const QString &    _icon,
const QString &    _comment
 

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

KServiceType::KServiceType const QString &    _fullpath
 

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

Parameters:
_fullpath  set to "" if calling from a inherited constructor.

KServiceType::KServiceType KDesktopFile   config
 

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


Member Function Documentation

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.

QString KServiceType::comment   const [inline]
 

Returns:
the descriptive comment associated, if any.

Reimplemented in KMimeType.

Definition at line 89 of file kservicetype.h.

QString KServiceType::desktopEntryPath   const [inline]
 

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

Definition at line 101 of file kservicetype.h.

References KSycocaEntry::entryPath().

QString KServiceType::icon   const [inline]
 

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.

Definition at line 84 of file kservicetype.h.

bool KServiceType::inherits const QString &    servTypeName const
 

Returns:
true if this servicetype is or inherits from servTypeName
Since:
3.1

bool KServiceType::isDerived   const [inline]
 

Returns:
true if this service type inherits another one

Definition at line 106 of file kservicetype.h.

bool KServiceType::isValid   [inline, virtual]
 

Returns:
true if valid

Implements KSycocaEntry.

Definition at line 123 of file kservicetype.h.

virtual void KServiceType::load QDataStream &    [virtual]
 

Load ourselves from the data stream.

Implements KSycocaEntry.

Reimplemented in KMimeType.

QString KServiceType::name   const [inline, virtual]
 

Returns:
the name of this service type.

Implements KSycocaEntry.

Definition at line 94 of file kservicetype.h.

KService::List KServiceType::offers const QString &    _servicetype [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.

QString KServiceType::parentServiceType  
 

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

virtual void KServiceType::save QDataStream &    [virtual]
 

Save ourselves to the data stream.

Reimplemented from KSycocaEntry.

Reimplemented in KMimeType.

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


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:23 2003 for kdelibs by doxygen1.2.18