\section{KScript\-Manager Class Reference}
\label{classKScriptManager}\index{KScriptManager@{KScriptManager}}
This class is the base for all script engines.  


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

Inheritance diagram for KScript\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=109pt]{classKScriptManager__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KScript\-Manager:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=298pt]{classKScriptManager__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf run\-Script} (const {\bf QString} \&script\-Name, {\bf QObject} $\ast$context=0, const {\bf QVariant} \&arg=0)
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf script\-Error} (const {\bf QString} \&msg)
\item 
void {\bf script\-Warning} (const {\bf QString} \&msg)
\item 
void {\bf script\-Output} (const {\bf QString} \&msg)
\item 
void {\bf script\-Progress} (int percent)
\item 
void {\bf script\-Done} (KScript\-Client\-Interface::Result result, const {\bf QVariant} \&returned)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KScript\-Manager} ({\bf QObject} $\ast${\bf parent}, const char $\ast${\bf name})
\item 
virtual {\bf $\sim$KScript\-Manager} ()
\item 
bool {\bf add\-Script} (const {\bf QString} \&script\-Desktop\-File)
\item 
bool {\bf remove\-Script} (const {\bf QString} \&script\-Name)
\item 
{\bf QString\-List} {\bf scripts} ()
\item 
void {\bf clear} ()
\item 
void {\bf error} (const {\bf QString} \&msg)
\item 
void {\bf warning} (const {\bf QString} \&msg)
\item 
void {\bf output} (const {\bf QString} \&msg)
\item 
void {\bf progress} (int percent)
\item 
void {\bf done} (KScript\-Client\-Interface::Result result, const {\bf QVariant} \&returned)
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QDict}$<$ Script\-Info $>$ {\bf m\_\-scripts}\label{classKScriptManager_p0}

\item 
{\bf QDict}$<$ {\bf KScript\-Interface} $>$ {\bf m\_\-script\-Cache}\label{classKScriptManager_p1}

\item 
{\bf QString} {\bf m\_\-current\-Script}\label{classKScriptManager_p2}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KScript\-Interface}\label{classKScriptManager_n0}

\end{CompactItemize}


\subsection{Detailed Description}
This class is the base for all script engines. 

\begin{Desc}
\item[Author:]Ian Reinhart Geiser $<${\tt geiseri@kde.org}$>$ \end{Desc}




Definition at line 39 of file scriptmanager.h.

\subsection{Constructor \& Destructor Documentation}
\index{KScriptManager@{KScript\-Manager}!KScriptManager@{KScriptManager}}
\index{KScriptManager@{KScriptManager}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KScript\-Manager::KScript\-Manager ({\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name})}\label{classKScriptManager_a0}


Create a new instance of the script engine. 



Definition at line 28 of file scriptmanager.cpp.\index{KScriptManager@{KScript\-Manager}!~KScriptManager@{$\sim$KScriptManager}}
\index{~KScriptManager@{$\sim$KScriptManager}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KScript\-Manager::$\sim${\bf KScript\-Manager} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKScriptManager_a1}


Destroy the current script engine. 



Definition at line 33 of file scriptmanager.cpp.

References QDict::set\-Auto\-Delete().

\subsection{Member Function Documentation}
\index{KScriptManager@{KScript\-Manager}!addScript@{addScript}}
\index{addScript@{addScript}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KScript\-Manager::add\-Script (const {\bf QString} \& {\em script\-Desktop\-File})}\label{classKScriptManager_a2}


Add a new script instance to the script engine. 

This should be the full name and path to the desktop file.

Definition at line 39 of file scriptmanager.cpp.

References QDict::insert(), KDesktop\-File::is\-Desktop\-File(), locate(), KConfig\-Base::read\-Entry(), KDesktop\-File::read\-Name(), and KDesktop\-File::read\-Type().\index{KScriptManager@{KScript\-Manager}!removeScript@{removeScript}}
\index{removeScript@{removeScript}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KScript\-Manager::remove\-Script (const {\bf QString} \& {\em script\-Name})}\label{classKScriptManager_a3}


Remove a script instance from the script engine. 

\begin{Desc}
\item[Returns:]the success of the operation.\end{Desc}


Definition at line 61 of file scriptmanager.cpp.

References QDict::remove().\index{KScriptManager@{KScript\-Manager}!scripts@{scripts}}
\index{scripts@{scripts}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KScript\-Manager::scripts ()}\label{classKScriptManager_a4}


Access the names of script instances from the script engine. 

\begin{Desc}
\item[Returns:]a {\bf QString\-List} of the current scripts.\end{Desc}


Definition at line 67 of file scriptmanager.cpp.

References QDict\-Iterator::current(), and QDict\-Iterator::current\-Key().\index{KScriptManager@{KScript\-Manager}!clear@{clear}}
\index{clear@{clear}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::clear ()}\label{classKScriptManager_a5}


