\section{KService\-Type Class Reference}
\label{classKServiceType}\index{KServiceType@{KServiceType}}
A service type is the generic notion for a mimetype, a type of service instead of a type of file.  


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

Inheritance diagram for KService\-Type:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=188pt]{classKServiceType__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KService\-Type:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=306pt]{classKServiceType__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef {\bf KShared\-Ptr}$<$ {\bf KService\-Type} $>$ {\bf Ptr}\label{classKServiceType_w0}

\item 
typedef {\bf QValue\-List}$<$ {\bf Ptr} $>$ {\bf List}\label{classKServiceType_w1}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KService\-Type} (const  {\bf QString} \&\_\-fullpath, const  {\bf QString} \&\_\-name, const  {\bf QString} \&\_\-icon, const  {\bf QString} \&\_\-comment)
\begin{CompactList}\small\item\em Constructor. \item\end{CompactList}\item 
{\bf KService\-Type} (const  {\bf QString} \&\_\-fullpath)
\begin{CompactList}\small\item\em Construct a service type and take all informations from a config file. \item\end{CompactList}\item 
{\bf KService\-Type} ({\bf KDesktop\-File} $\ast$config)
\begin{CompactList}\small\item\em Construct a service type and take all informations from a deskop file. \item\end{CompactList}\item 
{\bf KService\-Type} ({\bf QData\-Stream} \&\_\-str, int {\bf offset})\label{classKServiceType_a3}

\item 
{\bf QString} {\bf icon} () const 
\item 
{\bf QString} {\bf comment} () const 
\item 
{\bf QString} {\bf name} () const 
\item 
{\bf QString} {\bf desktop\-Entry\-Path} () const 
\item 
bool {\bf is\-Derived} () const 
\item 
{\bf QString} {\bf parent\-Service\-Type} () const 
\begin{CompactList}\small\item\em If this service type inherits from another service type, return the name of the parent. \item\end{CompactList}\item 
bool {\bf inherits} (const  {\bf QString} \&serv\-Type\-Name) const 
\item 
virtual {\bf QVariant} {\bf property} (const  {\bf QString} \&\_\-name) const \label{classKServiceType_a12}

\item 
virtual {\bf QString\-List} {\bf property\-Names} () const \label{classKServiceType_a13}

\item 
bool {\bf is\-Valid} () const \label{classKServiceType_a14}

\item 
virtual QVariant::Type {\bf property\-Def} (const  {\bf QString} \&\_\-name) const \label{classKServiceType_a15}

\item 
virtual {\bf QString\-List} {\bf property\-Def\-Names} () const \label{classKServiceType_a16}

\item 
virtual const  {\bf QMap}$<$ {\bf QString}, QVariant::Type $>$ \& {\bf property\-Defs} () const \label{classKServiceType_a17}

\item 
virtual void {\bf save} ({\bf QData\-Stream} \&)
\begin{CompactList}\small\item\em Save ourselves to the data stream. \item\end{CompactList}\item 
virtual void {\bf load} ({\bf QData\-Stream} \&)
\begin{CompactList}\small\item\em Load ourselves from the data stream. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Ptr} {\bf service\-Type} (const  {\bf QString} \&\_\-name)
\item 
{\bf KService::List} {\bf offers} (const  {\bf QString} \&\_\-servicetype)
\item 
{\bf List} {\bf all\-Service\-Types} ()
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} ({\bf KDesktop\-File} $\ast$config)\label{classKServiceType_b0}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKServiceType_b1}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QString} {\bf m\_\-str\-Name}\label{classKServiceType_p0}

\item 
{\bf QString} {\bf m\_\-str\-Icon}\label{classKServiceType_p1}

\item 
{\bf QString} {\bf m\_\-str\-Comment}\label{classKServiceType_p2}

\item 
{\bf QMap}$<$ {\bf QString}, {\bf QVariant} $>$ {\bf m\_\-map\-Props}\label{classKServiceType_p3}

\item 
{\bf QMap}$<$ {\bf QString}, QVariant::Type $>$ {\bf m\_\-map\-Prop\-Defs}\label{classKServiceType_p4}

