25 #ifndef __kurifilter_h__
26 #define __kurifilter_h__
28 #include <tqptrlist.h>
30 #include <tqstringlist.h>
39 class KURIFilterPrivate;
40 class KURIFilterDataPrivate;
100 enum URITypes { NET_PROTOCOL=0, LOCAL_FILE, LOCAL_DIR, EXECUTABLE, HELP, SHELL, BLOCKED, ERROR, UNKNOWN };
157 KURL
uri()
const {
return m_pURI; }
189 void setData(
const TQString& url ) { reinit( url ); }
200 void setData(
const KURL& url ) { reinit( url ); }
216 bool setAbsolutePath(
const TQString& abs_path );
223 TQString absolutePath()
const;
230 bool hasAbsolutePath()
const;
238 TQString argsAndOptions()
const;
245 bool hasArgsAndOptions()
const;
268 TQPixmap customIconPixmap();
280 void setCheckForExecutables (
bool check);
294 TQString typedString()
const;
322 void init(
const KURL& url);
328 void init(
const TQString& url = TQString::null );
334 void reinit(
const KURL& url);
335 void reinit(
const TQString& url = TQString::null);
337 bool m_bCheckForExecutables;
340 TQString m_strErrMsg;
341 TQString m_strIconName;
345 KURIFilterDataPrivate *d;
347 TQPixmap m_customIconPixmap;
378 KURIFilterPlugin( TQObject *parent = 0,
const char *name = 0,
double pri = 1.0 );
385 virtual TQString
name()
const {
return m_strName; }
395 virtual double priority()
const {
return m_dblPriority; }
413 virtual TDECModule *
configModule( TQWidget*,
const char* )
const {
return 0; }
427 void setFilteredURI (
KURIFilterData& data,
const KURL& uri )
const;
433 data.m_strErrMsg = errmsg;
441 data.m_bChanged =
true;
448 void setArguments(
KURIFilterData& data,
const TQString& args )
const;
451 double m_dblPriority;
454 virtual void virtual_hook(
int id,
void* data );
456 class KURIFilterPluginPrivate *d;
466 virtual int compareItems(Item a, Item b)
469 return diff < 0 ? -1 : (diff > 0 ? 1 : 0);
473 KURIFilterPrivate *d;
572 bool filterURI(
KURIFilterData& data,
const TQStringList& filters = TQStringList() );
585 bool filterURI( KURL &uri,
const TQStringList& filters = TQStringList() );
598 bool filterURI( TQString &uri,
const TQStringList& filters = TQStringList() );
611 KURL filteredURI(
const KURL &uri,
const TQStringList& filters = TQStringList() );
624 TQString filteredURI(
const TQString &uri,
const TQStringList& filters = TQStringList() );
632 TQPtrListIterator<KURIFilterPlugin> pluginsIterator()
const;
640 TQStringList pluginNames()
const;
664 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.
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.
TDE_DEPRECATED bool hasBeenFiltered() const
This method has been deprecated and will always return true.
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 bool filterURI(KURIFilterData &data) const =0
Filters a URI.
virtual TDECModule * configModule(TQWidget *, const char *) const
Creates a configuration module for the filter.
virtual double priority() const
Returns the filter's priority.
virtual TQString name() const
Returns the filter's name.
Manages the filtering of URIs.