.TH "KURIFilterData" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
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.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurifilter.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBURITypes\fP { \fBNET_PROTOCOL\fP = 0, \fBLOCAL_FILE\fP, \fBLOCAL_DIR\fP, \fBEXECUTABLE\fP, \fBHELP\fP, \fBSHELL\fP, \fBBLOCKED\fP, \fBERROR\fP, \fBUNKNOWN\fP }"
.br
.RI "\fIDescribes the type of URI to be filtered. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURIFilterData\fP ()"
.br
.RI "\fIDefault constructor. \fP"
.ti -1c
.RI "\fBKURIFilterData\fP (const  \fBKURL\fP &url)"
.br
.RI "\fICreates a URIFilterData object from the given URL. \fP"
.ti -1c
.RI "\fBKURIFilterData\fP (const  \fBQString\fP &url)"
.br
.RI "\fICreates a URIFilterData object from the given string. \fP"
.ti -1c
.RI "\fBKURIFilterData\fP (const  \fBKURIFilterData\fP &)"
.br
.RI "\fICopy constructor. \fP"
.ti -1c
.RI "\fB~KURIFilterData\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "bool \fBhasBeenFiltered\fP () const "
.br
.RI "\fIThis method has been deprecated and will always return TRUE. \fP"
.ti -1c
.RI "\fBKURL\fP \fBuri\fP () const "
.br
.RI "\fIReturns the filtered or the original URL. \fP"
.ti -1c
.RI "\fBQString\fP \fBerrorMsg\fP () const "
.br
.RI "\fIReturns an error message. \fP"
.ti -1c
.RI "\fBURITypes\fP \fBuriType\fP () const "
.br
.RI "\fIReturns the URI type. \fP"
.ti -1c
.RI "void \fBsetData\fP (const  \fBQString\fP &url)"
.br
.RI "\fISets the URL to be filtered. \fP"
.ti -1c
.RI "void \fBsetData\fP (const  \fBKURL\fP &url)"
.br
.RI "\fISame as above except the argument is a URL. \fP"
.ti -1c
.RI "bool \fBsetAbsolutePath\fP (const  \fBQString\fP &)"
.br
.RI "\fISets the absolute path to be used whenever the supplied data is a relative local URL. \fP"
.ti -1c
.RI "\fBQString\fP \fBabsolutePath\fP () const "
.br
.RI "\fIReturns the absolute path if one has already been set. \fP"
.ti -1c
.RI "bool \fBhasAbsolutePath\fP () const "
.br
.RI "\fIReturns true if the supplied data has an absolute path. \fP"
.ti -1c
.RI "\fBQString\fP \fBargsAndOptions\fP () const "
.br
.RI "\fIReturns the command line options and arguments for a local resource when present. \fP"
.ti -1c
.RI "bool \fBhasArgsAndOptions\fP () const "
.br
.RI "\fIReturns true if the current data is a local resource with command line options and arguments. \fP"
.ti -1c
.RI "\fBQString\fP \fBiconName\fP ()"
.br
.RI "\fIReturns the name of the icon that matches the current filtered URL. \fP"
.ti -1c
.RI "\fBKURIFilterData\fP & \fBoperator=\fP (const  \fBKURL\fP &url)"
.br
.RI "\fIOverloaded assigenment operator. \fP"
.ti -1c
.RI "\fBKURIFilterData\fP & \fBoperator=\fP (const  \fBQString\fP &url)"
.br
.RI "\fIOverloaded assigenment operator. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBinit\fP (const  \fBKURL\fP &url=QString::null)"
.br
.RI "\fIInitializes the KURIFilterData on construction. \fP"
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKURIFilterPlugin\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
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 \fBKURIFilter\fP to have the filter plugins fill the necessary information.
.PP
\fB Example 
.PP
.nf

   \fBQString\fP text = 'kde.org';
   KURIFilterData d = text;
   bool filtered = \fBKURIFilter::self()\fP->filter( d );
   if( filtered )
     print ( 'URI: %s\\n'Filtered URI: s
.br
 URI Type: i
.br
'Was Filtered: %i'
             text.latin1(), d.uri().url().latin1(), d.uriType(), filtered );
 
