\section{Observer Class Reference}
\label{classObserver}\index{Observer@{Observer}}
Observer for {\bf KIO::Job}{\rm (p.\,\pageref{classKIO_1_1Job})} progress information. Observer for {\bf KIO::Job}{\rm (p.\,\pageref{classKIO_1_1Job})} progress information.  


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

Inheritance diagram for Observer:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=90pt]{classObserver__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for Observer:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=154pt]{classObserver__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf slot\-Total\-Size} ({\bf KIO::Job} $\ast$, {\bf KIO::filesize\_\-t} size)\label{classObserver_i0}

\item 
void {\bf slot\-Total\-Files} ({\bf KIO::Job} $\ast$, unsigned long files)\label{classObserver_i1}

\item 
void {\bf slot\-Total\-Dirs} ({\bf KIO::Job} $\ast$, unsigned long dirs)\label{classObserver_i2}

\item 
void {\bf slot\-Processed\-Size} ({\bf KIO::Job} $\ast$, {\bf KIO::filesize\_\-t} size)\label{classObserver_i3}

\item 
void {\bf slot\-Processed\-Files} ({\bf KIO::Job} $\ast$, unsigned long files)\label{classObserver_i4}

\item 
void {\bf slot\-Processed\-Dirs} ({\bf KIO::Job} $\ast$, unsigned long dirs)\label{classObserver_i5}

\item 
void {\bf slot\-Speed} ({\bf KIO::Job} $\ast$, unsigned long bytes\_\-per\_\-second)\label{classObserver_i6}

\item 
void {\bf slot\-Percent} ({\bf KIO::Job} $\ast$, unsigned long percent)\label{classObserver_i7}

\item 
void {\bf slot\-Info\-Message} ({\bf KIO::Job} $\ast$, const {\bf QString} \&msg)\label{classObserver_i8}

\item 
void {\bf slot\-Copying} ({\bf KIO::Job} $\ast$, const {\bf KURL} \&from, const {\bf KURL} \&to)\label{classObserver_i9}

\item 
void {\bf slot\-Moving} ({\bf KIO::Job} $\ast$, const {\bf KURL} \&from, const {\bf KURL} \&to)\label{classObserver_i10}

\item 
void {\bf slot\-Deleting} ({\bf KIO::Job} $\ast$, const {\bf KURL} \&url)\label{classObserver_i11}

\item 
void {\bf slot\-Transferring} ({\bf KIO::Job} $\ast$, const {\bf KURL} \&url)
\item 
void {\bf slot\-Creating\-Dir} ({\bf KIO::Job} $\ast$, const {\bf KURL} \&dir)\label{classObserver_i13}

\item 
void {\bf slot\-Can\-Resume} ({\bf KIO::Job} $\ast$, {\bf KIO::filesize\_\-t} offset)\label{classObserver_i14}

\end{CompactItemize}
\subsection*{DCOP Member Functions}
\begin{CompactItemize}
\item 
void {\bf kill\-Job} (int progress\-Id)
\item 
{\bf KIO::Meta\-Data} {\bf metadata} (int progress\-Id)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
int {\bf new\-Job} ({\bf KIO::Job} $\ast$job, bool show\-Progress)
\item 
void {\bf job\-Finished} (int progress\-Id)
\item 
bool {\bf open\-Pass\-Dlg} (const {\bf QString} \&prompt, {\bf QString} \&user, {\bf QString} \&pass, bool read\-Only)
\item 
bool {\bf open\-Pass\-Dlg} ({\bf KIO::Auth\-Info} \&info)
\item 
{\bf KIO::Rename\-Dlg\_\-Result} {\bf open\_\-Rename\-Dlg} ({\bf KIO::Job} $\ast$job, const {\bf QString} \&caption, const {\bf QString} \&src, const {\bf QString} \&dest, KIO::Rename\-Dlg\_\-Mode mode, {\bf QString} \&new\-Dest, {\bf KIO::filesize\_\-t} size\-Src=({\bf KIO::filesize\_\-t})-1, {\bf KIO::filesize\_\-t} size\-Dest=({\bf KIO::filesize\_\-t})-1, time\_\-t ctime\-Src=(time\_\-t)-1, time\_\-t ctime\-Dest=(time\_\-t)-1, time\_\-t mtime\-Src=(time\_\-t)-1, time\_\-t mtime\-Dest=(time\_\-t)-1)\label{classObserver_a4}

\item 
KIO::Skip\-Dlg\_\-Result {\bf open\_\-Skip\-Dlg} ({\bf KIO::Job} $\ast$job, bool multi, const {\bf QString} \&error\_\-text)\label{classObserver_a5}

\item 
void {\bf stating} ({\bf KIO::Job} $\ast$, const {\bf KURL} \&url)\label{classObserver_a6}

\item 
void {\bf mounting} ({\bf KIO::Job} $\ast$, const {\bf QString} \&dev, const {\bf QString} \&point)\label{classObserver_a7}

