class KURIFilterData

A message object for exchanging filtering URI info. More...

Definition#include <kurifilter.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Protected Methods


Detailed Description

This is a basic message object used for exchanging filtering info between the filter plugins and the application whenever the application requires more information about the URI than just a filtered version of it. Any application can create an instance of this class and send it to KURIFilter to have the filter plugins fill the necessary information.

Example


   QString text = "kde.org";
   KURIFilterData d = text;
   bool filtered = KURIFilter::self()->filter( d );
   if( filtered )
     print ( "URI : %s\n"Filtered URI : %s\n URI Type : %i\n"Was Filtered :%i"
             text.latin1(), d.uri().url().latin1(), d.uriType(), d.hasBeenFiltered() );

The above code should give the following result:


   kde.org
   http://kde.org
   0 <== which would be NET_PROTOCOL
   1 <== which means the url has been filtered

enum URITypes {NET_PROTOCOL=0, LOCAL_FILE, LOCAL_DIR, EXECUTABLE, HELP, SHELL, BLOCKED, ERROR, UNKNOWN }

Describes the type of URI to be filtered.

This enumerator prvoides the return value for uriType. A breif description for each value:

 KURIFilterData ()

Default constructor.

Creates a URIFilterData object.

 KURIFilterData ( const KURL& url )

Creates a URIFilterData object from the given URL.

Parameters:
urlis the URL to be filtered.

 KURIFilterData ( const QString& url )

Creates a URIFilterData object from the given string.

Parameters:
urlis the string to be filtered.

 KURIFilterData ( const KURIFilterData& )

Copy constructor.

Creates a URIFilterData object from another URI filter data object.

Parameters:
datathe uri filter data to be copied.

KURIFilterData ()

Destructor.

bool  hasBeenFiltered ()

[const]

Returns true if the URI has been filtered.

This function returns true whenever one of the URI filters plug-ins sucessfully filters the given URL. Use this function to check whether a URL has been filtered or not.

Returns: true if the URL has been filtered.

KURL  uri ()

[const]

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 hasBeenFiltered and

Returns: the filtered or original url.

QString  errorMsg ()

[const]

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.

Returns: the error message or a NULL when there is none.

URITypes  uriType ()

[const]

Returns the URI type.

This method always returns KURIFilterData::UNKNOWN if the given URL was not filtered.

KURIFilterData&  operator= ( const KURL& url )

Overloaded assigenment operator.

This function allows you to easily assign a KURL to a KURIFilterData object.

Returns: an instance of a KURIFilterData object.

KURIFilterData&  operator= ( const QString& url )

Overloaded assigenment operator.

This function allows you to easily assign a QString to a KURIFilterData object.

Returns: an instance of a KURIFilterData object.

void  init ( const KURL& url = QString::null )

[protected]

Initializes the KURIFilterData on construction.


Generated by: root@porky.devel.redhat.com on Wed May 10 08:56:52 2000, using kdoc 2.0a35.