\section{KDEDesktop\-Mime\-Type Class Reference}
\label{classKDEDesktopMimeType}\index{KDEDesktopMimeType@{KDEDesktopMimeType}}
Mimetype for a .desktop file Handles mount/umount icon, and user-defined properties.  


{\tt \#include $<$kmimetype.h$>$}

Inheritance diagram for KDEDesktop\-Mime\-Type:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=83pt]{classKDEDesktopMimeType__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KDEDesktop\-Mime\-Type:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=255pt]{classKDEDesktopMimeType__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Service\-Type} \{ {\bf ST\_\-MOUNT}, 
{\bf ST\_\-UNMOUNT}, 
{\bf ST\_\-USER\_\-DEFINED}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KDEDesktop\-Mime\-Type} ({\bf KDesktop\-File} $\ast$config)\label{classKDEDesktopMimeType_a0}

\item 
{\bf KDEDesktop\-Mime\-Type} ({\bf QData\-Stream} \&\_\-str, int {\bf offset})\label{classKDEDesktopMimeType_a1}

\item 
virtual {\bf QString} {\bf icon} (const  {\bf QString} \&\_\-url, bool \_\-is\_\-local) const 
\begin{CompactList}\small\item\em Return the filename of the icon associated with the mimetype. \item\end{CompactList}\item 
virtual {\bf QString} {\bf icon} (const  {\bf KURL} \&\_\-url, bool \_\-is\_\-local) const 
\begin{CompactList}\small\item\em This function differs from the above only in that a {\bf KURL} may be provided instead of a {\bf QString} for convenience. \item\end{CompactList}\item 
virtual {\bf QPixmap} {\bf pixmap} (const  {\bf KURL} \&\_\-url, {\bf KIcon::Group} \_\-group, int \_\-force\_\-size=0, int \_\-state=0, {\bf QString} $\ast$\_\-path=0L) const 
\begin{CompactList}\small\item\em Find the pixmap for a given file of this mimetype. \item\end{CompactList}\item 
virtual {\bf QString} {\bf comment} (const  {\bf QString} \&\_\-url, bool \_\-is\_\-local) const 
\begin{CompactList}\small\item\em The arguments are unused, but provided so that {\bf KMime\-Type}{\rm (p.\,\pageref{classKMimeType})} derived classes can use them. \item\end{CompactList}\item 
virtual {\bf QString} {\bf comment} (const  {\bf KURL} \&\_\-url, bool \_\-is\_\-local) const 
\begin{CompactList}\small\item\em This function differs from the above only in that a {\bf KURL} may be provided instead of a {\bf QString} for convenience. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf QValue\-List}$<$ {\bf Service} $>$ {\bf builtin\-Services} (const  {\bf KURL} \&\_\-url)
\item 
{\bf QValue\-List}$<$ {\bf Service} $>$ {\bf user\-Defined\-Services} (const  {\bf QString} \&path, bool b\-Local\-Files)
\item 
void {\bf execute\-Service} (const  {\bf QString} \&\_\-path, {\bf KDEDesktop\-Mime\-Type::Service} \&\_\-service)
\item 
void {\bf execute\-Service} (const  {\bf KURL::List} \&urls, {\bf KDEDesktop\-Mime\-Type::Service} \&service)
\begin{CompactList}\small\item\em Execute {\tt service} on the list of {\tt urls}. \item\end{CompactList}\item 
pid\_\-t {\bf run} (const  {\bf KURL} \&\_\-url, bool \_\-is\_\-local)
\begin{CompactList}\small\item\em Invokes the default action for the desktop entry. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf QPixmap} {\bf pixmap} ({\bf KIcon::Group} a, int b, int c, {\bf QString} $\ast$d) const 
\begin{CompactList}\small\item\em Use this function only if you don't have a special URL for which you search a pixmap. \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKDEDesktopMimeType_b1}

