\section{KDCOPService\-Starter Class Reference}
\label{classKDCOPServiceStarter}\index{KDCOPServiceStarter@{KDCOPServiceStarter}}
A generic DCOP service starter, using {\bf KTrader}{\rm (p.\,\pageref{classKTrader})}.  


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

Collaboration diagram for KDCOPService\-Starter:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=97pt]{classKDCOPServiceStarter__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
int {\bf find\-Service\-For} (const {\bf QString} \&service\-Type, const {\bf QString} \&constraint=QString::null, const {\bf QString} \&preferences=QString::null, {\bf QString} $\ast$error=0, {\bf QCString} $\ast$dcop\-Service=0, int flags=0)
\item 
virtual int {\bf start\-Service\-For} (const {\bf QString} \&service\-Type, const {\bf QString} \&constraint=QString::null, const {\bf QString} \&preferences=QString::null, {\bf QString} $\ast$error=0, {\bf QCString} $\ast$dcop\-Service=0, int flags=0)
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf KDCOPService\-Starter} $\ast$ {\bf self} ()\label{classKDCOPServiceStarter_e0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KStatic\-Deleter$<$KDCOPService\-Starter$>$}\label{classKDCOPServiceStarter_n0}

\end{CompactItemize}


\subsection{Detailed Description}
A generic DCOP service starter, using {\bf KTrader}{\rm (p.\,\pageref{classKTrader})}. 

The default implementation starts new processes, but this interface can also be reimplemented by specific applications to provide dlopened in-process DCOP objects. \begin{Desc}
\item[Author:]David Faure $<${\tt faure@kde.org}$>$ \end{Desc}




Definition at line 34 of file kdcopservicestarter.h.

\subsection{Member Function Documentation}
\index{KDCOPServiceStarter@{KDCOPService\-Starter}!findServiceFor@{findServiceFor}}
\index{findServiceFor@{findServiceFor}!KDCOPServiceStarter@{KDCOPService\-Starter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KDCOPService\-Starter::find\-Service\-For (const {\bf QString} \& {\em service\-Type}, const {\bf QString} \& {\em constraint} = {\tt QString::null}, const {\bf QString} \& {\em preferences} = {\tt QString::null}, {\bf QString} $\ast$ {\em error} = {\tt 0}, {\bf QCString} $\ast$ {\em dcop\-Service} = {\tt 0}, int {\em flags} = {\tt 0})}\label{classKDCOPServiceStarter_a0}


Check if a given DCOP interface is available - from the service\-Type it's supposed to implement. 

The trader is queried to find the preferred application for this service\-Type, with the constraint that its X-DCOP-Service\-Name property must be defined. Then the DCOP server is checked. If the service is not available, this method will call start\-Service\-For to start it.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em service\-Type}]the type of service we're looking for \item[{\em constraint}]see {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} \item[{\em preferences}]see {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} \item[{\em error}]On failure, {\tt error} contains a description of the error that occurred. If the pointer is 0, the argument will be ignored \item[{\em dcop\-Service}]On success, {\tt dcop\-Service} contains the DCOP name under which this service is available. If the pointer is 0 the argument will be ignored \item[{\em flags}]for future extensions (currently unused)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]an error code indicating success (== 0) or failure ($>$ 0). \end{Desc}


Definition at line 49 of file kdcopservicestarter.cpp.

References endl(), QValue\-List::first(), QValue\-List::is\-Empty(), QString::is\-Empty(), kd\-Debug(), kd\-Warning(), KTrader::query(), KTrader::self(), and start\-Service\-For().\index{KDCOPServiceStarter@{KDCOPService\-Starter}!startServiceFor@{startServiceFor}}
\index{startServiceFor@{startServiceFor}!KDCOPServiceStarter@{KDCOPService\-Starter}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KDCOPService\-Starter::start\-Service\-For (const {\bf QString} \& {\em service\-Type}, const {\bf QString} \& {\em constraint} = {\tt QString::null}, const {\bf QString} \& {\em preferences} = {\tt QString::null}, {\bf QString} $\ast$ {\em error} = {\tt 0}, {\bf QCString} $\ast$ {\em dcop\-Service} = {\tt 0}, int {\em flags} = {\tt 0})\hspace{0.3cm}{\tt  [virtual]}}\label{classKDCOPServiceStarter_a1}


Find an implementation of the given {\tt service\-Type}, and start it, to use its DCOP interface. 

The default implementation uses {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} to find the preferred Application, and then starts it using kapp-$>$start\-Service...

However applications (like kontact) can reimplement this method, to provide an in-process way of loading the implementation for this service type.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em service\-Type}]the type of service we're looking for \item[{\em constraint}]see {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} \item[{\em preferences}]see {\bf KTrader}{\rm (p.\,\pageref{classKTrader})} \item[{\em error}]On failure, {\tt error} contains a description of the error that occurred. If the pointer is 0, the argument will be ignored \item[{\em dcop\-Service}]On success, {\tt dcop\-Service} contains the DCOP name under which this service is available. If the pointer is 0 the argument will be ignored \item[{\em flags}]for future extensions (currently unused)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]an error code indicating success (== 0) or failure ($>$ 0). \end{Desc}


Definition at line 86 of file kdcopservicestarter.cpp.

References endl(), QValue\-List::first(), QValue\-List::is\-Empty(), kd\-Debug(), KTrader::query(), and KTrader::self().

Referenced by find\-Service\-For().

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