.PP
\fP
.PP
\fB The above code should yield the following output: 
.PP
.nf

   URI: kde.org
   Filtered URI: http://kde.org
   URI Type: 0            <== means NET_PROTOCOL
   Was Filtered: 1        <== means the URL was successfully filtered
 
.PP
\fP
.PP
\fB\fP
.PP
\fB \fP
.PP
Definition at line 64 of file kurifilter.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKURIFilterData::URITypes\fP"
.PP
Describes the type of URI to be filtered. This enumerator prvoides the return value for \fBuriType\fP. A brief description for each value:
.PP
.IP "\(bu" 2
NET_PROTOCOL - Any network protocol: http, ftp, nttp, pop3, etc... 
.IP "\(bu" 2
LOCAL_FILE - A local file whose executable flag is not set 
.IP "\(bu" 2
LOCAL_DIR - A local directory 
.IP "\(bu" 2
EXECUTABLE - A local file whose executable flag is set 
.IP "\(bu" 2
HELP - A man or info page 
.IP "\(bu" 2
SHELL - A shell executable (ex: echo 'Test...' >> ~/testfile) 
.IP "\(bu" 2
BLOCKED - A URI that should be blocked/filtered (ex: ad filtering) 
.IP "\(bu" 2
ERROR - An incorrect URI (ex: '~johndoe' when user johndoe does not exist in that system ) 
.IP "\(bu" 2
UNKNOWN - A URI that is not identified. Default value when a KURIFilterData is first created. 
.PP
Definition at line 87 of file kurifilter.h.
.PP
Referenced by uriType().
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURIFilterData::KURIFilterData ()\fC [inline]\fP"
.PP
Default constructor. Creates a URIFilterData object. Definition at line 94 of file kurifilter.h.
.PP
References init().
.SS "KURIFilterData::KURIFilterData (const \fBKURL\fP & url)\fC [inline]\fP"
.PP
Creates a URIFilterData object from the given URL. \fBParameters:\fP
.RS 4
\fIurl\fP is the URL to be filtered. 
.RE
.PP
Definition at line 101 of file kurifilter.h.
.PP
References init().
.SS "KURIFilterData::KURIFilterData (const \fBQString\fP & url)\fC [inline]\fP"
.PP
Creates a URIFilterData object from the given string. \fBParameters:\fP
.RS 4
\fIurl\fP is the string to be filtered. 
.RE
.PP
Definition at line 108 of file kurifilter.h.
.PP
References init().
.SS "KURIFilterData::KURIFilterData (const \fBKURIFilterData\fP &)"
.PP
Copy constructor. Creates a URIFilterData object from another URI filter data object.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP the uri filter data to be copied. 
.RE
.PP
Definition at line 58 of file kurifilter.cpp.
.PP
References absolutePath(), m_bChanged, m_iType, m_pURI, m_strErrMsg, and m_strIconName.
.SS "KURIFilterData::~\fBKURIFilterData\fP ()"
.PP
Destructor. Definition at line 69 of file kurifilter.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KURIFilterData::hasBeenFiltered () const\fC [inline]\fP"
.PP
This method has been deprecated and will always return TRUE. You should instead use the result from the \fBKURIFilter::filterURI\fP() calls.
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Definition at line 132 of file kurifilter.h.
.SS "\fBKURL\fP KURIFilterData::uri () const\fC [inline]\fP"
.PP
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 \fBhasBeenFiltered\fP() and
.PP
\fBReturns:\fP
.RS 4
the filtered or original url. 
.RE
.PP
Definition at line 144 of file kurifilter.h.
.PP
Referenced by KURIFilter::filteredURI(), KURIFilter::filterURI(), and KURIFilterPlugin::setFilteredURI().
.SS "\fBQString\fP KURIFilterData::errorMsg () const\fC [inline]\fP"
.PP
Returns an error message. This functions returns the error message set by the plugin whenever the uri type is set to KURIFilterData::ERROR. Otherwise, it returns a QString::null.
.PP
\fBReturns:\fP
.RS 4
the error message or a NULL when there is none. 
.RE
.PP
Definition at line 156 of file kurifilter.h.
.SS "\fBURITypes\fP KURIFilterData::uriType () const\fC [inline]\fP"
.PP
Returns the URI type. This method always returns KURIFilterData::UNKNOWN if the given URL was not filtered. Definition at line 164 of file kurifilter.h.
.PP
References URITypes.
.SS "void KURIFilterData::setData (const \fBQString\fP & url)\fC [inline]\fP"
.PP
Sets the URL to be filtered. Use this function to set the string to be filtered when you construct an empty filter object.
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP the string to be filtered. 
.RE
.PP
Definition at line 175 of file kurifilter.h.
.PP
References init().
.SS "void KURIFilterData::setData (const \fBKURL\fP & url)\fC [inline]\fP"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP the URL to be filtered. 
.RE
.PP
Definition at line 186 of file kurifilter.h.
.PP
References init().
.SS "bool KURIFilterData::setAbsolutePath (const \fBQString\fP &)"
.PP
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 \fBKURL\fP object, make sure you always set the argument below using \fBKURL::path()\fP instead of \fBKURL::url()\fP so that 'file:/' would not be appended! Otherwise, the filter might not be able to make correct determination whether the relative URL locally exists!
.PP
\fBParameters:\fP
.RS 4
\fIabs_path\fP the abolute path to the local resource. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if absolute path is successfully set. Otherwise, false. 
.RE
.PP
Definition at line 96 of file kurifilter.cpp.
.PP
References KURL::isLocalFile(), and KURL::isMalformed().
.SS "\fBQString\fP KURIFilterData::absolutePath () const"
.PP
Returns the absolute path if one has already been set. Definition at line 108 of file kurifilter.cpp.
.PP
Referenced by KURIFilterData().
.SS "bool KURIFilterData::hasAbsolutePath () const"
.PP
Returns true if the supplied data has an absolute path. Definition at line 91 of file kurifilter.cpp.
.SS "\fBQString\fP KURIFilterData::argsAndOptions () const"
.PP
Returns the command line options and arguments for a local resource when present. \fBReturns:\fP
.RS 4
options and arguments when present, otherwise QString::null 
.RE
.PP
Definition at line 113 of file kurifilter.cpp.
.SS "bool KURIFilterData::hasArgsAndOptions () const"
.PP
Returns true if the current data is a local resource with command line options and arguments. Definition at line 86 of file kurifilter.cpp.
.SS "\fBQString\fP KURIFilterData::iconName ()"
.PP
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.
.PP
\fBReturns:\fP
.RS 4
the name of the icon associated with the resource 
.RE
.PP
Definition at line 118 of file kurifilter.cpp.
.PP
References QString::fromLatin1(), KMimeType::iconForURL(), KService::serviceByDesktopName(), and KURL::url().
.SS "\fBKURIFilterData\fP& KURIFilterData::operator= (const \fBKURL\fP & url)\fC [inline]\fP"
.PP
Overloaded assigenment operator. This function allows you to easily assign a \fBKURL\fP to a KURIFilterData object.
.PP
\fBReturns:\fP
.RS 4
an instance of a KURIFilterData object. 
.RE
.PP
Definition at line 250 of file kurifilter.h.
.PP
References init().
.SS "\fBKURIFilterData\fP& KURIFilterData::operator= (const \fBQString\fP & url)\fC [inline]\fP"
.PP
Overloaded assigenment operator. This function allows you to easily assign a \fBQString\fP to a KURIFilterData object.
.PP
\fBReturns:\fP
.RS 4
an instance of a KURIFilterData object. 
.RE
.PP
Definition at line 260 of file kurifilter.h.
.PP
References init().
.SS "void KURIFilterData::init (const \fBKURL\fP & url = QString::null)\fC [protected]\fP"
.PP
Initializes the KURIFilterData on construction. Definition at line 75 of file kurifilter.cpp.
.PP
Referenced by KURIFilterData(), operator=(), and setData().

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