\end{CompactItemize}
\subsection*{Static Protected Member Functions}
\begin{CompactItemize}
\item 
pid\_\-t {\bf run\-FSDevice} (const  {\bf KURL} \&\_\-url, const  {\bf KSimple\-Config} \&cfg)\label{classKDEDesktopMimeType_f0}

\item 
pid\_\-t {\bf run\-Application} (const  {\bf KURL} \&\_\-url, const  {\bf QString} \&\_\-service\-File)\label{classKDEDesktopMimeType_f1}

\item 
pid\_\-t {\bf run\-Link} (const  {\bf KURL} \&\_\-url, const  {\bf KSimple\-Config} \&cfg)\label{classKDEDesktopMimeType_f2}

\item 
pid\_\-t {\bf run\-Mime\-Type} (const  {\bf KURL} \&\_\-url, const  {\bf KSimple\-Config} \&cfg)\label{classKDEDesktopMimeType_f3}

\end{CompactItemize}


\subsection{Detailed Description}
Mimetype for a .desktop file Handles mount/umount icon, and user-defined properties. 



Definition at line 339 of file kmimetype.h.

\subsection{Member Function Documentation}
\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!icon@{icon}}
\index{icon@{icon}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDEDesktop\-Mime\-Type::icon (const {\bf QString} \& {\em \_\-url}, bool {\em \_\-is\_\-local}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKDEDesktopMimeType_a2}


Return the filename of the icon associated with the mimetype. 

The arguments are unused, but provided so that KMime\-Type-derived classes can use them (e.g. {\bf KFolder\-Type}{\rm (p.\,\pageref{classKFolderType})} uses the URL to return one out of 2 icons)

\begin{Desc}
\item[Returns:]The path to the icon associated with this MIME type. \end{Desc}


Reimplemented from {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a5})}.

Definition at line 557 of file kmimetype.cpp.

References KService\-Type::icon(), and QString::is\-Empty().

Referenced by icon().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!icon@{icon}}
\index{icon@{icon}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDEDesktop\-Mime\-Type::icon (const {\bf KURL} \& {\em \_\-url}, bool {\em \_\-is\_\-local}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKDEDesktopMimeType_a3}


This function differs from the above only in that a {\bf KURL} may be provided instead of a {\bf QString} for convenience. 



Reimplemented from {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a6})}.

Definition at line 566 of file kmimetype.cpp.

References KIO::find\-Device\-Mount\-Point(), icon(), KService\-Type::icon(), QString::is\-Empty(), QString::is\-Null(), KURL::path(), KConfig\-Base::read\-Entry(), and KConfig\-Base::set\-Desktop\-Group().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!pixmap@{pixmap}}
\index{pixmap@{pixmap}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KDEDesktop\-Mime\-Type::pixmap (const {\bf KURL} \& {\em \_\-url}, {\bf KIcon::Group} {\em \_\-group}, int {\em \_\-force\_\-size} = 0, int {\em \_\-state} = 0, {\bf QString} $\ast$ {\em \_\-path} = 0L) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKDEDesktopMimeType_a4}


Find the pixmap for a given file of this mimetype. 

Convenience method that uses {\bf icon}{\rm (p.\,\pageref{classKDEDesktopMimeType_a2})}(), but also locates and load the pixmap.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-url}]URL for the file. \item[{\em \_\-group}]The icon group where the icon is going to be used. \item[{\em \_\-force\_\-size}]Override globallly configured icon size. \item[{\em \_\-state}]The icon state, one of: {\bf KIcon::Default\-State}, {\bf KIcon::Active\-State} or {\bf KIcon::Disabled\-State}. \item[{\em \_\-path}]Output parameter to get the full path. Seldom needed. \end{description}
\end{Desc}


Reimplemented from {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a8})}.

Definition at line 596 of file kmimetype.cpp.

