KURIFilterData Class Reference
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. More...
#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 QString &url) | |
KURIFilterData (const KURIFilterData &data) | |
~KURIFilterData () | |
KDE_DEPRECATED bool | hasBeenFiltered () const |
KURL | uri () const |
QString | errorMsg () const |
URITypes | uriType () const |
void | setData (const QString &url) |
void | setData (const KURL &url) |
bool | setAbsolutePath (const QString &abs_path) |
QString | absolutePath () const |
bool | hasAbsolutePath () const |
QString | argsAndOptions () const |
bool | hasArgsAndOptions () const |
QString | iconName () |
void | setCheckForExecutables (bool check) |
bool | checkForExecutables () const |
QString | typedString () const |
KURIFilterData & | operator= (const KURL &url) |
KURIFilterData & | operator= (const QString &url) |
Protected Member Functions | |
void | init (const KURL &url) |
void | init (const QString &url=QString::null) |
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 KURIFilter to have the plugins fill out all possible information about the URI.
Example
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;
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
- Author:
- Dawit Alemayehu <adawit at kde.org>
Definition at line 75 of file kurifilter.h.
Member Enumeration Documentation
|
Describes the type of the URI that was filtered. Here is a brief description of the types:
Definition at line 96 of file kurifilter.h. Referenced by uriType(). |
Constructor & Destructor Documentation
|
Default constructor. Creates a URIFilterData object. Definition at line 103 of file kurifilter.h. References init(). |
|
Creates a URIFilterData object from the given URL.
Definition at line 110 of file kurifilter.h. References init(). |
|
Creates a URIFilterData object from the given string.
Definition at line 117 of file kurifilter.h. References init(). |
|
Copy constructor. Creates a URIFilterData object from another URI filter data object.
Definition at line 60 of file kurifilter.cpp. References absolutePath(), argsAndOptions(), m_bChanged, m_bCheckForExecutables, m_iType, m_pURI, m_strErrMsg, m_strIconName, and typedString(). |
|
Destructor.
Definition at line 74 of file kurifilter.cpp. |
Member Function Documentation
|
This method has been deprecated and will always return true. You should instead use the result from the KURIFilter::filterURI() calls.
Definition at line 141 of file kurifilter.h. |
|
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
Definition at line 153 of file kurifilter.h. Referenced by KURIFilter::filteredURI(), KURIFilter::filterURI(), and KURIFilterPlugin::setFilteredURI(). |
|
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.
Definition at line 165 of file kurifilter.h. |
|
Returns the URI type. This method always returns KURIFilterData::UNKNOWN if the given URL was not filtered.
Definition at line 174 of file kurifilter.h. References URITypes. |
|
Sets the URL to be filtered. Use this function to set the string to be filtered when you construct an empty filter object.
Definition at line 185 of file kurifilter.h. References init(). |
|
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.
Definition at line 196 of file kurifilter.h. References init(). |
|
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 ().
Definition at line 124 of file kurifilter.cpp. References KURL::isLocalFile(), and KURL::isValid(). |
|
Returns the absolute path if one has already been set.
Definition at line 136 of file kurifilter.cpp. Referenced by KURIFilterData(). |
|
Checks whether the supplied data had an absolute path.
Definition at line 119 of file kurifilter.cpp. |
|
Returns the command line options and arguments for a local resource when present.
Definition at line 141 of file kurifilter.cpp. Referenced by KURIFilterData(). |
|
Checks whether the current data is a local resource with command line options and arguments.
Definition at line 114 of file kurifilter.cpp. |
|
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.
Definition at line 146 of file kurifilter.cpp. References KMimeType::iconForURL(), KGlobal::iconLoader(), KIconLoader::loadIcon(), KService::serviceByDesktopName(), and KURL::url(). |
|
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.
Definition at line 109 of file kurifilter.cpp. |
|
Definition at line 274 of file kurifilter.h. |
|
Definition at line 104 of file kurifilter.cpp. Referenced by KURIFilterData(). |
|
Overloaded assigenment operator. This function allows you to easily assign a KURL to a KURIFilterData object.
Definition at line 290 of file kurifilter.h. References init(). |
|
Overloaded assigenment operator. This function allows you to easily assign a QString to a KURIFilterData object.
Definition at line 300 of file kurifilter.h. References init(). |
|
Initializes the KURIFilterData on construction.
Definition at line 80 of file kurifilter.cpp. Referenced by KURIFilterData(), operator=(), and setData(). |
|
Initializes the KURIFilterData on construction.
Definition at line 92 of file kurifilter.cpp. |
The documentation for this class was generated from the following files: