\section{KService\-Type\-Profile Class Reference}
\label{classKServiceTypeProfile}\index{KServiceTypeProfile@{KServiceTypeProfile}}
This class holds the offers for a service type (e.g.  


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

Collaboration diagram for KService\-Type\-Profile:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=265pt]{classKServiceTypeProfile__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef {\bf QValue\-List}$<$ {\bf KService\-Offer} $>$ {\bf Offer\-List}\label{classKServiceTypeProfile_w0}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
int {\bf preference} (const  {\bf QString} \&\_\-service) const 
\item 
bool {\bf allow\-As\-Default} (const  {\bf QString} \&\_\-service) const \label{classKServiceTypeProfile_a2}

\item 
{\bf Offer\-List} {\bf offers} () const \label{classKServiceTypeProfile_a3}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KService::Ptr} {\bf preferred\-Service} (const  {\bf QString} \&service\-Type, const  {\bf QString} \&generic\-Service\-Type)
\item 
{\bf KService\-Type\-Profile} $\ast$ {\bf service\-Type\-Profile} (const  {\bf QString} \&servicetype, const  {\bf QString} \&generic\-Service\-Type=QString::null)
\item 
{\bf Offer\-List} {\bf offers} (const  {\bf QString} \&servicetype, const  {\bf QString} \&generic\-Service\-Type=QString::null)
\item 
const  {\bf QPtr\-List}$<$ {\bf KService\-Type\-Profile} $>$ \& {\bf service\-Type\-Profiles} ()\label{classKServiceTypeProfile_e3}

\item 
void {\bf clear} ()
\begin{CompactList}\small\item\em Clear all cached information. \item\end{CompactList}\item 
void {\bf set\-Configuration\-Mode} ()
\begin{CompactList}\small\item\em This method activates a special mode of KService\-Type\-Profile, in which all/all and all/allfiles are excluded from the results of the queries. \item\end{CompactList}\item 
bool {\bf configuration\-Mode} ()\label{classKServiceTypeProfile_e6}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf KService\-Type\-Profile} (const  {\bf QString} \&\_\-servicetype, const  {\bf QString} \&\_\-generic\-Service\-Type=QString::null)
\begin{CompactList}\small\item\em Constructor is called when the user profile is read for the first time. \item\end{CompactList}\item 
void {\bf add\-Service} (const  {\bf QString} \&\_\-service, int \_\-preference=1, bool \_\-allow\_\-as\_\-default=TRUE)
\begin{CompactList}\small\item\em Add a service to this profile. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This class holds the offers for a service type (e.g. 

in old terms \char`\"{}the bindings for a mimetype\char`\"{}) 



Definition at line 76 of file kuserprofile.h.

\subsection{Constructor \& Destructor Documentation}
\index{KServiceTypeProfile@{KService\-Type\-Profile}!KServiceTypeProfile@{KServiceTypeProfile}}
\index{KServiceTypeProfile@{KServiceTypeProfile}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KService\-Type\-Profile::KService\-Type\-Profile (const {\bf QString} \& {\em \_\-servicetype}, const {\bf QString} \& {\em \_\-generic\-Service\-Type} = QString::null)\hspace{0.3cm}{\tt  [protected]}}\label{classKServiceTypeProfile_b0}


Constructor is called when the user profile is read for the first time. 



Definition at line 177 of file kuserprofile.cpp.

References QPtr\-List$<$ KService\-Type\-Profile $>$::append().

\subsection{Member Function Documentation}
\index{KServiceTypeProfile@{KService\-Type\-Profile}!preference@{preference}}
\index{preference@{preference}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KService\-Type\-Profile::preference (const {\bf QString} \& {\em \_\-service}) const}\label{classKServiceTypeProfile_a1}


\begin{Desc}
\item[Returns:]the users preference of this special service or 0 if the service is unknown. \end{Desc}


Definition at line 201 of file kuserprofile.cpp.

References QMap$<$ QString, Service $>$::end(), and QMap$<$ QString, Service $>$::find().\index{KServiceTypeProfile@{KService\-Type\-Profile}!preferredService@{preferredService}}
\index{preferredService@{preferredService}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService::Ptr} KService\-Type\-Profile::preferred\-Service (const {\bf QString} \& {\em service\-Type}, const {\bf QString} \& {\em generic\-Service\-Type})\hspace{0.3cm}{\tt  [static]}}\label{classKServiceTypeProfile_e0}