\item 
bool {\bf m\_\-b\-Valid}:1\label{classKServiceType_p5}

\item 
bool {\bf m\_\-b\-Derived}:1\label{classKServiceType_p6}

\end{CompactItemize}


\subsection{Detailed Description}
A service type is the generic notion for a mimetype, a type of service instead of a type of file. 

For instance, KOffice\-Filter is a service type. It is associated to services according to the user profile ({\bf kuserprofile.h}{\rm (p.\,\pageref{kuserprofile_8h})}) 



Definition at line 43 of file kservicetype.h.

\subsection{Constructor \& Destructor Documentation}
\index{KServiceType@{KService\-Type}!KServiceType@{KServiceType}}
\index{KServiceType@{KServiceType}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KService\-Type::KService\-Type (const {\bf QString} \& {\em \_\-fullpath}, const {\bf QString} \& {\em \_\-name}, const {\bf QString} \& {\em \_\-icon}, const {\bf QString} \& {\em \_\-comment})}\label{classKServiceType_a0}


Constructor. 

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

Definition at line 99 of file kservicetype.cpp.

References QString::is\-Empty().\index{KServiceType@{KService\-Type}!KServiceType@{KServiceType}}
\index{KServiceType@{KServiceType}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KService\-Type::KService\-Type (const {\bf QString} \& {\em \_\-fullpath})}\label{classKServiceType_a1}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-fullpath}]set to \char`\"{}\char`\"{} if calling from a inherited constructor. \end{description}
\end{Desc}


Definition at line 33 of file kservicetype.cpp.\index{KServiceType@{KService\-Type}!KServiceType@{KServiceType}}
\index{KServiceType@{KServiceType}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KService\-Type::KService\-Type ({\bf KDesktop\-File} $\ast$ {\em config})}\label{classKServiceType_a2}


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



Definition at line 41 of file kservicetype.cpp.

\subsection{Member Function Documentation}
\index{KServiceType@{KService\-Type}!icon@{icon}}
\index{icon@{icon}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Type::icon () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceType_a5}


\begin{Desc}
\item[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 {\bf KMime\-Type}{\rm (p.\,\pageref{classKMimeType})}, {\bf KFolder\-Type}{\rm (p.\,\pageref{classKFolderType})} and others. \end{Desc}


Definition at line 84 of file kservicetype.h.

Referenced by KDEDesktop\-Mime\-Type::icon(), KFolder\-Type::icon(), KDEDesktop\-Mime\-Type::pixmap(), KMime\-Type::pixmap(), and KFile\-Item::pixmap().\index{KServiceType@{KService\-Type}!comment@{comment}}
\index{comment@{comment}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Type::comment () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceType_a6}


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


Reimplemented in {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a9})}.

Definition at line 89 of file kservicetype.h.\index{KServiceType@{KService\-Type}!name@{name}}
\index{name@{name}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Type::name () const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKServiceType_a7}


\begin{Desc}
\item[Returns:]the name of this service type. \end{Desc}


Implements {\bf KSycoca\-Entry}.

Definition at line 94 of file kservicetype.h.

Referenced by inherits().\index{KServiceType@{KService\-Type}!desktopEntryPath@{desktopEntryPath}}
\index{desktopEntryPath@{desktopEntryPath}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Type::desktop\-Entry\-Path () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceType_a8}


\begin{Desc}
\item[Returns:]the relative path to the desktop entry file responsible for this servicetype. For instance inode/directory.desktop, or kpart.desktop \end{Desc}


Definition at line 101 of file kservicetype.h.

References KSycoca\-Entry::entry\-Path().\index{KServiceType@{KService\-Type}!isDerived@{isDerived}}
\index{isDerived@{isDerived}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KService\-Type::is\-Derived () const\hspace{0.3cm}{\tt  [inline]}}\label{classKServiceType_a9}


\begin{Desc}
\item[Returns:]true if this service type inherits another one \end{Desc}


