\section{KURIFilter\-Data Class Reference}
\label{classKURIFilterData}\index{KURIFilterData@{KURIFilterData}}
This is a basic message object used for exchanging filtering information between the filter plugins and the application whenever the application requires more information about the URI than just a filtered version of it. A message object for exchanging filtering URI info.  


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

Collaboration diagram for KURIFilter\-Data:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=120pt]{classKURIFilterData__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf URITypes} \{ \par
{\bf NET\_\-PROTOCOL} = 0, 
{\bf LOCAL\_\-FILE}, 
{\bf LOCAL\_\-DIR}, 
{\bf EXECUTABLE}, 
\par
{\bf HELP}, 
{\bf SHELL}, 
{\bf BLOCKED}, 
{\bf ERROR}, 
\par
{\bf UNKNOWN}
 \}
\begin{CompactList}\small\item\em Describes the type of URI to be filtered. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KURIFilter\-Data} ()
\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
{\bf KURIFilter\-Data} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Creates a URIFilter\-Data object from the given URL. \item\end{CompactList}\item 
{\bf KURIFilter\-Data} (const  {\bf QString} \&url)
\begin{CompactList}\small\item\em Creates a URIFilter\-Data object from the given string. \item\end{CompactList}\item 
{\bf KURIFilter\-Data} (const  {\bf KURIFilter\-Data} \&)
\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
{\bf $\sim$KURIFilter\-Data} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
bool {\bf has\-Been\-Filtered} () const 
\begin{CompactList}\small\item\em This method has been deprecated and will always return TRUE. \item\end{CompactList}\item 
{\bf KURL} {\bf uri} () const 
\begin{CompactList}\small\item\em Returns the filtered or the original URL. \item\end{CompactList}\item 
{\bf QString} {\bf error\-Msg} () const 
\begin{CompactList}\small\item\em Returns an error message. \item\end{CompactList}\item 
{\bf URITypes} {\bf uri\-Type} () const 
\begin{CompactList}\small\item\em Returns the URI type. \item\end{CompactList}\item 
void {\bf set\-Data} (const  {\bf QString} \&url)
\begin{CompactList}\small\item\em Sets the URL to be filtered. \item\end{CompactList}\item 
void {\bf set\-Data} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Same as above except the argument is a URL. \item\end{CompactList}\item 
bool {\bf set\-Absolute\-Path} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Sets the absolute path to be used whenever the supplied data is a relative local URL. \item\end{CompactList}\item 
{\bf QString} {\bf absolute\-Path} () const 
\begin{CompactList}\small\item\em Returns the absolute path if one has already been set. \item\end{CompactList}\item 
bool {\bf has\-Absolute\-Path} () const 
\begin{CompactList}\small\item\em Returns true if the supplied data has an absolute path. \item\end{CompactList}\item 
{\bf QString} {\bf args\-And\-Options} () const 
\begin{CompactList}\small\item\em Returns the command line options and arguments for a local resource when present. \item\end{CompactList}\item 
bool {\bf has\-Args\-And\-Options} () const 
\begin{CompactList}\small\item\em Returns true if the current data is a local resource with command line options and arguments. \item\end{CompactList}\item 
{\bf QString} {\bf icon\-Name} ()
\begin{CompactList}\small\item\em Returns the name of the icon that matches the current filtered URL. \item\end{CompactList}\item 
{\bf KURIFilter\-Data} \& {\bf operator=} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Overloaded assigenment operator. \item\end{CompactList}\item 
{\bf KURIFilter\-Data} \& {\bf operator=} (const  {\bf QString} \&url)
\begin{CompactList}\small\item\em Overloaded assigenment operator. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} (const  {\bf KURL} \&url=QString::null)
\begin{CompactList}\small\item\em Initializes the KURIFilter\-Data on construction. \item\end{CompactList}\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KURIFilter\-Plugin}\label{classKURIFilterData_n0}

\end{CompactItemize}


\subsection{Detailed Description}
This is a basic message object used for exchanging filtering information between the filter plugins and the application whenever the application requires more information about the URI than just a filtered version of it. A message object for exchanging filtering URI info. 

