• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
KURIFilterData Class Reference

#include <kurifilter.h>

Public Types

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

Public Member Functions

 KURIFilterData ()
 
 KURIFilterData (const KURL &url)
 
 KURIFilterData (const TQString &url)
 
 KURIFilterData (const KURIFilterData &data)
 
 ~KURIFilterData ()
 
TDE_DEPRECATED bool hasBeenFiltered () const
 
KURL uri () const
 
TQString errorMsg () const
 
URITypes uriType () const
 
void setData (const TQString &url)
 
void setData (const KURL &url)
 
bool setAbsolutePath (const TQString &abs_path)
 
TQString absolutePath () const
 
bool hasAbsolutePath () const
 
TQString argsAndOptions () const
 
bool hasArgsAndOptions () const
 
TQString iconName ()
 
TQPixmap customIconPixmap ()
 
void setCheckForExecutables (bool check)
 
bool checkForExecutables () const
 
TQString typedString () const
 
KURIFilterData & operator= (const KURL &url)
 
KURIFilterData & operator= (const TQString &url)
 

Protected Member Functions

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

Friends

class KURIFilterPlugin
 

Detailed Description

A basic message object used for exchanging filtering information between the filter plugins and the application requesting the filtering service.

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 KURIFilter to have the plugins fill out all possible information about the URI.

Example

TQString 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;
KURIFilterData
A basic message object used for exchanging filtering information between the filter plugins and the a...
Definition: kurifilter.h:80
KURIFilterData::uriType
URITypes uriType() const
Returns the URI type.
Definition: kurifilter.h:178
KURIFilterData::uri
KURL uri() const
Returns the filtered or the original URL.
Definition: kurifilter.h:157
KURIFilter::self
static KURIFilter * self()
Returns an instance of KURIFilter.
Definition: kurifilter.cpp:328

The above code should yield the following output:

URI: kde.org
Filtered URI: http://kde.org
URI Type: 0 <== means NET_PROTOCOL
Was Filtered: 1 <== means the URL was successfully filtered

A message object for exchanging filtering URI info.

Author
Dawit Alemayehu <adawit at kde.org>

Definition at line 79 of file kurifilter.h.

Member Enumeration Documentation

◆ URITypes

enum KURIFilterData::URITypes

Describes the type of the URI that was filtered.

Here is a brief description of the types:

  • NET_PROTOCOL - Any network protocol: http, ftp, nttp, pop3, etc...
  • LOCAL_FILE - A local file whose executable flag is not set
  • LOCAL_DIR - A local directory
  • EXECUTABLE - A local file whose executable flag is set
  • HELP - A man or info page
  • SHELL - A shell executable (ex: echo "Test..." >> ~/testfile)
  • BLOCKED - A URI that should be blocked/filtered (ex: ad filtering)
  • ERROR - An incorrect URI (ex: "~johndoe" when user johndoe does not exist in that system )
  • UNKNOWN - A URI that is not identified. Default value when a KURIFilterData is first created.

Definition at line 100 of file kurifilter.h.

Constructor & Destructor Documentation

◆ KURIFilterData() [1/4]

KURIFilterData::KURIFilterData ( )
inline

Default constructor.

Creates a URIFilterData object.

Definition at line 107 of file kurifilter.h.

◆ KURIFilterData() [2/4]

KURIFilterData::KURIFilterData ( const KURL &  url)
inline

Creates a URIFilterData object from the given URL.

Parameters
urlis the URL to be filtered.

Definition at line 114 of file kurifilter.h.

◆ KURIFilterData() [3/4]

KURIFilterData::KURIFilterData ( const TQString &  url)
inline

Creates a URIFilterData object from the given string.

Parameters
urlis the string to be filtered.

Definition at line 121 of file kurifilter.h.

◆ KURIFilterData() [4/4]

KURIFilterData::KURIFilterData ( const KURIFilterData &  data)

Copy constructor.

Creates a URIFilterData object from another URI filter data object.

Parameters
datathe uri filter data to be copied.

Definition at line 65 of file kurifilter.cpp.

◆ ~KURIFilterData()

KURIFilterData::~KURIFilterData ( )

Destructor.

Definition at line 79 of file kurifilter.cpp.

Member Function Documentation

◆ absolutePath()

TQString KURIFilterData::absolutePath ( ) const

Returns the absolute path if one has already been set.

Returns
the absolute path, or TQString::null
See also
hasAbsolutePath()

Definition at line 153 of file kurifilter.cpp.