\item 
void {\bf unmounting} ({\bf KIO::Job} $\ast$, const {\bf QString} \&point)\label{classObserver_a8}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf Observer} $\ast$ {\bf self} ()
\item 
static int {\bf message\-Box} (int progress\-Id, int type, const {\bf QString} \&text, const {\bf QString} \&caption, const {\bf QString} \&button\-Yes, const {\bf QString} \&button\-No)
\item 
static int {\bf message\-Box} (int progress\-Id, int type, const {\bf QString} \&text, const {\bf QString} \&caption, const {\bf QString} \&button\-Yes, const {\bf QString} \&button\-No, const {\bf QString} \&dont\-Ask\-Again\-Name)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classObserver_b2}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
UIServer\_\-stub $\ast$ {\bf m\_\-uiserver}\label{classObserver_p0}

\item 
{\bf QInt\-Dict}$<$ {\bf KIO::Job} $>$ {\bf m\_\-dct\-Jobs}\label{classObserver_p1}

\end{CompactItemize}
\subsection*{Static Protected Attributes}
\begin{CompactItemize}
\item 
static {\bf Observer} $\ast$ {\bf s\_\-p\-Observer} = 0L\label{classObserver_t0}

\end{CompactItemize}


\subsection{Detailed Description}
Observer for {\bf KIO::Job}{\rm (p.\,\pageref{classKIO_1_1Job})} progress information. Observer for {\bf KIO::Job}{\rm (p.\,\pageref{classKIO_1_1Job})} progress information. 

This class, of which there is always only one instance, \char`\"{}observes\char`\"{} what jobs do and forwards this information to the progress-info server.

It is a DCOP object so that the UI server can call the kill method when the user presses Cancel.

Usually jobs are automatically registered by the {\bf KIO::Scheduler}{\rm (p.\,\pageref{classKIO_1_1Scheduler})}, so you do not have to care about that.

\begin{Desc}
\item[Author:]David Faure $<${\tt faure@kde.org}$>$ \end{Desc}




Definition at line 55 of file observer.h.

\subsection{Member Function Documentation}
\index{Observer@{Observer}!self@{self}}
\index{self@{self}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static {\bf Observer}$\ast$ Observer::self ()\hspace{0.3cm}{\tt  [inline, static]}}\label{classObserver_e0}


Returns the unique observer object. 

\begin{Desc}
\item[Returns:]the observer object \end{Desc}


Definition at line 66 of file observer.h.

Referenced by KIO::mimetype(), KIO::mount(), KIO::Slave\-Interface::open\-Pass\-Dlg(), KIO::stat(), KIO::Transfer\-Job::Transfer\-Job(), and KIO::unmount().\index{Observer@{Observer}!newJob@{newJob}}
\index{newJob@{newJob}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Observer::new\-Job ({\bf KIO::Job} $\ast$ {\em job}, bool {\em show\-Progress})}\label{classObserver_a0}


Called by the job constructor, to signal its presence to the UI Server. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em job}]the new job \item[{\em show\-Progress}]true to show progress, false otherwise \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the progress ID assigned by the UI Server to the Job. \end{Desc}


Definition at line 81 of file observer.cpp.

References QInt\-Dict::insert().\index{Observer@{Observer}!jobFinished@{jobFinished}}
\index{jobFinished@{jobFinished}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Observer::job\-Finished (int {\em progress\-Id})}\label{classObserver_a1}


Called by the job destructor, to tell the UI Server that the job ended. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em progress\-Id}]the progress ID of the job, as returned by {\bf new\-Job()}{\rm (p.\,\pageref{classObserver_a0})} \end{description}
\end{Desc}


Definition at line 93 of file observer.cpp.

References QInt\-Dict::remove().\index{Observer@{Observer}!openPassDlg@{openPassDlg}}
\index{openPassDlg@{openPassDlg}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Observer::open\-Pass\-Dlg (const {\bf QString} \& {\em prompt}, {\bf QString} \& {\em user}, {\bf QString} \& {\em pass}, bool {\em read\-Only})}\label{classObserver_a2}


\begin{Desc}
\item[{\bf Deprecated}]use KIO::Auto\-Info \end{Desc}


Definition at line 227 of file observer.cpp.

References KIO::Auth\-Info::password, KIO::Auth\-Info::prompt, KIO::Auth\-Info::read\-Only, and KIO::Auth\-Info::username.

Referenced by KIO::Slave\-Interface::open\-Pass\-Dlg().\index{Observer@{Observer}!openPassDlg@{openPassDlg}}
\index{openPassDlg@{openPassDlg}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Observer::open\-Pass\-Dlg ({\bf KIO::Auth\-Info} \& {\em info})}\label{classObserver_a3}