Any application can create an instance of this class and send it to {\bf KURIFilter}{\rm (p.\,\pageref{classKURIFilter})} to have the filter plugins fill the necessary information.

{\bf  Example \small\begin{alltt}
   {\bf QString} text = "kde.org";
   KURIFilterData d = text;
   bool filtered = {\bf KURIFilter::self()}{\rm (p.\,\pageref{classKURIFilter_e0})}-$>$filter( d );
   if( filtered )
     print ( "URI: %s\(\backslash\)n"Filtered URI: s\par
 URI Type: i\par
"Was Filtered: %i"
             text.latin1(), d.uri().url().latin1(), d.uriType(), filtered );
 \end{alltt}\normalsize 
}

{\bf  The above code should yield the following output: \small\begin{alltt}
   URI: kde.org
   Filtered URI: {\tt http://kde.org}
   URI Type: 0            $<$== means NET\_PROTOCOL
   Was Filtered: 1        $<$== means the URL was successfully filtered
 \end{alltt}\normalsize 
}

{\bf }

{\bf  }



Definition at line 64 of file kurifilter.h.

\subsection{Member Enumeration Documentation}
\index{KURIFilterData@{KURIFilter\-Data}!URITypes@{URITypes}}
\index{URITypes@{URITypes}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KURIFilter\-Data::URITypes}}\label{classKURIFilterData_w9}


Describes the type of URI to be filtered. 

This enumerator prvoides the return value for {\bf uri\-Type}{\rm (p.\,\pageref{classKURIFilterData_a8})}. A brief description for each value:

\begin{itemize}
\item NET\_\-PROTOCOL - Any network protocol: http, ftp, nttp, pop3, etc... \item LOCAL\_\-FILE - A local file whose executable flag is not set \item LOCAL\_\-DIR - A local directory \item EXECUTABLE - A local file whose executable flag is set \item HELP - A man or info page \item SHELL - A shell executable (ex: echo \char`\"{}Test...\char`\"{} $>$$>$ $\sim$/testfile) \item BLOCKED - A URI that should be blocked/filtered (ex: ad filtering) \item ERROR - An incorrect URI (ex: \char`\"{}$\sim$johndoe\char`\"{} when user johndoe does not exist in that system ) \item UNKNOWN - A URI that is not identified. Default value when a KURIFilter\-Data is first created. \end{itemize}


Definition at line 87 of file kurifilter.h.

Referenced by uri\-Type().

\subsection{Constructor \& Destructor Documentation}
\index{KURIFilterData@{KURIFilter\-Data}!KURIFilterData@{KURIFilterData}}
\index{KURIFilterData@{KURIFilterData}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURIFilter\-Data::KURIFilter\-Data ()\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a0}


Default constructor. 

Creates a URIFilter\-Data object. 

Definition at line 94 of file kurifilter.h.

References init().\index{KURIFilterData@{KURIFilter\-Data}!KURIFilterData@{KURIFilterData}}
\index{KURIFilterData@{KURIFilterData}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURIFilter\-Data::KURIFilter\-Data (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a1}


Creates a URIFilter\-Data object from the given URL. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]is the URL to be filtered. \end{description}
\end{Desc}


Definition at line 101 of file kurifilter.h.

References init().\index{KURIFilterData@{KURIFilter\-Data}!KURIFilterData@{KURIFilterData}}
\index{KURIFilterData@{KURIFilterData}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURIFilter\-Data::KURIFilter\-Data (const {\bf QString} \& {\em url})\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a2}


Creates a URIFilter\-Data object from the given string. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]is the string to be filtered. \end{description}
\end{Desc}


Definition at line 108 of file kurifilter.h.

References init().\index{KURIFilterData@{KURIFilter\-Data}!KURIFilterData@{KURIFilterData}}
\index{KURIFilterData@{KURIFilterData}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURIFilter\-Data::KURIFilter\-Data (const {\bf KURIFilter\-Data} \&)}\label{classKURIFilterData_a3}


Copy constructor. 

Creates a URIFilter\-Data object from another URI filter data object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]the uri filter data to be copied. \end{description}
\end{Desc}


Definition at line 58 of file kurifilter.cpp.