References KService\-Type::icon(), KGlobal::icon\-Loader(), KURL::is\-Local\-File(), QPixmap::is\-Null(), and KIcon\-Loader::load\-Icon().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!comment@{comment}}
\index{comment@{comment}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDEDesktop\-Mime\-Type::comment (const {\bf QString} \& {\em \_\-url}, bool {\em \_\-is\_\-local}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKDEDesktopMimeType_a5}


The arguments are unused, but provided so that {\bf KMime\-Type}{\rm (p.\,\pageref{classKMimeType})} derived classes can use them. 

\begin{Desc}
\item[Returns:]The descriptive comment associated with the MIME type, if any. \end{Desc}


Reimplemented from {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a10})}.

Definition at line 608 of file kmimetype.cpp.

References KMime\-Type::comment(), and QString::is\-Empty().

Referenced by comment().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!comment@{comment}}
\index{comment@{comment}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDEDesktop\-Mime\-Type::comment (const {\bf KURL} \& {\em \_\-url}, bool {\em \_\-is\_\-local}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKDEDesktopMimeType_a6}


This function differs from the above only in that a {\bf KURL} may be provided instead of a {\bf QString} for convenience. 



Reimplemented from {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a11})}.

Definition at line 617 of file kmimetype.cpp.

References comment(), KMime\-Type::comment(), QString::is\-Empty(), KURL::path(), KConfig\-Base::read\-Entry(), and KConfig\-Base::set\-Desktop\-Group().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!builtinServices@{builtinServices}}
\index{builtinServices@{builtinServices}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QValue\-List}$<$ {\bf KDEDesktop\-Mime\-Type::Service} $>$ KDEDesktop\-Mime\-Type::builtin\-Services (const {\bf KURL} \& {\em \_\-url})\hspace{0.3cm}{\tt  [static]}}\label{classKDEDesktopMimeType_e0}


\begin{Desc}
\item[Returns:]a list of services for the given .desktop file that are handled by kio itself. Namely mount/unmount for FSDevice files. \end{Desc}


Definition at line 756 of file kmimetype.cpp.

References QValue\-List::append(), KMessage\-Box::error(), KIO::find\-Device\-Mount\-Point(), QString::is\-Empty(), KURL::is\-Local\-File(), KIO::mount(), KURL::path(), KConfig\-Base::read\-Entry(), KConfig\-Base::set\-Desktop\-Group(), and KIO::unmount().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!userDefinedServices@{userDefinedServices}}
\index{userDefinedServices@{userDefinedServices}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QValue\-List}$<$ {\bf KDEDesktop\-Mime\-Type::Service} $>$ KDEDesktop\-Mime\-Type::user\-Defined\-Services (const {\bf QString} \& {\em path}, bool {\em b\-Local\-Files})\hspace{0.3cm}{\tt  [static]}}\label{classKDEDesktopMimeType_e1}


\begin{Desc}
\item[Returns:]a list of services defined by the user as possible actions on the given .desktop file. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]the path to the desktop file describing the services \item[{\em b\-Local\-Files}]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). \end{description}
\end{Desc}


Definition at line 809 of file kmimetype.cpp.

References QValue\-List::append(), QString::contains(), KStd\-Accel::end(), KMessage\-Box::error(), KStandard\-Dirs::find\-Exe(), KConfig\-Base::has\-Group(), KConfig\-Base::has\-Key(), QString::is\-Empty(), KDEDesktop\-Mime\-Type::Service::m\_\-display, KDEDesktop\-Mime\-Type::Service::m\_\-str\-Exec, KDEDesktop\-Mime\-Type::Service::m\_\-str\-Icon, KDEDesktop\-Mime\-Type::Service::m\_\-str\-Name, KDEDesktop\-Mime\-Type::Service::m\_\-type, QString::prepend(), KConfig\-Base::read\-Bool\-Entry(), KConfig\-Base::read\-Entry(), KConfig\-Base::read\-List\-Entry(), KConfig\-Base::read\-Path\-Entry(), KConfig\-Base::set\-Desktop\-Group(), and KConfig\-Base::set\-Group().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!executeService@{executeService}}
\index{executeService@{executeService}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDEDesktop\-Mime\-Type::execute\-Service (const {\bf QString} \& {\em \_\-path}, {\bf KDEDesktop\-Mime\-Type::Service} \& {\em \_\-service})\hspace{0.3cm}{\tt  [static]}}\label{classKDEDesktopMimeType_e2}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-path}]is the path of the desktop entry. {\bf This class or method is obsolete, it is provided for compatibility only.}, see the other execute\-Service \end{description}
\end{Desc}