Clear all script intstances in memory. 



Definition at line 79 of file scriptmanager.cpp.

References QDict::clear().\index{KScriptManager@{KScript\-Manager}!error@{error}}
\index{error@{error}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::error (const {\bf QString} \& {\em msg})\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKScriptManager_a6}


This function will allow the main application of any errors that have occurred during processing of the script. 



Implements {\bf KScript\-Client\-Interface} {\rm (p.\,\pageref{classKScriptClientInterface_a0})}.

Definition at line 76 of file scriptmanager.h.\index{KScriptManager@{KScript\-Manager}!warning@{warning}}
\index{warning@{warning}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::warning (const {\bf QString} \& {\em msg})\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKScriptManager_a7}


This function will allow the main application of any warnings that have occurred during the processing of the script. 



Implements {\bf KScript\-Client\-Interface} {\rm (p.\,\pageref{classKScriptClientInterface_a1})}.

Definition at line 81 of file scriptmanager.h.\index{KScriptManager@{KScript\-Manager}!output@{output}}
\index{output@{output}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::output (const {\bf QString} \& {\em msg})\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKScriptManager_a8}


This function will allow the main application of any normal output that has occurred during the processing of the script. 



Implements {\bf KScript\-Client\-Interface} {\rm (p.\,\pageref{classKScriptClientInterface_a2})}.

Definition at line 86 of file scriptmanager.h.\index{KScriptManager@{KScript\-Manager}!progress@{progress}}
\index{progress@{progress}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::progress (int {\em percent})\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKScriptManager_a9}


This function will allow feedback to any progress bars in the main application as to how far along the script is. 

This is very useful when a script is processing files or doing some long operation that is of a known duration.

Implements {\bf KScript\-Client\-Interface} {\rm (p.\,\pageref{classKScriptClientInterface_a3})}.

Definition at line 93 of file scriptmanager.h.\index{KScriptManager@{KScript\-Manager}!done@{done}}
\index{done@{done}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::done (KScript\-Client\-Interface::Result {\em result}, const {\bf QVariant} \& {\em returned})\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKScriptManager_a10}


This function will allow feedback on completion of the script. 

It turns the result as a KScript\-Inteface::Result, and a return value as a {\bf QVariant}

Implements {\bf KScript\-Client\-Interface} {\rm (p.\,\pageref{classKScriptClientInterface_a4})}.

Definition at line 99 of file scriptmanager.h.\index{KScriptManager@{KScript\-Manager}!runScript@{runScript}}
\index{runScript@{runScript}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::run\-Script (const {\bf QString} \& {\em script\-Name}, {\bf QObject} $\ast$ {\em context} = {\tt 0}, const {\bf QVariant} \& {\em arg} = {\tt 0})\hspace{0.3cm}{\tt  [slot]}}\label{classKScriptManager_i0}


Run the selected script. 



Definition at line 84 of file scriptmanager.cpp.

References endl(), QDict::insert(), kd\-Debug(), QDict::remove(), and KMessage\-Box::sorry().\index{KScriptManager@{KScript\-Manager}!scriptError@{scriptError}}
\index{scriptError@{scriptError}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::script\-Error (const {\bf QString} \& {\em msg})\hspace{0.3cm}{\tt  [signal]}}\label{classKScriptManager_l0}


Send out a signal of the error message from the current running script. 

\index{KScriptManager@{KScript\-Manager}!scriptWarning@{scriptWarning}}
\index{scriptWarning@{scriptWarning}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::script\-Warning (const {\bf QString} \& {\em msg})\hspace{0.3cm}{\tt  [signal]}}\label{classKScriptManager_l1}


Send out a signal of the warning message from the current running script. 

\index{KScriptManager@{KScript\-Manager}!scriptOutput@{scriptOutput}}
\index{scriptOutput@{scriptOutput}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::script\-Output (const {\bf QString} \& {\em msg})\hspace{0.3cm}{\tt  [signal]}}\label{classKScriptManager_l2}


Send out a signal of the output message from the current running script. 

\index{KScriptManager@{KScript\-Manager}!scriptProgress@{scriptProgress}}
\index{scriptProgress@{scriptProgress}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::script\-Progress (int {\em percent})\hspace{0.3cm}{\tt  [signal]}}\label{classKScriptManager_l3}


Send out a signal of the progress of the current running script. 

\index{KScriptManager@{KScript\-Manager}!scriptDone@{scriptDone}}
\index{scriptDone@{scriptDone}!KScriptManager@{KScript\-Manager}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KScript\-Manager::script\-Done (KScript\-Client\-Interface::Result {\em result}, const {\bf QVariant} \& {\em returned})\hspace{0.3cm}{\tt  [signal]}}\label{classKScriptManager_l4}


Send out a signal of the exit status of the script. 



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