◆ argsAndOptions()

TQString KURIFilterData::argsAndOptions ( ) const

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

Returns
options and arguments when present, otherwise TQString::null

Definition at line 158 of file kurifilter.cpp.

◆ checkForExecutables()

bool KURIFilterData::checkForExecutables ( ) const
inline
Returns
true if the filters should attempt to check whether the supplied uri is an executable. False otherwise.
Since
3.2

Definition at line 288 of file kurifilter.h.

◆ customIconPixmap()

TQPixmap KURIFilterData::customIconPixmap ( )

Returns the current custom icon The results are valid iff iconName() has returned TQString::null.

Returns
a pixmap with the current custom icon, or a null pixmap if no icon is available

Definition at line 313 of file kurifilter.cpp.

◆ errorMsg()

TQString KURIFilterData::errorMsg ( ) const
inline

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 TQString::null.

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

Definition at line 169 of file kurifilter.h.

◆ hasAbsolutePath()

bool KURIFilterData::hasAbsolutePath ( ) const

Checks whether the supplied data had an absolute path.

Returns
true if the supplied data has an absolute path
See also
absolutePath()

Definition at line 136 of file kurifilter.cpp.

◆ hasArgsAndOptions()

bool KURIFilterData::hasArgsAndOptions ( ) const

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

Returns
true if the current data has command line options and arguments

Definition at line 131 of file kurifilter.cpp.

◆ hasBeenFiltered()

TDE_DEPRECATED bool KURIFilterData::hasBeenFiltered ( ) const
inline

This method has been deprecated and will always return true.

You should instead use the result from the KURIFilter::filterURI() calls.

Deprecated:

Definition at line 145 of file kurifilter.h.

◆ iconName()

TQString KURIFilterData::iconName ( )

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.

Returns
the name of the icon associated with the resource, or TQString::null if not found

Definition at line 163 of file kurifilter.cpp.

◆ init() [1/2]

void KURIFilterData::init ( const KURL &  url)
protected

Initializes the KURIFilterData on construction.

Parameters
urlthe URL to initialize the object with

Definition at line 85 of file kurifilter.cpp.

◆ init() [2/2]

void KURIFilterData::init ( const TQString &  url = TQString::null)
protected

Initializes the KURIFilterData on construction.

Parameters
urlthe URL to initialize the object with

Definition at line 97 of file kurifilter.cpp.

◆ operator=() [1/2]

KURIFilterData& KURIFilterData::operator= ( const KURL &  url)
inline

Overloaded assigenment operator.

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

Returns
an instance of a KURIFilterData object.

Definition at line 304 of file kurifilter.h.

◆ operator=() [2/2]

KURIFilterData& KURIFilterData::operator= ( const TQString &  url)
inline

Overloaded assigenment operator.

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

Returns
an instance of a KURIFilterData object.

Definition at line 314 of file kurifilter.h.

◆ setAbsolutePath()

bool KURIFilterData::setAbsolutePath ( const TQString &  abs_path)

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 "file:/" 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 KURL, make sure you set the argument for this function to the result of calling path () instead of url ().

Parameters
abs_paththe abolute path to the local resource.
Returns
true if absolute path is successfully set. Otherwise, false.

Definition at line 141 of file kurifilter.cpp.

◆ setCheckForExecutables()

void KURIFilterData::setCheckForExecutables ( bool  check)

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.

Since
3.2

Definition at line 126 of file kurifilter.cpp.

◆ setData() [1/2]

void KURIFilterData::setData ( const KURL &  url)
inline

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.

Parameters
urlthe URL to be filtered.

Definition at line 200 of file kurifilter.h.

◆ setData() [2/2]

void KURIFilterData::setData ( const TQString &  url)
inline

Sets the URL to be filtered.

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

Parameters
urlthe string to be filtered.

Definition at line 189 of file kurifilter.h.

◆ typedString()

TQString KURIFilterData::typedString ( ) const
Returns
the string as typed by the user, before any URL processing is done
Since
3.2

Definition at line 121 of file kurifilter.cpp.

◆ uri()

KURL KURIFilterData::uri ( ) const
inline

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

Returns
the filtered or original url.

Definition at line 157 of file kurifilter.h.

◆ uriType()

URITypes KURIFilterData::uriType ( ) const
inline

Returns the URI type.

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

Returns
the type of the URI

Definition at line 178 of file kurifilter.h.


The documentation for this class was generated from the following files:
  • kurifilter.h
  • kurifilter.cpp

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.