References absolute\-Path(), m\_\-b\-Changed, m\_\-i\-Type, m\_\-p\-URI, m\_\-str\-Err\-Msg, and m\_\-str\-Icon\-Name.\index{KURIFilterData@{KURIFilter\-Data}!~KURIFilterData@{$\sim$KURIFilterData}}
\index{~KURIFilterData@{$\sim$KURIFilterData}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KURIFilter\-Data::$\sim${\bf KURIFilter\-Data} ()}\label{classKURIFilterData_a4}


Destructor. 



Definition at line 69 of file kurifilter.cpp.

\subsection{Member Function Documentation}
\index{KURIFilterData@{KURIFilter\-Data}!hasBeenFiltered@{hasBeenFiltered}}
\index{hasBeenFiltered@{hasBeenFiltered}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURIFilter\-Data::has\-Been\-Filtered () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a5}


This method has been deprecated and will always return TRUE. 

You should instead use the result from the {\bf KURIFilter::filter\-URI}{\rm (p.\,\pageref{classKURIFilter_a1})}() calls.

{\bf This class or method is obsolete, it is provided for compatibility only.} 

Definition at line 132 of file kurifilter.h.\index{KURIFilterData@{KURIFilter\-Data}!uri@{uri}}
\index{uri@{uri}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURL} KURIFilter\-Data::uri () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a6}


Returns the filtered or the original URL. 

This function returns the filtered url if one of the plugins sucessfully filtered the original URL. Otherwise, it returns the original URL. See {\bf has\-Been\-Filtered}{\rm (p.\,\pageref{classKURIFilterData_a5})}() and

\begin{Desc}
\item[Returns:]the filtered or original url. \end{Desc}


Definition at line 144 of file kurifilter.h.

Referenced by KURIFilter::filtered\-URI(), KURIFilter::filter\-URI(), and KURIFilter\-Plugin::set\-Filtered\-URI().\index{KURIFilterData@{KURIFilter\-Data}!errorMsg@{errorMsg}}
\index{errorMsg@{errorMsg}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURIFilter\-Data::error\-Msg () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a7}


Returns an error message. 

This functions returns the error message set by the plugin whenever the uri type is set to KURIFilter\-Data::ERROR. Otherwise, it returns a QString::null.

\begin{Desc}
\item[Returns:]the error message or a NULL when there is none. \end{Desc}


Definition at line 156 of file kurifilter.h.\index{KURIFilterData@{KURIFilter\-Data}!uriType@{uriType}}
\index{uriType@{uriType}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf URITypes} KURIFilter\-Data::uri\-Type () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a8}


Returns the URI type. 

This method always returns KURIFilter\-Data::UNKNOWN if the given URL was not filtered. 

Definition at line 164 of file kurifilter.h.

References URITypes.\index{KURIFilterData@{KURIFilter\-Data}!setData@{setData}}
\index{setData@{setData}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURIFilter\-Data::set\-Data (const {\bf QString} \& {\em url})\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a9}


Sets the URL to be filtered. 

Use this function to set the string to be filtered when you construct an empty filter object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]the string to be filtered. \end{description}
\end{Desc}


Definition at line 175 of file kurifilter.h.

References init().\index{KURIFilterData@{KURIFilter\-Data}!setData@{setData}}
\index{setData@{setData}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURIFilter\-Data::set\-Data (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a10}


Same as above except the argument is a URL. 

Use this function to set the string to be filtered when you construct an empty filter object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]the URL to be filtered. \end{description}
\end{Desc}


Definition at line 186 of file kurifilter.h.

References init().\index{KURIFilterData@{KURIFilter\-Data}!setAbsolutePath@{setAbsolutePath}}
\index{setAbsolutePath@{setAbsolutePath}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURIFilter\-Data::set\-Absolute\-Path (const {\bf QString} \&)}\label{classKURIFilterData_a11}


Sets the absolute path to be used whenever the supplied data is a relative local URL. 

