.TH "KURIFilter" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURIFilter \- Manages the filtering of a URI. Filters a given URL into its proper format whenever possible.  

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

.in +1c
.ti -1c
.RI "\fB~KURIFilter\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "bool \fBfilterURI\fP (\fBKURIFilterData\fP &data, const  \fBQStringList\fP &filters=\fBQStringList\fP())"
.br
.RI "\fIFilters the URI given by the object URIFilterData. \fP"
.ti -1c
.RI "bool \fBfilterURI\fP (\fBKURL\fP &uri, const  \fBQStringList\fP &filters=\fBQStringList\fP())"
.br
.RI "\fIFilters the URI given by the URL. \fP"
.ti -1c
.RI "bool \fBfilterURI\fP (\fBQString\fP &uri, const  \fBQStringList\fP &filters=\fBQStringList\fP())"
.br
.RI "\fIFilters a string representing a URI. \fP"
.ti -1c
.RI "\fBKURL\fP \fBfilteredURI\fP (const  \fBKURL\fP &uri, const  \fBQStringList\fP &filters=\fBQStringList\fP())"
.br
.RI "\fIReturns the filtered URI. \fP"
.ti -1c
.RI "\fBQString\fP \fBfilteredURI\fP (const  \fBQString\fP &uri, const  \fBQStringList\fP &filters=\fBQStringList\fP())"
.br
.RI "\fIReturn a filtered string representation of a URI. \fP"
.ti -1c
.RI "\fBQPtrListIterator\fP< \fBKURIFilterPlugin\fP > \fBpluginsIterator\fP () const "
.br
.RI "\fIReturn an iterator to iterate over all loaded plugins. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBpluginNames\fP () const "
.br
.RI "\fIReturn a list of the names of all loaded plugins. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURIFilter\fP * \fBself\fP ()"
.br
.RI "\fIReturn a static instance of KURIFilter. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKURIFilter\fP ()"
.br
.RI "\fIA protected constructor. \fP"
.ti -1c
.RI "void \fBloadPlugins\fP ()"
.br
.RI "\fILoads all allowed plugins. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Manages the filtering of a URI. Filters a given URL into its proper format whenever possible. 

The intention of this plugin class is to allow people to extend the functionality of \fBKURL\fP without modifying it directly. This way \fBKURL\fP will remain a generic parser capable of parsing any generic URL that adheres to specifications.
.PP
The KURIFilter class applies a number of filters to a URI, and returns the filtered version whenever possible. The filters are implemented using plugins to provide easy extensibility of the filtering mechanism. That is, new filters can be added in the future by simply inheriting from \fBKURIFilterPlugin\fP and implementing the \fBKURIFilterPlugin::filterURI\fP method.
.PP
Use of this plugin-manager class is straight forward. Since it is a singleton object, all you have to do is obtain an instance by doing \fC\fBKURIFilter::self()\fP\fP and use any of the public member functions to preform the filtering.
.PP
\fB Example\fP
.PP
\fB To simply filter a given string: 
.PP
.nf

 bool filtered = \fBKURIFilter::self()\fP->filterURI( 'kde.org' );
 
.PP
\fP
.PP
\fB You can alternatively use a \fBKURL\fP: 
.PP
.nf

 \fBKURL\fP url = 'kde.org';
 bool filtered = \fBKURIFilter::self()\fP->filterURI( url );
 
.PP
\fP
.PP
\fB If you have a constant string or a constant URL, simply invoke the corresponding function to obtain the filtered string or URL instead of a boolean flag: 
.PP
.nf

 \fBQString\fP u = \fBKURIFilter::self()\fP->filteredURI( 'kde.org' );
 
.PP
\fP
.PP
\fB You can also specify only specific filter(s) to be applied by supplying the name(s) of the filter(s). By defualt all filters that are found are loaded when the KURIFilter object is created will be used. These names are taken from the enteries in the \\'.desktop\\' files. Here are a couple of examples: 
.PP
.nf

 \fBQString\fP text = 'kde.org';
 bool filtered = \fBKURIFilter::self()\fP->filterURI( text, 'KShortURIFilter' );
.PP
\fP
.PP
\fB
.PP
.nf
 \fBQStringList\fP list;
 list << 'KShortURIFilter' << 'MyFilter';
 bool filtered = \fBKURIFilter::self()\fP->filterURI( text, list );
 