Definition at line 106 of file kservicetype.h.\index{KServiceType@{KService\-Type}!parentServiceType@{parentServiceType}}
\index{parentServiceType@{parentServiceType}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KService\-Type::parent\-Service\-Type () const}\label{classKServiceType_a10}


If this service type inherits from another service type, return the name of the parent. 

Otherwise QString::null. 

Definition at line 140 of file kservicetype.cpp.

References QVariant::to\-String().

Referenced by inherits().\index{KServiceType@{KService\-Type}!inherits@{inherits}}
\index{inherits@{inherits}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KService\-Type::inherits (const {\bf QString} \& {\em serv\-Type\-Name}) const}\label{classKServiceType_a11}


\begin{Desc}
\item[Returns:]true if this servicetype is or inherits from {\tt serv\-Type\-Name} \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 146 of file kservicetype.cpp.

References QString::is\-Empty(), name(), parent\-Service\-Type(), and service\-Type().\index{KServiceType@{KService\-Type}!save@{save}}
\index{save@{save}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KService\-Type::save ({\bf QData\-Stream} \&)\hspace{0.3cm}{\tt  [virtual]}}\label{classKServiceType_a18}


Save ourselves to the data stream. 



Reimplemented from {\bf KSycoca\-Entry}.

Reimplemented in {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a14})}.

Definition at line 126 of file kservicetype.cpp.

References KSycoca\-Entry::save().

Referenced by KMime\-Type::save().\index{KServiceType@{KService\-Type}!load@{load}}
\index{load@{load}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KService\-Type::load ({\bf QData\-Stream} \&)\hspace{0.3cm}{\tt  [virtual]}}\label{classKServiceType_a19}


Load ourselves from the data stream. 



Implements {\bf KSycoca\-Entry}.

Reimplemented in {\bf KMime\-Type} {\rm (p.\,\pageref{classKMimeType_a13})}.

Definition at line 116 of file kservicetype.cpp.

References QMap$<$ QString, QVariant $>$::contains().

Referenced by KMime\-Type::load().\index{KServiceType@{KService\-Type}!serviceType@{serviceType}}
\index{serviceType@{serviceType}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Type::Ptr} KService\-Type::service\-Type (const {\bf QString} \& {\em \_\-name})\hspace{0.3cm}{\tt  [static]}}\label{classKServiceType_e0}


\begin{Desc}
\item[Returns:]a pointer to the servicetype '\_\-name' or 0L if the service type is unknown. VERY IMPORTANT : don't store the result in a KService\-Type $\ast$ ! \end{Desc}


Definition at line 219 of file kservicetype.cpp.

References KSycoca\-Entry::Ptr.

Referenced by KService::has\-Service\-Type(), and inherits().\index{KServiceType@{KService\-Type}!offers@{offers}}
\index{offers@{offers}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService::List} KService\-Type::offers (const {\bf QString} \& {\em \_\-servicetype})\hspace{0.3cm}{\tt  [static]}}\label{classKServiceType_e1}


\begin{Desc}
\item[Returns:]all services supporting the given servicetype name This doesn't take care of the user profile. In fact it is used by {\bf KService\-Type\-Profile}{\rm (p.\,\pageref{classKServiceTypeProfile})}, which is used by {\bf KTrader}{\rm (p.\,\pageref{classKTrader})}, and that's the one you should use. \end{Desc}


Definition at line 225 of file kservicetype.cpp.

References QValue\-List::begin(), QValue\-List::end(), KSycoca\-Entry::is\-Type(), QString::left(), and KSycoca\-Entry::offset().

Referenced by KService\-Type\-Profile::offers().\index{KServiceType@{KService\-Type}!allServiceTypes@{allServiceTypes}}
\index{allServiceTypes@{allServiceTypes}!KServiceType@{KService\-Type}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Type::List} KService\-Type::all\-Service\-Types ()\hspace{0.3cm}{\tt  [static]}}\label{classKServiceType_e2}


\begin{Desc}
\item[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. \end{Desc}


Definition at line 306 of file kservicetype.cpp.

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