KServiceType Class Reference
A service type is the generic notion for a mimetype, a type of service instead of a type of file. More...
#include <kservicetype.h>
Inheritance diagram for KServiceType:


Public Types | |
typedef KSharedPtr< KServiceType > | Ptr |
typedef QValueList< Ptr > | List |
Public Member Functions | |
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 &) |
Ptr | parentType () |
void | addService (KService::Ptr service) |
KService::List | services () |
Static Public Member Functions | |
static Ptr | serviceType (const QString &_name) |
static KService::List | offers (const QString &_servicetype) |
static List | allServiceTypes () |
Protected Member Functions | |
void | init (KDesktopFile *config) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
QString | m_strName |
QString | m_strIcon |
QString | m_strComment |
QMap< QString, QVariant > | m_mapProps |
QMap< QString, QVariant::Type > | m_mapPropDefs |
bool | m_bValid:1 |
bool | m_bDerived:1 |
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). Service types are stored as desktop files in $KDEHOME/share/servicetypes.
- See also:
- KService
Definition at line 45 of file kservicetype.h.
Constructor & Destructor Documentation
|
Constructor. You may pass in arguments to create a servicetype with specific properties.
Definition at line 109 of file kservicetype.cpp. References QString::isEmpty(), m_bValid, m_strComment, m_strIcon, and m_strName. |
|
Construct a service type and take all informations from a config file.
Definition at line 43 of file kservicetype.cpp. References init(). |
|
Construct a service type and take all informations from a deskop file.
Definition at line 51 of file kservicetype.cpp. References init(). |
Member Function Documentation
|
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 94 of file kservicetype.h. Referenced by KDEDesktopMimeType::icon(), KFolderType::icon(), KDEDesktopMimeType::pixmap(), KMimeType::pixmap(), and KFileItem::pixmap(). |
|
Returns the descriptive comment associated, if any.
Reimplemented in KMimeType. Definition at line 100 of file kservicetype.h. |
|
Returns the name of this service type.
Implements KSycocaEntry. Definition at line 106 of file kservicetype.h. Referenced by KServiceTypeFactory::findServiceTypeByName(), inherits(), and KMimeType::is(). |
|
Returns the relative path to the desktop entry file responsible for this servicetype. For instance inode/directory.desktop, or kpart.desktop
Definition at line 114 of file kservicetype.h. References KSycocaEntry::entryPath(). Referenced by parentType(). |
|
Checks whether this service type inherits another one.
Definition at line 121 of file kservicetype.h. |
|
If this service type inherits from another service type, return the name of the parent.
Definition at line 151 of file kservicetype.cpp. References property(), and QVariant::toString(). Referenced by inherits(), and parentType(). |
|
Checks whether this service type is or inherits from
Definition at line 157 of file kservicetype.cpp. References QString::isEmpty(), name(), parentServiceType(), and serviceType(). |
|
Returns the requested property. Some often used properties have convenience access functions like name(), comment() etc.
Reimplemented in KMimeType. Definition at line 174 of file kservicetype.cpp. References QMap::end(), QMap::find(), m_mapProps, m_strComment, m_strIcon, and m_strName. Referenced by parentServiceType(), and KMimeType::property(). |
|
Returns the list of all properties of this service type.
Reimplemented in KMimeType. Definition at line 194 of file kservicetype.cpp. References QMap::begin(), QMap::end(), and m_mapProps. Referenced by KMimeType::propertyNames(). |
|
Checks whether the service type is valid.
Implements KSycocaEntry. Definition at line 158 of file kservicetype.h. Referenced by KServiceTypeFactory::createEntry(), and KMimeType::KMimeType(). |
|
Returns the type of the property with the given
Definition at line 210 of file kservicetype.cpp. References QMap::end(), QMap::find(), and m_mapPropDefs. |
|
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 * !
Definition at line 230 of file kservicetype.cpp. References KServiceTypeFactory::findServiceTypeByName(), and KServiceTypeFactory::self(). Referenced by KService::hasServiceType(), inherits(), and KService::initialPreferenceForMimeType(). |
|
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.
Definition at line 251 of file kservicetype.cpp. References KServiceTypeProfile::configurationMode(), endl(), KServiceTypeFactory::findServiceTypeByName(), QString::isEmpty(), kdWarning(), QString::left(), KSycocaEntry::offset(), KServiceFactory::self(), and KServiceTypeFactory::self(). Referenced by KServiceTypeProfile::offers(). |
|
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.
Definition at line 320 of file kservicetype.cpp. References KServiceTypeFactory::allServiceTypes(), and KServiceTypeFactory::self(). |
The documentation for this class was generated from the following files: