\section{KURIFilter\-Data Class Reference}
\label{classKURIFilterData}\index{KURIFilterData@{KURIFilterData}}
A basic message object used for exchanging filtering information between the filter plugins and the application requesting the filtering service. 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=100pt]{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}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KURIFilter\-Data} ()
\item 
{\bf KURIFilter\-Data} (const {\bf KURL} \&url)
\item 
{\bf KURIFilter\-Data} (const {\bf QString} \&url)
\item 
{\bf KURIFilter\-Data} (const {\bf KURIFilter\-Data} \&data)
\item 
{\bf $\sim$KURIFilter\-Data} ()
\item 
KDE\_\-DEPRECATED bool {\bf has\-Been\-Filtered} () const 
\item 
{\bf KURL} {\bf uri} () const 
\item 
{\bf QString} {\bf error\-Msg} () const 
\item 
{\bf URITypes} {\bf uri\-Type} () const 
\item 
void {\bf set\-Data} (const {\bf QString} \&url)
\item 
void {\bf set\-Data} (const {\bf KURL} \&url)
\item 
bool {\bf set\-Absolute\-Path} (const {\bf QString} \&abs\_\-path)
\item 
{\bf QString} {\bf absolute\-Path} () const 
\item 
bool {\bf has\-Absolute\-Path} () const 
\item 
{\bf QString} {\bf args\-And\-Options} () const 
\item 
bool {\bf has\-Args\-And\-Options} () const 
\item 
{\bf QString} {\bf icon\-Name} ()
\item 
void {\bf set\-Check\-For\-Executables} (bool check)
\item 
bool {\bf check\-For\-Executables} () const 
\item 
{\bf QString} {\bf typed\-String} () const 
\item 
{\bf KURIFilter\-Data} \& {\bf operator=} (const {\bf KURL} \&url)
\item 
{\bf KURIFilter\-Data} \& {\bf operator=} (const {\bf QString} \&url)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} (const {\bf KURL} \&url)
\item 
void {\bf init} (const {\bf QString} \&url=QString::null)
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KURIFilter\-Plugin}\label{classKURIFilterData_n0}

\end{CompactItemize}


\subsection{Detailed Description}
A basic message object used for exchanging filtering information between the filter plugins and the application requesting the filtering service. A message object for exchanging filtering URI info. 

Use this object if you require a more detailed information about the URI you want to filter. Any application can create an instance of this class and send it to {\bf KURIFilter}{\rm (p.\,\pageref{classKURIFilter})} to have the plugins fill out all possible information about the URI.

{\bf Example} 



\footnotesize\begin{verbatim}   QString text = "kde.org";
   KURIFilterData d = text;
   bool filtered = KURIFilter::self()->filter( d );
   cout << "URL: " << text.latin1() << endl
        << "Filtered URL: " << d.uri().url().latin1() << endl
        << "URI Type: " << d.uriType() << endl
        << "Was Filtered: " << filtered << endl;
\end{verbatim}
\normalsize


The above code should yield the following output: 

\footnotesize\begin{verbatim}   URI: kde.org
   Filtered URI: http://kde.org
   URI Type: 0            <== means NET_PROTOCOL
   Was Filtered: 1        <== means the URL was successfully filtered
\end{verbatim}
\normalsize


\begin{Desc}
\item[Author:]Dawit Alemayehu $<$adawit at kde.org$>$ \end{Desc}




Definition at line 78 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 the URI that was filtered. 

Here is a brief description of the types:

\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 99 of file kurifilter.h.

\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 106 of file kurifilter.h.\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 113 of file kurifilter.h.\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 120 of file kurifilter.h.\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} \& {\em 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 60 of file kurifilter.cpp.\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 74 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}KDE\_\-DEPRECATED 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.

\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 144 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 successfully 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 156 of file kurifilter.h.

Referenced by KURIFilter::filtered\-URI(), and KURIFilter::filter\-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 168 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. \begin{Desc}
\item[Returns:]the type of the URI \end{Desc}


