.TH "KDEDesktopMimeType" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDEDesktopMimeType \- Mimetype for a .desktop file Handles mount/umount icon, and user-defined properties.  

.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
.RI "\fIReturn the filename of the icon associated with the mimetype. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBicon\fP (const  \fBKURL\fP &_url, bool _is_local) const "
.br
.RI "\fIThis function differs from the above only in that a \fBKURL\fP may be provided instead of a \fBQString\fP for convenience. \fP"
.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
.RI "\fIFind the pixmap for a given file of this mimetype. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBcomment\fP (const  \fBQString\fP &_url, bool _is_local) const "
.br
.RI "\fIThe arguments are unused, but provided so that \fBKMimeType\fP derived classes can use them. \fP"
.ti -1c
.RI "virtual \fBQString\fP \fBcomment\fP (const  \fBKURL\fP &_url, bool _is_local) const "
.br
.RI "\fIThis function differs from the above only in that a \fBKURL\fP may be provided instead of a \fBQString\fP for convenience. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQValueList\fP< \fBService\fP > \fBbuiltinServices\fP (const  \fBKURL\fP &_url)"
.br
.ti -1c
.RI "\fBQValueList\fP< \fBService\fP > \fBuserDefinedServices\fP (const  \fBQString\fP &path, bool bLocalFiles)"
.br
.ti -1c
.RI "void \fBexecuteService\fP (const  \fBQString\fP &_path, \fBKDEDesktopMimeType::Service\fP &_service)"
.br
.ti -1c
.RI "void \fBexecuteService\fP (const  \fBKURL::List\fP &urls, \fBKDEDesktopMimeType::Service\fP &service)"
.br
.RI "\fIExecute \fCservice\fP on the list of \fCurls\fP. \fP"
.ti -1c
.RI "pid_t \fBrun\fP (const  \fBKURL\fP &_url, bool _is_local)"
.br
.RI "\fIInvokes the default action for the desktop entry. \fP"
.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
.RI "\fIUse this function only if you don't have a special URL for which you search a pixmap. \fP"
.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 "pid_t \fBrunFSDevice\fP (const  \fBKURL\fP &_url, const  \fBKSimpleConfig\fP &cfg)"
.br
.ti -1c
.RI "pid_t \fBrunApplication\fP (const  \fBKURL\fP &_url, const  \fBQString\fP &_serviceFile)"
.br
.ti -1c
.RI "pid_t \fBrunLink\fP (const  \fBKURL\fP &_url, const  \fBKSimpleConfig\fP &cfg)"
.br
.ti -1c
.RI "pid_t \fBrunMimeType\fP (const  \fBKURL\fP &_url, const  \fBKSimpleConfig\fP &cfg)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Mimetype for a .desktop file Handles mount/umount icon, and user-defined properties. Definition at line 339 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. 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
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 557 of file kmimetype.cpp.
.PP
References KServiceType::icon(), and QString::isEmpty().
.PP
Referenced by icon().
.SS "\fBQString\fP KDEDesktopMimeType::icon (const \fBKURL\fP & _url, bool _is_local) const\fC [virtual]\fP"
.PP
This function differs from the above only in that a \fBKURL\fP may be provided instead of a \fBQString\fP for convenience. Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 566 of file kmimetype.cpp.
.PP
References KIO::findDeviceMountPoint(), icon(), KServiceType::icon(), QString::isEmpty(), QString::isNull(), KURL::path(), KConfigBase::readEntry(), and KConfigBase::setDesktopGroup().
.SS "\fBQPixmap\fP KDEDesktopMimeType::pixmap (const \fBKURL\fP & _url, \fBKIcon::Group\fP _group, int _force_size = 0, int _state = 0, \fBQString\fP * _path = 0L) const\fC [virtual]\fP"
.PP
Find the pixmap for a given file of this mimetype. 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. 
.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. 
.RE
.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 596 of file kmimetype.cpp.
.PP
References KServiceType::icon(), KGlobal::iconLoader(), KURL::isLocalFile(), QPixmap::isNull(), and KIconLoader::loadIcon().
.SS "\fBQString\fP KDEDesktopMimeType::comment (const \fBQString\fP & _url, bool _is_local) const\fC [virtual]\fP"
.PP
The arguments are unused, but provided so that \fBKMimeType\fP derived classes can use them. \fBReturns:\fP
.RS 4
The descriptive comment associated with the MIME type, if any. 
.RE
.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 608 of file kmimetype.cpp.
.PP
References KMimeType::comment(), and QString::isEmpty().
.PP
Referenced by comment().
.SS "\fBQString\fP KDEDesktopMimeType::comment (const \fBKURL\fP & _url, bool _is_local) const\fC [virtual]\fP"
.PP
This function differs from the above only in that a \fBKURL\fP may be provided instead of a \fBQString\fP for convenience. Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 617 of file kmimetype.cpp.
.PP
References comment(), KMimeType::comment(), QString::isEmpty(), KURL::path(), KConfigBase::readEntry(), and KConfigBase::setDesktopGroup().
.SS "\fBQValueList\fP< \fBKDEDesktopMimeType::Service\fP > KDEDesktopMimeType::builtinServices (const \fBKURL\fP & _url)\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
a list of services for the given .desktop file that are handled by kio itself. Namely mount/unmount for FSDevice files. 
.RE
.PP
Definition at line 756 of file kmimetype.cpp.
.PP
References QValueList::append(), KMessageBox::error(), KIO::findDeviceMountPoint(), QString::isEmpty(), KURL::isLocalFile(), KIO::mount(), KURL::path(), KConfigBase::readEntry(), KConfigBase::setDesktopGroup(), and KIO::unmount().
.SS "\fBQValueList\fP< \fBKDEDesktopMimeType::Service\fP > KDEDesktopMimeType::userDefinedServices (const \fBQString\fP & path, bool bLocalFiles)\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
a list of services defined by the user as possible actions on the given .desktop file. 
.RE
.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
Definition at line 809 of file kmimetype.cpp.
.PP
References QValueList::append(), QString::contains(), KStdAccel::end(), KMessageBox::error(), KStandardDirs::findExe(), KConfigBase::hasGroup(), KConfigBase::hasKey(), QString::isEmpty(), KDEDesktopMimeType::Service::m_display, KDEDesktopMimeType::Service::m_strExec, KDEDesktopMimeType::Service::m_strIcon, KDEDesktopMimeType::Service::m_strName, KDEDesktopMimeType::Service::m_type, QString::prepend(), KConfigBase::readBoolEntry(), KConfigBase::readEntry(), KConfigBase::readListEntry(), KConfigBase::readPathEntry(), KConfigBase::setDesktopGroup(), and KConfigBase::setGroup().
.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. \fBThis class or method is obsolete, it is provided for compatibility only.\fP, see the other executeService 
.RE
.PP
Definition at line 879 of file kmimetype.cpp.
.PP
References QValueList< KURL >::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. Definition at line 888 of file kmimetype.cpp.
.PP
References QValueList< KURL >::count(), KMessageBox::error(), KIO::findDeviceMountPoint(), QValueList< KURL >::first(), QString::isEmpty(), KDEDesktopMimeType::Service::m_strExec, KDEDesktopMimeType::Service::m_strIcon, KDEDesktopMimeType::Service::m_strName, KDEDesktopMimeType::Service::m_type, 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. 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
\fBReturns:\fP
.RS 4
true on success and false on failure.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKRun::runURL\fP 
.RE
.PP
Definition at line 631 of file kmimetype.cpp.
.PP
References KMessageBox::error(), QString::isEmpty(), KURL::path(), KConfigBase::readEntry(), KConfigBase::setDesktopGroup(), and KConfigBase::setDollarExpansion().
.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. 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
\fI_group\fP The icon group where the icon is going to be used. 
.br
\fI_force_size\fP Override globallly configured icon size. 
.br
\fI_state\fP The icon state, one of: \fC\fBKIcon::DefaultState\fP\fP, \fC\fBKIcon::ActiveState\fP\fP or \fC\fBKIcon::DisabledState\fP\fP. 
.br
\fI_path\fP Output parameter to get the full path. Seldom needed. 
.RE
.PP
Reimplemented from \fBKMimeType\fP.
.PP
Definition at line 411 of file kmimetype.h.
.PP
References KMimeType::pixmap().

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