Opens a password dialog. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em info}]the authentication information \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful (\char`\"{}ok\char`\"{} clicked), false otherwise \end{Desc}


Definition at line 244 of file observer.cpp.

References endl(), KIO::Password\-Dialog::get\-Name\-And\-Password(), and kd\-Debug().\index{Observer@{Observer}!messageBox@{messageBox}}
\index{messageBox@{messageBox}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Observer::message\-Box (int {\em progress\-Id}, int {\em type}, const {\bf QString} \& {\em text}, const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em button\-Yes}, const {\bf QString} \& {\em button\-No})\hspace{0.3cm}{\tt  [static]}}\label{classObserver_e1}


Popup a message box. 

See {\bf KIO::Slave\-Base}{\rm (p.\,\pageref{classKIO_1_1SlaveBase})}. This doesn't use DCOP anymore, it shows the dialog in the application's process. Otherwise, other apps would block when trying to communicate with {\bf UIServer}{\rm (p.\,\pageref{classUIServer})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em progress\-Id}]the progress ID of the job, as returned by {\bf new\-Job()}{\rm (p.\,\pageref{classObserver_a0})} \item[{\em type}]the type of the message box \item[{\em text}]the text to show \item[{\em caption}]the window caption \item[{\em button\-Yes}]the text of the \char`\"{}Yes\char`\"{} button \item[{\em button\-No}]the text of the \char`\"{}No button \end{description}
\end{Desc}


Definition at line 260 of file observer.cpp.\index{Observer@{Observer}!messageBox@{messageBox}}
\index{messageBox@{messageBox}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int Observer::message\-Box (int {\em progress\-Id}, int {\em type}, const {\bf QString} \& {\em text}, const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em button\-Yes}, const {\bf QString} \& {\em button\-No}, const {\bf QString} \& {\em dont\-Ask\-Again\-Name})\hspace{0.3cm}{\tt  [static]}}\label{classObserver_e2}


Popup a message box. 

See {\bf KIO::Slave\-Base}{\rm (p.\,\pageref{classKIO_1_1SlaveBase})}. This doesn't use DCOP anymore, it shows the dialog in the application's process. Otherwise, other apps would block when trying to communicate with {\bf UIServer}{\rm (p.\,\pageref{classUIServer})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em progress\-Id}]the progress ID of the job, as returned by {\bf new\-Job()}{\rm (p.\,\pageref{classObserver_a0})} \item[{\em type}]the type of the message box \item[{\em text}]the text to show \item[{\em caption}]the window caption \item[{\em button\-Yes}]the text of the \char`\"{}Yes\char`\"{} button \item[{\em button\-No}]the text of the \char`\"{}No button \item[{\em dont\-Ask\-Again\-Name}]A checkbox is added with which further confirmation can be turned off. The string is used to lookup and store the setting in kioslaverc. \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}


Definition at line 267 of file observer.cpp.

References QPtr\-List::append(), KSSLCertificate::chain(), QPtr\-List::count(), endl(), QDialog::exec(), KSSLCertificate::from\-String(), KMessage\-Box::information(), kd\-Debug(), kd\-Warning(), KMessage\-Box::question\-Yes\-No(), QPtr\-List::set\-Auto\-Delete(), KSSLCert\-Chain::set\-Chain(), KMessage\-Box::set\-Dont\-Show\-Ask\-Again\-Config(), KSSLInfo\-Dlg::setup(), QString\-List::split(), KMessage\-Box::warning\-Continue\-Cancel(), KMessage\-Box::warning\-Yes\-No(), and KMessage\-Box::warning\-Yes\-No\-Cancel().\index{Observer@{Observer}!killJob@{killJob}}
\index{killJob@{killJob}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Observer::kill\-Job (int {\em progress\-Id})}\label{classObserver_z0}


Called by the UI Server (using DCOP) if the user presses cancel. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em progress\-Id}]the progress ID of the job, as returned by {\bf new\-Job()}{\rm (p.\,\pageref{classObserver_a0})} \end{description}
\end{Desc}


Definition at line 99 of file observer.cpp.\index{Observer@{Observer}!metadata@{metadata}}
\index{metadata@{metadata}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Meta\-Data} Observer::metadata (int {\em progress\-Id})}\label{classObserver_z1}


Called by the UI Server (using DCOP) to get all the metadata of the job. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em progress\-Id}]the progress IDof the job, as returned by {\bf new\-Job()}{\rm (p.\,\pageref{classObserver_a0})} \end{description}
\end{Desc}


Definition at line 110 of file observer.cpp.\index{Observer@{Observer}!slotTransferring@{slotTransferring}}
\index{slotTransferring@{slotTransferring}!Observer@{Observer}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Observer::slot\-Transferring ({\bf KIO::Job} $\ast$, const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [slot]}}\label{classObserver_i12}


\begin{Desc}
\item[Since:]3.1 \end{Desc}




Definition at line 194 of file observer.cpp.

Referenced by KIO::Transfer\-Job::Transfer\-Job().

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