Definition at line 177 of file kurifilter.h.\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 188 of file kurifilter.h.\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 199 of file kurifilter.h.\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} \& {\em abs\_\-path})}\label{classKURIFilterData_a11}


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

NOTE: This function should only be used for local resources, i.e. the \char`\"{}file:/\char`\"{} protocol. It is useful for specifying the absolute path in cases where the actual URL might be relative. meta object. If deriving the path from a {\bf KURL}, make sure you set the argument for this function to the result of calling path () instead of url ().

\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 124 of file kurifilter.cpp.

References KURL::is\-Local\-File(), and KURL::is\-Valid().\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. 

\begin{Desc}
\item[Returns:]the absolute path, or QString::null \end{Desc}
\begin{Desc}
\item[See also:]{\bf has\-Absolute\-Path()}{\rm (p.\,\pageref{classKURIFilterData_a13})} \end{Desc}


Definition at line 136 of file kurifilter.cpp.\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}


Checks whether the supplied data had an absolute path. 

\begin{Desc}
\item[Returns:]true if the supplied data has an absolute path \end{Desc}
\begin{Desc}
\item[See also:]{\bf absolute\-Path()}{\rm (p.\,\pageref{classKURIFilterData_a12})} \end{Desc}


Definition at line 119 of file kurifilter.cpp.

References QString::is\-Empty().\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 141 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}


Checks whether the current data is a local resource with command line options and arguments. 

\begin{Desc}
\item[Returns:]true if the current data has command line options and arguments \end{Desc}


Definition at line 114 of file kurifilter.cpp.

References QString::is\-Empty().\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, or QString::null if not found \end{Desc}


Definition at line 146 of file kurifilter.cpp.

References QString::find\-Rev(), QString::from\-Latin1(), KMime\-Type::icon\-For\-URL(), QString::mid(), KService::service\-By\-Desktop\-Name(), and KURL::url().\index{KURIFilterData@{KURIFilter\-Data}!setCheckForExecutables@{setCheckForExecutables}}
\index{setCheckForExecutables@{setCheckForExecutables}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURIFilter\-Data::set\-Check\-For\-Executables (bool {\em check})}\label{classKURIFilterData_a17}


Check whether the provided uri is executable or not. 

Setting this to false ensures that typing the name of an executable does not start that application. This is useful in the location bar of a browser. The default value is true.

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


Definition at line 109 of file kurifilter.cpp.\index{KURIFilterData@{KURIFilter\-Data}!checkForExecutables@{checkForExecutables}}
\index{checkForExecutables@{checkForExecutables}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KURIFilter\-Data::check\-For\-Executables () const\hspace{0.3cm}{\tt  [inline]}}\label{classKURIFilterData_a18}


\begin{Desc}
\item[Returns:]true if the filters should attempt to check whether the supplied uri is an executable. False otherwise.\end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 277 of file kurifilter.h.\index{KURIFilterData@{KURIFilter\-Data}!typedString@{typedString}}
\index{typedString@{typedString}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KURIFilter\-Data::typed\-String () const}\label{classKURIFilterData_a19}


\begin{Desc}
\item[Returns:]the string as typed by the user, before any URL processing is done \end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 104 of file kurifilter.cpp.\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_a20}


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 293 of file kurifilter.h.\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_a21}


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 303 of file kurifilter.h.\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})\hspace{0.3cm}{\tt  [protected]}}\label{classKURIFilterData_b0}


Initializes the KURIFilter\-Data on construction. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]the URL to initialize the object with \end{description}
\end{Desc}


Definition at line 80 of file kurifilter.cpp.\index{KURIFilterData@{KURIFilter\-Data}!init@{init}}
\index{init@{init}!KURIFilterData@{KURIFilter\-Data}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KURIFilter\-Data::init (const {\bf QString} \& {\em url} = {\tt QString::null})\hspace{0.3cm}{\tt  [protected]}}\label{classKURIFilterData_b1}


Initializes the KURIFilter\-Data on construction. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]the URL to initialize the object with \end{description}
\end{Desc}


Definition at line 92 of file kurifilter.cpp.

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