.PP
\fP
.PP
\fB KURIFilter also allows richer data exchange through a simple meta-object called \fC\fBKURIFilterData\fP\fP. Using this meta-object you can find out more information about the URL you want to filter. See \fBKURIFilterData\fP for examples and details.\fP
.PP
\fB\fP
.PP
\fB \fP
.PP
Definition at line 469 of file kurifilter.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURIFilter::~\fBKURIFilter\fP ()"
.PP
Destructor. Definition at line 188 of file kurifilter.cpp.
.SS "KURIFilter::KURIFilter ()\fC [protected]\fP"
.PP
A protected constructor. This constructor creates a KURIFilter and initializes all plugins it can find by invoking \fBloadPlugins\fP. Definition at line 182 of file kurifilter.cpp.
.PP
References loadPlugins().
.SH "Member Function Documentation"
.PP 
.SS "\fBKURIFilter\fP * KURIFilter::self ()\fC [static]\fP"
.PP
Return a static instance of KURIFilter. Definition at line 175 of file kurifilter.cpp.
.SS "bool KURIFilter::filterURI (\fBKURIFilterData\fP & data, const \fBQStringList\fP & filters = \fBQStringList\fP())"
.PP
Filters the URI given by the object URIFilterData. This filters the given data based on the specified filter list. If the list is empty all avaliable filter plugins would be used. If not, only those given in the list are used.
.PP
\fBParameters:\fP
.RS 4
\fIdata\fP object that contains the URI to be filtered. 
.br
\fIfilters\fP specify the list filters to be used
.RE
.PP
\fBReturns:\fP
.RS 4
a boolean indicating whether the URI has been changed 
.RE
.PP
Definition at line 193 of file kurifilter.cpp.
.PP
References QPtrListIterator::current().
.PP
Referenced by filteredURI(), and filterURI().
.SS "bool KURIFilter::filterURI (\fBKURL\fP & uri, const \fBQStringList\fP & filters = \fBQStringList\fP())"
.PP
Filters the URI given by the URL. This filters the given URL based on the specified filter list. If the list is empty all avaliable filter plugins would be used. If not, only those given in the list are used.
.PP
\fBParameters:\fP
.RS 4
\fIuri\fP the URI to filter. 
.br
\fIfilters\fP specify the list of filters to be used
.RE
.PP
\fBReturns:\fP
.RS 4
a boolean indicating whether the URI has been changed 
.RE
.PP
Definition at line 232 of file kurifilter.cpp.
.PP
References filterURI(), and KURIFilterData::uri().
.SS "bool KURIFilter::filterURI (\fBQString\fP & uri, const \fBQStringList\fP & filters = \fBQStringList\fP())"
.PP
Filters a string representing a URI. This filters the given string based on the specified filter list. If the list is empty all avaliable filter plugins would be used. If not, only those given in the list are used.
.PP
\fBParameters:\fP
.RS 4
\fIuri\fP The URI to filter. 
.br
\fIfilters\fP specify the list filters to be used
.RE
.PP
\fBReturns:\fP
.RS 4
a boolean indicating whether the URI has been changed 
.RE
.PP
Definition at line 240 of file kurifilter.cpp.
.PP
References filterURI(), KURIFilterData::uri(), and KURL::url().
.SS "\fBKURL\fP KURIFilter::filteredURI (const \fBKURL\fP & uri, const \fBQStringList\fP & filters = \fBQStringList\fP())"
.PP
Returns the filtered URI. This filters the given URL based on the specified filter list. If the list is empty all avaliable filter plugins would be used. If not, only those given in the list are used.
.PP
\fBParameters:\fP
.RS 4
\fIuri\fP The URI to filter. 
.br
\fIfilters\fP specify the list filters to be used
.RE
.PP
\fBReturns:\fP
.RS 4
the filtered URI or null if it cannot be filtered 
.RE
.PP
Definition at line 249 of file kurifilter.cpp.
.PP
References filterURI(), and KURIFilterData::uri().
.SS "\fBQString\fP KURIFilter::filteredURI (const \fBQString\fP & uri, const \fBQStringList\fP & filters = \fBQStringList\fP())"
.PP
Return a filtered string representation of a URI. This filters the given URL based on the specified filter list. If the list is empty all avaliable filter plugins would be used. If not, only those given in the list are used.
.PP
\fBParameters:\fP
.RS 4
\fIuri\fP the URI to filter. 
.br
\fIfilters\fP specify the list filters to be used
.RE
.PP
\fBReturns:\fP
.RS 4
the filtered URI or null if it cannot be filtered 
.RE
.PP
Definition at line 256 of file kurifilter.cpp.
.PP
References filterURI(), KURIFilterData::uri(), and KURL::url().
.SS "\fBQPtrListIterator\fP< \fBKURIFilterPlugin\fP > KURIFilter::pluginsIterator () const"
.PP
Return an iterator to iterate over all loaded plugins. \fBReturns:\fP
.RS 4
a plugin iterator. 
.RE
.PP
Definition at line 263 of file kurifilter.cpp.
.PP
Referenced by pluginNames().
.SS "\fBQStringList\fP KURIFilter::pluginNames () const"
.PP
Return a list of the names of all loaded plugins. \fBSince:\fP
.RS 4
3.1
.RE
.PP
\fBReturns:\fP
.RS 4
a \fBQStringList\fP of plugin names 
.RE
.PP
Definition at line 268 of file kurifilter.cpp.
.PP
References pluginsIterator().
.SS "void KURIFilter::loadPlugins ()\fC [protected]\fP"
.PP
Loads all allowed plugins. This function loads all filters that have not been dis Definition at line 276 of file kurifilter.cpp.
.PP
References QValueList::begin(), QValueList::end(), KStdAccel::end(), KTrader::OfferList, KTrader::query(), and KTrader::self().
.PP
Referenced by KURIFilter().

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