.TH "KDEDesktopMimeType" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDEDesktopMimeType \- Mime type for desktop files. Mimetype for a .desktop file.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kmimetype.h>\fP
.PP
Inherits \fBKMimeType\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBServiceType\fP { \fBST_MOUNT\fP, \fBST_UNMOUNT\fP, \fBST_USER_DEFINED\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDEDesktopMimeType\fP (\fBKDesktopFile\fP *config)"
.br
.ti -1c
.RI "\fBKDEDesktopMimeType\fP (\fBQDataStream\fP &_str, int \fBoffset\fP)"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBicon\fP (const \fBQString\fP &_url, bool _is_local) const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBicon\fP (const \fBKURL\fP &_url, bool _is_local) const "
.br
.ti -1c
.RI "virtual \fBQPixmap\fP \fBpixmap\fP (const \fBKURL\fP &_url, \fBKIcon::Group\fP _group, int _force_size=0, int _state=0, \fBQString\fP *_path=0L) const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBcomment\fP (const \fBQString\fP &_url, bool _is_local) const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBcomment\fP (const \fBKURL\fP &_url, bool _is_local) const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQValueList\fP< \fBService\fP > \fBbuiltinServices\fP (const \fBKURL\fP &_url)"
.br
.ti -1c
.RI "static \fBQValueList\fP< \fBService\fP > \fBuserDefinedServices\fP (const \fBQString\fP &path, bool bLocalFiles)"
.br
.ti -1c
.RI "static \fBQValueList\fP< \fBService\fP > \fBuserDefinedServices\fP (const \fBQString\fP &path, \fBKConfig\fP &config, bool bLocalFiles)"
.br
.ti -1c
.RI "static void \fBexecuteService\fP (const \fBQString\fP &_path, \fBKDEDesktopMimeType::Service\fP &_service) KDE_DEPRECATED"
.br
.ti -1c
.RI "static void \fBexecuteService\fP (const \fBKURL::List\fP &urls, \fBKDEDesktopMimeType::Service\fP &service)"
.br
.ti -1c
.RI "static pid_t \fBrun\fP (const \fBKURL\fP &_url, bool _is_local)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBQPixmap\fP \fBpixmap\fP (\fBKIcon::Group\fP a, int b, int c, \fBQString\fP *d) const "
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Static Protected Member Functions"

.in +1c
.ti -1c
.RI "static pid_t \fBrunFSDevice\fP (const \fBKURL\fP &_url, const \fBKSimpleConfig\fP &cfg)"
.br
.ti -1c
.RI "static pid_t \fBrunApplication\fP (const \fBKURL\fP &_url, const \fBQString\fP &_serviceFile)"
.br
.ti -1c
.RI "static pid_t \fBrunLink\fP (const \fBKURL\fP &_url, const \fBKSimpleConfig\fP &cfg)"
.br
.ti -1c
.RI "static pid_t \fBrunMimeType\fP (const \fBKURL\fP &_url, const \fBKSimpleConfig\fP &cfg)"
.br
.in -1c
.SS "Classes"

.in +1c
.ti -1c
.RI "struct \fBService\fP"
.br
.RI "\fIStructure representing a service, in the list of services returned by builtinServices and userDefinedServices. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Mime type for desktop files. Mimetype for a .desktop file. 

Handles mount/umount icon, and user-defined properties. 
.PP
Definition at line 506 of file kmimetype.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDEDesktopMimeType::KDEDesktopMimeType (\fBKDesktopFile\fP * config)\fC [inline]\fP"
.PP
Construct a desktop mimetype and take all information from a desktop file. 
.PP
\fBParameters:\fP
.RS 4
\fIconfig\fP the desktop configuration file that describes the mime type 
.RE
.PP

.PP
Definition at line 534 of file kmimetype.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KDEDesktopMimeType::icon (const \fBQString\fP & _url, bool _is_local) const\fC [virtual]\fP"
.PP
Return the filename of the icon associated with the mimetype. 
.PP
The arguments are unused, but provided so that KMimeType-derived classes can use them (e.g. \fBKFolderType\fP uses the URL to return one out of 2 icons)
.PP
\fBReturns:\fP
.RS 4
The path to the icon associated with this MIME type. 
.RE
.PP

.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 696 of file kmimetype.cpp.
.PP
References KServiceType::icon().
.PP
Referenced by icon().
.SS "\fBQString\fP KDEDesktopMimeType::icon (const \fBKURL\fP & _url, bool _is_local) const\fC [virtual]\fP"
.PP
Return the filename of the icon associated with the mimetype. 
.PP
The arguments are unused, but provided so that KMimeType-derived classes can use them (e.g. \fBKFolderType\fP uses the URL to return one out of 2 icons)
.PP
\fBReturns:\fP
.RS 4
The path to the icon associated with this MIME type. 
.RE
.PP

.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 705 of file kmimetype.cpp.
.PP
References KIO::findDeviceMountPoint(), icon(), KServiceType::icon(), QString::isEmpty(), QString::isNull(), KURL::protocol(), KConfigBase::readBoolEntry(), and KConfigBase::setGroup().
.SS "\fBQPixmap\fP KDEDesktopMimeType::pixmap (const \fBKURL\fP & _url, \fBKIcon::Group\fP _group, int _force_size = \fC0\fP, int _state = \fC0\fP, \fBQString\fP * _path = \fC0L\fP) const\fC [virtual]\fP"
.PP
Find the pixmap for a given file of this mimetype. 
.PP
Convenience method that uses \fBicon()\fP, but also locates and load the pixmap.
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP URL for the file. 
.br
\fI_group\fP The icon group where the icon is going to be used. 
.br
\fI_force_size\fP Override globallly configured icon size. Use 0 for the default size 
.br
\fI_state\fP The icon state, one of: \fBKIcon::DefaultState\fP, \fBKIcon::ActiveState\fP or \fBKIcon::DisabledState\fP. 
.br
\fI_path\fP Output parameter to get the full path. Seldom needed. Ignored if 0 
.RE
.PP
\fBReturns:\fP
.RS 4
the pixmap of the URL, can be a default icon if not found 
.RE
.PP

.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 750 of file kmimetype.cpp.
.PP
References KServiceType::icon(), KGlobal::iconLoader(), QPixmap::isNull(), and KIconLoader::loadIcon().
.SS "\fBQString\fP KDEDesktopMimeType::comment (const \fBQString\fP & _url, bool _is_local) const\fC [virtual]\fP"
.PP
Returns the descriptive comment associated with the MIME type. 
.PP
The arguments are unused, but provided so that \fBKMimeType\fP derived classes can use them.
.PP
\fBReturns:\fP
.RS 4
The descriptive comment associated with the MIME type, if any. 
.RE
.PP

.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 762 of file kmimetype.cpp.
.PP
References KMimeType::comment().
.PP
Referenced by comment().
.SS "\fBQString\fP KDEDesktopMimeType::comment (const \fBKURL\fP & _url, bool _is_local) const\fC [virtual]\fP"
.PP
Returns the descriptive comment associated with the MIME type. 
.PP
The arguments are unused, but provided so that \fBKMimeType\fP derived classes can use them.
.PP
\fBReturns:\fP
.RS 4
The descriptive comment associated with the MIME type, if any. 
.RE
.PP

.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 771 of file kmimetype.cpp.
.PP
References comment(), KMimeType::comment(), and QString::isEmpty().
.SS "\fBQValueList\fP< \fBKDEDesktopMimeType::Service\fP > KDEDesktopMimeType::builtinServices (const \fBKURL\fP & _url)\fC [static]\fP"
.PP
Returns a list of services for the given .desktop file that are handled by kio itself. 
.PP
Namely mount/unmount for FSDevice files. 
.PP
\fBReturns:\fP
.RS 4
the list of services 
.RE
.PP

.PP
Definition at line 915 of file kmimetype.cpp.
.PP
References QValueList::append(), QString::arg(), KIO::findDeviceMountPoint(), QString::isEmpty(), KDEDesktopMimeType::Service::m_strName, and KDEDesktopMimeType::Service::m_type.
.SS "\fBQValueList\fP< \fBKDEDesktopMimeType::Service\fP > KDEDesktopMimeType::userDefinedServices (const \fBQString\fP & path, bool bLocalFiles)\fC [static]\fP"
.PP
Returns a list of services defined by the user as possible actions on the given .desktop file. 
.PP
May include empty actions which represent where visual separators should appear in user-visible representations of those actions, such as separators in a menu. 
.PP
\fBParameters:\fP
.RS 4
\fIpath\fP the path to the desktop file describing the services 
.br
\fIbLocalFiles\fP true if those services are to be applied to local files only (if false, services that don't have u or U in the Exec line won't be taken into account). 
.RE
.PP
\fBReturns:\fP
.RS 4
the list of user deviced actions 
.RE
.PP

.PP
Definition at line 968 of file kmimetype.cpp.
.SS "\fBQValueList\fP< \fBKDEDesktopMimeType::Service\fP > KDEDesktopMimeType::userDefinedServices (const \fBQString\fP & path, \fBKConfig\fP & config, bool bLocalFiles)\fC [static]\fP"
.PP
Overload of userDefinedServices for speed purposes: it takes a KConfig* so that the caller can check things in the file without having it parsed twice. 
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 974 of file kmimetype.cpp.
.PP
References QValueList::append(), QString::contains(), KStandardDirs::findExe(), QString::isEmpty(), KDEDesktopMimeType::Service::m_display, KDEDesktopMimeType::Service::m_strExec, KDEDesktopMimeType::Service::m_strIcon, KDEDesktopMimeType::Service::m_strName, KDEDesktopMimeType::Service::m_type, and QString::prepend().
.SS "void KDEDesktopMimeType::executeService (const \fBQString\fP & _path, \fBKDEDesktopMimeType::Service\fP & _service)\fC [static]\fP"
.PP
\fBParameters:\fP
.RS 4
\fI_path\fP is the path of the desktop entry. 
.br
\fIservice\fP the service to execute 
.RE
.PP
\fBDeprecated\fP
.RS 4
, see the other executeService 
.RE
.PP

.PP
Definition at line 1050 of file kmimetype.cpp.
.PP
References QValueList::append(), and KURL::setPath().
.SS "void KDEDesktopMimeType::executeService (const \fBKURL::List\fP & urls, \fBKDEDesktopMimeType::Service\fP & service)\fC [static]\fP"
.PP
Execute \fCservice\fP on the list of \fCurls\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIurls\fP the list of urls 
.br
\fIservice\fP the service to execute 
.RE
.PP

.PP
Definition at line 1059 of file kmimetype.cpp.
.PP
References QString::arg(), endl(), KIO::findDeviceMountPoint(), QString::isEmpty(), kdDebug(), KConfigBase::readBoolEntry(), KConfigBase::readEntry(), KRun::run(), and KConfigBase::setDesktopGroup().
.SS "pid_t KDEDesktopMimeType::run (const \fBKURL\fP & _url, bool _is_local)\fC [static]\fP"
.PP
Invokes the default action for the desktop entry. 
.PP
If the desktop entry is not local, then only false is returned. Otherwise we would create a security problem. Only types Link and Mimetype could be followed.
.PP
\fBParameters:\fP
.RS 4
\fI_url\fP the url to run 
.br
\fI_is_local\fP true if the URL is local, false otherwise 
.RE
.PP
\fBReturns:\fP
.RS 4
true on success and false on failure. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKRun::runURL\fP 
.RE
.PP

.PP
Definition at line 785 of file kmimetype.cpp.
.PP
References QString::arg(), and QString::isEmpty().
.PP
Referenced by KRun::runURL().
.SS "virtual \fBQPixmap\fP KDEDesktopMimeType::pixmap (\fBKIcon::Group\fP a, int b, int c, \fBQString\fP * d) const\fC [inline, protected, virtual]\fP"
.PP
Use this function only if you don't have a special URL for which you search a pixmap. 
.PP
This function is useful to find out, which icon is usually chosen for a certain mime type. Since no URL is passed, it is impossible to obey icon hints in desktop entries for example. 
.PP
\fBParameters:\fP
.RS 4
\fIgroup\fP The icon group where the icon is going to be used. 
.br
\fIforce_size\fP Override globallly configured icon size. Use 0 for the default size 
.br
\fIstate\fP The icon state, one of: \fC\fBKIcon::DefaultState\fP\fP, \fC\fBKIcon::ActiveState\fP\fP or \fC\fBKIcon::DisabledState\fP\fP. 
.br
\fIpath\fP Output parameter to get the full path. Seldom needed. Ignored if 0 
.RE
.PP
\fBReturns:\fP
.RS 4
the pixmap of the mime type, can be a default icon if not found 
.RE
.PP

.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 598 of file kmimetype.h.
.PP
References KMimeType::pixmap().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
