25 #ifndef __kurifilter_h__
26 #define __kurifilter_h__
28 #include <tqptrlist.h>
30 #include <tqstringlist.h>
38 class KURIFilterPrivate;
39 class KURIFilterDataPrivate;
99 enum URITypes { NET_PROTOCOL=0, LOCAL_FILE, LOCAL_DIR, EXECUTABLE, HELP, SHELL, BLOCKED, ERROR, UNKNOWN };
156 KURL
uri()
const {
return m_pURI; }
188 void setData(
const TQString& url ) { reinit( url ); }
199 void setData(
const KURL& url ) { reinit( url ); }
215 bool setAbsolutePath(
const TQString& abs_path );
222 TQString absolutePath()
const;
229 bool hasAbsolutePath()
const;
237 TQString argsAndOptions()
const;
244 bool hasArgsAndOptions()
const;
269 void setCheckForExecutables (
bool check);
283 TQString typedString()
const;
311 void init(
const KURL& url);
317 void init(
const TQString& url = TQString::null );
323 void reinit(
const KURL& url);
324 void reinit(
const TQString& url = TQString::null);
326 bool m_bCheckForExecutables;
329 TQString m_strErrMsg;
330 TQString m_strIconName;
334 KURIFilterDataPrivate *d;
365 KURIFilterPlugin( TQObject *parent = 0,
const char *name = 0,
double pri = 1.0 );
372 virtual TQString
name()
const {
return m_strName; }
382 virtual double priority()
const {
return m_dblPriority; }
400 virtual KCModule *
configModule( TQWidget*,
const char* )
const {
return 0; }
414 void setFilteredURI (
KURIFilterData& data,
const KURL& uri )
const;
420 data.m_strErrMsg = errmsg;
428 data.m_bChanged =
true;
435 void setArguments(
KURIFilterData& data,
const TQString& args )
const;
438 double m_dblPriority;
441 virtual void virtual_hook(
int id,
void* data );
443 class KURIFilterPluginPrivate *d;
453 virtual int compareItems(Item a, Item b)
456 return diff < 0 ? -1 : (diff > 0 ? 1 : 0);
460 KURIFilterPrivate *d;
559 bool filterURI(
KURIFilterData& data,
const TQStringList& filters = TQStringList() );
572 bool filterURI( KURL &uri,
const TQStringList& filters = TQStringList() );
585 bool filterURI( TQString &uri,
const TQStringList& filters = TQStringList() );
598 KURL filteredURI(
const KURL &uri,
const TQStringList& filters = TQStringList() );
611 TQString filteredURI(
const TQString &uri,
const TQStringList& filters = TQStringList() );
619 TQPtrListIterator<KURIFilterPlugin> pluginsIterator()
const;
627 TQStringList pluginNames()
const;
651 KURIFilterPrivate *d;
A basic message object used for exchanging filtering information between the filter plugins and the a...
void setData(const KURL &url)
Same as above except the argument is a URL.
KURIFilterData()
Default constructor.
URITypes uriType() const
Returns the URI type.
bool checkForExecutables() const
KURL uri() const
Returns the filtered or the original URL.
void setData(const TQString &url)
Sets the URL to be filtered.
KDE_DEPRECATED bool hasBeenFiltered() const
This method has been deprecated and will always return true.
TQString errorMsg() const
Returns an error message.
KURIFilterData(const TQString &url)
Creates a URIFilterData object from the given string.
KURIFilterData & operator=(const TQString &url)
Overloaded assigenment operator.
KURIFilterData & operator=(const KURL &url)
Overloaded assigenment operator.
URITypes
Describes the type of the URI that was filtered.
KURIFilterData(const KURL &url)
Creates a URIFilterData object from the given URL.
A list of filter plugins.
Base class for URI filter plugins.
virtual TQString configName() const
Returns the name of the configuration module for the filter.
void setErrorMsg(KURIFilterData &data, const TQString &errmsg) const
Sets the error message in data to errormsg.
void setURIType(KURIFilterData &data, KURIFilterData::URITypes type) const
Sets the URI type in data to type.
virtual KCModule * configModule(TQWidget *, const char *) const
Creates a configuration module for the filter.
virtual bool filterURI(KURIFilterData &data) const =0
Filters a URI.
virtual double priority() const
Returns the filter's priority.
virtual TQString name() const
Returns the filter's name.
Manages the filtering of URIs.