\section{KHTMLPage\-Cache Class Reference}
\label{classKHTMLPageCache}\index{KHTMLPageCache@{KHTMLPageCache}}
Singleton Object that handles a binary cache on top of the http cache management of kio.  


{\tt \#include $<$khtml\_\-pagecache.h$>$}

Inheritance diagram for KHTMLPage\-Cache:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=72pt]{classKHTMLPageCache__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KHTMLPage\-Cache:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=98pt]{classKHTMLPageCache__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
long {\bf create\-Cache\-Entry} ()
\begin{CompactList}\small\item\em Create a new cache entry. \item\end{CompactList}\item 
void {\bf add\-Data} (long id, const  {\bf QByte\-Array} \&data)
\begin{CompactList}\small\item\em Add {\tt data} to the cache entry with id {\tt id}. \item\end{CompactList}\item 
void {\bf end\-Data} (long id)
\begin{CompactList}\small\item\em Signal end of data for the cache entry with id {\tt id}. \item\end{CompactList}\item 
void {\bf cancel\-Entry} (long id)
\begin{CompactList}\small\item\em Cancel the entry. \item\end{CompactList}\item 
bool {\bf is\-Valid} (long id)
\item 
void {\bf fetch\-Data} (long id, {\bf QObject} $\ast$recv\-Obj, const  char $\ast$recv\-Slot)
\begin{CompactList}\small\item\em Fetch data for cache entry {\tt id} and send it to slot {\tt recv\-Slot} in the object {\tt recv\-Obj}. \item\end{CompactList}\item 
void {\bf cancel\-Fetch} ({\bf QObject} $\ast$recv\-Obj)
\begin{CompactList}\small\item\em Cancel sending data to {\tt recv\-Obj}. \item\end{CompactList}\item 
void {\bf save\-Data} (long id, {\bf QData\-Stream} $\ast$str)
\begin{CompactList}\small\item\em Save the data of cache entry {\tt id} to the datastream {\tt str}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KHTMLPage\-Cache} $\ast$ {\bf self} ()
\begin{CompactList}\small\item\em static \char`\"{}constructor\char`\"{}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Singleton Object that handles a binary cache on top of the http cache management of kio. 

A limited number of HTML pages are stored in this cache. This cache is used for the history and operations like \char`\"{}view source\char`\"{}. These operations always want to use the original document and don't want to fetch the data from the network again.

It operates completely independent from the kio\_\-http cache. 



Definition at line 38 of file khtml\_\-pagecache.h.

\subsection{Member Function Documentation}
\index{KHTMLPageCache@{KHTMLPage\-Cache}!self@{self}}
\index{self@{self}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KHTMLPage\-Cache} $\ast$ KHTMLPage\-Cache::self ()\hspace{0.3cm}{\tt  [static]}}\label{classKHTMLPageCache_e0}


static \char`\"{}constructor\char`\"{}. 

\begin{Desc}
\item[Returns:]returns a pointer to the cache, if it exists. creates a new cache otherwise. \end{Desc}


Definition at line 121 of file khtml\_\-pagecache.cpp.

Referenced by KHTMLPart::close\-URL(), and KHTMLPart::restore\-State().\index{KHTMLPageCache@{KHTMLPage\-Cache}!createCacheEntry@{createCacheEntry}}
\index{createCacheEntry@{createCacheEntry}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}long KHTMLPage\-Cache::create\-Cache\-Entry ()}\label{classKHTMLPageCache_a1}


Create a new cache entry. 

\begin{Desc}
\item[Returns:]a cache entry ID is returned. \end{Desc}


Definition at line 143 of file khtml\_\-pagecache.cpp.\index{KHTMLPageCache@{KHTMLPage\-Cache}!addData@{addData}}
\index{addData@{addData}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHTMLPage\-Cache::add\-Data (long {\em id}, const {\bf QByte\-Array} \& {\em data})}\label{classKHTMLPageCache_a2}


Add {\tt data} to the cache entry with id {\tt id}. 



Definition at line 158 of file khtml\_\-pagecache.cpp.\index{KHTMLPageCache@{KHTMLPage\-Cache}!endData@{endData}}
\index{endData@{endData}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHTMLPage\-Cache::end\-Data (long {\em id})}\label{classKHTMLPageCache_a3}


Signal end of data for the cache entry with id {\tt id}. 

After calling this the entry is marked valid 

Definition at line 166 of file khtml\_\-pagecache.cpp.\index{KHTMLPageCache@{KHTMLPage\-Cache}!cancelEntry@{cancelEntry}}
\index{cancelEntry@{cancelEntry}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHTMLPage\-Cache::cancel\-Entry (long {\em id})}\label{classKHTMLPageCache_a4}


Cancel the entry. 



Definition at line 174 of file khtml\_\-pagecache.cpp.

Referenced by KHTMLPart::close\-URL().\index{KHTMLPageCache@{KHTMLPage\-Cache}!isValid@{isValid}}
\index{isValid@{isValid}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KHTMLPage\-Cache::is\-Valid (long {\em id})}\label{classKHTMLPageCache_a5}


\begin{Desc}
\item[Returns:]true when the cache entry with id {\tt is} still valid. and can be accessed for reading. \end{Desc}


Definition at line 185 of file khtml\_\-pagecache.cpp.

Referenced by KHTMLPart::restore\-State().\index{KHTMLPageCache@{KHTMLPage\-Cache}!fetchData@{fetchData}}
\index{fetchData@{fetchData}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHTMLPage\-Cache::fetch\-Data (long {\em id}, {\bf QObject} $\ast$ {\em recv\-Obj}, const char $\ast$ {\em recv\-Slot})}\label{classKHTMLPageCache_a6}


Fetch data for cache entry {\tt id} and send it to slot {\tt recv\-Slot} in the object {\tt recv\-Obj}. 



Definition at line 194 of file khtml\_\-pagecache.cpp.

References QTimer::single\-Shot().\index{KHTMLPageCache@{KHTMLPage\-Cache}!cancelFetch@{cancelFetch}}
\index{cancelFetch@{cancelFetch}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHTMLPage\-Cache::cancel\-Fetch ({\bf QObject} $\ast$ {\em recv\-Obj})}\label{classKHTMLPageCache_a7}


Cancel sending data to {\tt recv\-Obj}. 



Definition at line 212 of file khtml\_\-pagecache.cpp.

References KStd\-Accel::next().

Referenced by KHTMLPart::close\-URL().\index{KHTMLPageCache@{KHTMLPage\-Cache}!saveData@{saveData}}
\index{saveData@{saveData}!KHTMLPageCache@{KHTMLPage\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KHTMLPage\-Cache::save\-Data (long {\em id}, {\bf QData\-Stream} $\ast$ {\em str})}\label{classKHTMLPageCache_a8}


Save the data of cache entry {\tt id} to the datastream {\tt str}. 



Definition at line 266 of file khtml\_\-pagecache.cpp.

References QData\-Stream::write\-Raw\-Bytes().

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