Definition at line 879 of file kmimetype.cpp.

References QValue\-List$<$ KURL $>$::append(), and KURL::set\-Path().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!executeService@{executeService}}
\index{executeService@{executeService}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDEDesktop\-Mime\-Type::execute\-Service (const {\bf KURL::List} \& {\em urls}, {\bf KDEDesktop\-Mime\-Type::Service} \& {\em service})\hspace{0.3cm}{\tt  [static]}}\label{classKDEDesktopMimeType_e3}


Execute {\tt service} on the list of {\tt urls}. 



Definition at line 888 of file kmimetype.cpp.

References QValue\-List$<$ KURL $>$::count(), KMessage\-Box::error(), KIO::find\-Device\-Mount\-Point(), QValue\-List$<$ KURL $>$::first(), QString::is\-Empty(), KDEDesktop\-Mime\-Type::Service::m\_\-str\-Exec, KDEDesktop\-Mime\-Type::Service::m\_\-str\-Icon, KDEDesktop\-Mime\-Type::Service::m\_\-str\-Name, KDEDesktop\-Mime\-Type::Service::m\_\-type, KConfig\-Base::read\-Bool\-Entry(), KConfig\-Base::read\-Entry(), KRun::run(), and KConfig\-Base::set\-Desktop\-Group().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!run@{run}}
\index{run@{run}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}pid\_\-t KDEDesktop\-Mime\-Type::run (const {\bf KURL} \& {\em \_\-url}, bool {\em \_\-is\_\-local})\hspace{0.3cm}{\tt  [static]}}\label{classKDEDesktopMimeType_e4}


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.

\begin{Desc}
\item[Returns:]true on success and false on failure.\end{Desc}
\begin{Desc}
\item[See also:]{\bf KRun::run\-URL}{\rm (p.\,\pageref{classKRun_e3})} \end{Desc}


Definition at line 631 of file kmimetype.cpp.

References KMessage\-Box::error(), QString::is\-Empty(), KURL::path(), KConfig\-Base::read\-Entry(), KConfig\-Base::set\-Desktop\-Group(), and KConfig\-Base::set\-Dollar\-Expansion().

Referenced by KRun::run\-URL().\index{KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}!pixmap@{pixmap}}
\index{pixmap@{pixmap}!KDEDesktopMimeType@{KDEDesktop\-Mime\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QPixmap} KDEDesktop\-Mime\-Type::pixmap ({\bf KIcon::Group} {\em a}, int {\em b}, int {\em c}, {\bf QString} $\ast$ {\em d}) const\hspace{0.3cm}{\tt  [inline, protected, virtual]}}\label{classKDEDesktopMimeType_b0}


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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-group}]The icon group where the icon is going to be used. \item[{\em \_\-force\_\-size}]Override globallly configured icon size. \item[{\em \_\-state}]The icon state, one of: {\tt {\bf KIcon::Default\-State}}, {\tt {\bf KIcon::Active\-State}} or {\tt {\bf KIcon::Disabled\-State}}. \item[{\em \_\-path}]Output parameter to get the full path. Seldom needed. \end{description}
\end{Desc}


Reimplemented from {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a7})}.

Definition at line 411 of file kmimetype.h.

References KMime\-Type::pixmap().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kmimetype.h\item 
kmimetype.cpp\end{CompactItemize}