NOTE: This function works only for a local resource and expects the absolute path to the relative URL set in this meta object. If you are extracting the absolute path from a {\bf KURL} object, make sure you always set the argument below using {\bf KURL::path()} instead of {\bf KURL::url()} so that \char`\"{}file:/\char`\"{} would not be appended! Otherwise, the filter might not be able to make correct determination whether the relative URL locally exists!

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em abs\_\-path}]the abolute path to the local resource. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if absolute path is successfully set. Otherwise, false. \end{Desc}


Definition at line 96 of file kurifilter.cpp.

References KURL::is\-Local\-File(), and KURL::is\-Malformed().\index{KURIFilterData@{KURIFilter\-Data}!absolutePath@{absolutePath}}
\index{absolutePath@{absolutePath}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURIFilter\-Data::absolute\-Path () const}\label{classKURIFilterData_a12}


Returns the absolute path if one has already been set. 



Definition at line 108 of file kurifilter.cpp.

Referenced by KURIFilter\-Data().\index{KURIFilterData@{KURIFilter\-Data}!hasAbsolutePath@{hasAbsolutePath}}
\index{hasAbsolutePath@{hasAbsolutePath}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURIFilter\-Data::has\-Absolute\-Path () const}\label{classKURIFilterData_a13}


Returns true if the supplied data has an absolute path. 



Definition at line 91 of file kurifilter.cpp.\index{KURIFilterData@{KURIFilter\-Data}!argsAndOptions@{argsAndOptions}}
\index{argsAndOptions@{argsAndOptions}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURIFilter\-Data::args\-And\-Options () const}\label{classKURIFilterData_a14}


Returns the command line options and arguments for a local resource when present. 

\begin{Desc}
\item[Returns:]options and arguments when present, otherwise QString::null \end{Desc}


Definition at line 113 of file kurifilter.cpp.\index{KURIFilterData@{KURIFilter\-Data}!hasArgsAndOptions@{hasArgsAndOptions}}
\index{hasArgsAndOptions@{hasArgsAndOptions}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURIFilter\-Data::has\-Args\-And\-Options () const}\label{classKURIFilterData_a15}


Returns true if the current data is a local resource with command line options and arguments. 



Definition at line 86 of file kurifilter.cpp.\index{KURIFilterData@{KURIFilter\-Data}!iconName@{iconName}}
\index{iconName@{iconName}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURIFilter\-Data::icon\-Name ()}\label{classKURIFilterData_a16}


Returns the name of the icon that matches the current filtered URL. 

NOTE that this function will return a NULL string by default and when no associated icon is found.

\begin{Desc}
\item[Returns:]the name of the icon associated with the resource \end{Desc}


Definition at line 118 of file kurifilter.cpp.

References QString::from\-Latin1(), KMime\-Type::icon\-For\-URL(), KService::service\-By\-Desktop\-Name(), and KURL::url().\index{KURIFilterData@{KURIFilter\-Data}!operator=@{operator=}}
\index{operator=@{operator=}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURIFilter\-Data}\& KURIFilter\-Data::operator= (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a17}


Overloaded assigenment operator. 

This function allows you to easily assign a {\bf KURL} to a KURIFilter\-Data object.

\begin{Desc}
\item[Returns:]an instance of a KURIFilter\-Data object. \end{Desc}


Definition at line 250 of file kurifilter.h.

References init().\index{KURIFilterData@{KURIFilter\-Data}!operator=@{operator=}}
\index{operator=@{operator=}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KURIFilter\-Data}\& KURIFilter\-Data::operator= (const {\bf QString} \& {\em url})\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a18}


Overloaded assigenment operator. 

This function allows you to easily assign a {\bf QString} to a KURIFilter\-Data object.

\begin{Desc}
\item[Returns:]an instance of a KURIFilter\-Data object. \end{Desc}


Definition at line 260 of file kurifilter.h.

References init().\index{KURIFilterData@{KURIFilter\-Data}!init@{init}}
\index{init@{init}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURIFilter\-Data::init (const {\bf KURL} \& {\em url} = QString::null)\hspace{0.3cm}{\tt  [protected]}}\label{classKURIFilterData_b0}


Initializes the KURIFilter\-Data on construction. 



Definition at line 75 of file kurifilter.cpp.

Referenced by KURIFilter\-Data(), operator=(), and set\-Data().

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