\begin{Desc}
\item[Returns:]the preferred service (convenience method) for \_\-service\-Type and \_\-generic\-Service\-Type (Application, type of component, or empty).\end{Desc}
preferred\-Service(m,true) is equivalent to preferred\-Service(m,\char`\"{}Application\char`\"{}) preferred\-Service(m,false) is equivalent to preferred\-Service(m,QString::null) This call allows e.g. preferred\-Service(m,\char`\"{}KParts/Read\-Only\-Part\char`\"{}). 

Definition at line 284 of file kuserprofile.cpp.

References QValue\-List::begin(), QValue\-List::end(), and offers().

Referenced by KRun::run\-URL().\index{KServiceTypeProfile@{KService\-Type\-Profile}!serviceTypeProfile@{serviceTypeProfile}}
\index{serviceTypeProfile@{serviceTypeProfile}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Type\-Profile} $\ast$ KService\-Type\-Profile::service\-Type\-Profile (const {\bf QString} \& {\em servicetype}, const {\bf QString} \& {\em generic\-Service\-Type} = QString::null)\hspace{0.3cm}{\tt  [static]}}\label{classKServiceTypeProfile_e1}


\begin{Desc}
\item[Returns:]the profile for the requested service type. \end{Desc}


Definition at line 225 of file kuserprofile.cpp.

References QPtr\-List\-Iterator::current(), QString::is\-Empty(), and KGlobal::static\-QString().

Referenced by offers().\index{KServiceTypeProfile@{KService\-Type\-Profile}!offers@{offers}}
\index{offers@{offers}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KService\-Type\-Profile::Offer\-List} KService\-Type\-Profile::offers (const {\bf QString} \& {\em servicetype}, const {\bf QString} \& {\em generic\-Service\-Type} = QString::null)\hspace{0.3cm}{\tt  [static]}}\label{classKServiceTypeProfile_e2}


\begin{Desc}
\item[Returns:]the offers associated with a given servicetype, sorted by preference This is what {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} uses to get the list of offers, before applying the constraints and preferences.\end{Desc}
If {\tt generic\-Service\-Type} is specified a list is returned with the offers associated with the combination of the two service types. This is almost like an \char`\"{}foo in Service\-Types\char`\"{} constraint in the Trader, but the difference is that to order the offers, we will look at entries specifically for those two service types. Typically, this is used for getting the list of embeddable components that can handle a given mimetype. In that case, {\tt servicetype} is the mimetype and {\tt generic\-Service\-Type} is \char`\"{}KParts/Read\-Only\-Part\char`\"{}. 

Definition at line 93 of file kuserprofile.cpp.

References QValue\-List::append(), QValue\-List::begin(), QValue\-List::count(), QPtr\-List\-Iterator::current(), QValue\-List::end(), QString::is\-Empty(), KService\-Type::offers(), offers(), and service\-Type\-Profile().

Referenced by preferred\-Service(), and KTrader::query().\index{KServiceTypeProfile@{KService\-Type\-Profile}!clear@{clear}}
\index{clear@{clear}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KService\-Type\-Profile::clear ()\hspace{0.3cm}{\tt  [inline, static]}}\label{classKServiceTypeProfile_e4}


Clear all cached information. 



Definition at line 127 of file kuserprofile.h.\index{KServiceTypeProfile@{KService\-Type\-Profile}!setConfigurationMode@{setConfigurationMode}}
\index{setConfigurationMode@{setConfigurationMode}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KService\-Type\-Profile::set\-Configuration\-Mode ()\hspace{0.3cm}{\tt  [inline, static]}}\label{classKServiceTypeProfile_e5}


This method activates a special mode of KService\-Type\-Profile, in which all/all and all/allfiles are excluded from the results of the queries. 

It is meant for the configuration module \_\-only\_\-. 

Definition at line 134 of file kuserprofile.h.\index{KServiceTypeProfile@{KService\-Type\-Profile}!addService@{addService}}
\index{addService@{addService}!KServiceTypeProfile@{KService\-Type\-Profile}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KService\-Type\-Profile::add\-Service (const {\bf QString} \& {\em \_\-service}, int {\em \_\-preference} = 1, bool {\em \_\-allow\_\-as\_\-default} = TRUE)\hspace{0.3cm}{\tt  [protected]}}\label{classKServiceTypeProfile_b1}


Add a service to this profile. 



Definition at line 194 of file kuserprofile.cpp.

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