• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

kurifilter.h

Go to the documentation of this file.
00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (C) 2000-2001,2003 Dawit Alemayehu <adawit at kde.org>
00004  *
00005  *  Original author
00006  *  Copyright (C) 2000 Yves Arrouye <yves@realnames.com>
00007  *
00008  *
00009  *  This library is free software; you can redistribute it and/or
00010  *  modify it under the terms of the GNU Library General Public
00011  *  License as published by the Free Software Foundation; either
00012  *  version 2 of the License, or (at your option) any later version.
00013  *
00014  *  This library is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  *  Library General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU Library General Public License
00020  *  along with this library; see the file COPYING.LIB.  If not, write to
00021  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00022  *  Boston, MA 02110-1301, USA.
00023  **/
00024 
00025 #ifndef KURIFILTER_H
00026 #define KURIFILTER_H
00027 
00028 #include <kio/kio_export.h>
00029 #include <QtCore/QObject>
00030 #include <QtCore/QStringList>
00031 
00032 #include <kurl.h>
00033 
00034 #ifdef Q_OS_WIN
00035 #undef ERROR
00036 #endif
00037 
00038 class KUriFilterDataPrivate;
00039 
00040 class KCModule;
00041 
00077 class KIO_EXPORT KUriFilterData
00078 {
00079 friend class KUriFilterPlugin;
00080 
00081 public:
00098     enum UriTypes { NetProtocol=0, LocalFile, LocalDir, Executable, Help, Shell, Blocked, Error, Unknown };
00099 
00105     KUriFilterData();
00106 
00112     explicit KUriFilterData( const KUrl& url );
00113 
00119     explicit KUriFilterData( const QString& url );
00120 
00129     KUriFilterData( const KUriFilterData& data );
00130 
00134     ~KUriFilterData();
00135 
00136 
00147     KUrl uri() const;
00148 
00159     QString errorMsg() const;
00160 
00168     UriTypes uriType() const;
00169 
00179     void setData( const KUrl& url );
00180 
00190     void setData( const QString& url );
00191 
00206     bool setAbsolutePath( const QString& abs_path );
00207 
00213     QString absolutePath() const;
00214 
00220     bool hasAbsolutePath() const;
00221 
00228     QString argsAndOptions() const;
00229 
00235     bool hasArgsAndOptions() const;
00236 
00248     QString iconName();
00249 
00258     void setCheckForExecutables (bool check);
00259 
00264     bool checkForExecutables() const;
00265 
00269     QString typedString() const;
00270 
00279     KUriFilterData& operator=( const KUrl& url );
00280 
00289     KUriFilterData& operator=( const QString& url );
00290 
00291 private:
00292     KUriFilterDataPrivate * const d;
00293 };
00294 
00295 
00308 class KIO_EXPORT KUriFilterPlugin : public QObject
00309 {
00310     Q_OBJECT
00311 
00312 public:
00313 
00320     explicit KUriFilterPlugin( const QString &name, QObject *parent = 0 );
00321 
00328     virtual bool filterUri( KUriFilterData& data ) const = 0;
00329 
00338     virtual KCModule *configModule( QWidget*, const char* ) const;
00339 
00345     virtual QString configName() const;
00346 
00347 protected:
00348 
00352     void setFilteredUri ( KUriFilterData& data, const KUrl& uri ) const;
00353 
00357     void setErrorMsg ( KUriFilterData& data, const QString& errmsg ) const;
00358 
00362     void setUriType ( KUriFilterData& data, KUriFilterData::UriTypes type) const;
00363 
00368     void setArguments( KUriFilterData& data, const QString& args ) const;
00369 
00370 private:
00371     class KUriFilterPluginPrivate * const d;
00372 };
00373 
00374 
00375 class KUriFilterPrivate;
00447 class KIO_EXPORT KUriFilter
00448 {
00449 public:
00453     ~KUriFilter ();
00454 
00458     static KUriFilter* self();
00459 
00471     bool filterUri( KUriFilterData& data, const QStringList& filters = QStringList() );
00472 
00484     bool filterUri( KUrl &uri, const QStringList& filters = QStringList() );
00485 
00497     bool filterUri( QString &uri, const QStringList& filters = QStringList() );
00498 
00510     KUrl filteredUri( const KUrl &uri, const QStringList& filters = QStringList() );
00511 
00523     QString filteredUri( const QString &uri, const QStringList& filters = QStringList() );
00524 
00530     QStringList pluginNames() const;
00531 
00532 protected:
00533 
00541     KUriFilter();
00542 
00549     void loadPlugins();
00550 
00551 private:
00552     KUriFilterPrivate * const d;
00553 };
00554 
00555 #endif

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal