1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
//
// Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
// Earlier copyrights 1998 - 2007 Jim Bublitz also apply
// Generated by twine
// This file is part of PyKDE4.
// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
// PyKDE4 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
class KDirLister : QObject
{
%TypeHeaderCode
#include <kdirlister.h>
%End
public:
enum OpenUrlFlag
{
NoFlags,
Keep,
Reload
};
typedef QFlags<KDirLister::OpenUrlFlag> OpenUrlFlags;
KDirLister (QObject* parent /TransferThis/ = 0);
virtual bool openUrl (const KUrl& _url, KDirLister::OpenUrlFlags _flags = KDirLister::NoFlags);
virtual void stop ();
virtual void stop (const KUrl& _url);
bool delayedMimeTypes () const;
void setDelayedMimeTypes (bool delayedMimeTypes);
bool autoUpdate () const;
virtual void setAutoUpdate (bool enable);
bool autoErrorHandlingEnabled () const;
void setAutoErrorHandlingEnabled (bool enable, QWidget* parent /Transfer/);
bool showingDotFiles () const;
virtual void setShowingDotFiles (bool _showDotFiles);
bool dirOnlyMode () const;
virtual void setDirOnlyMode (bool dirsOnly);
KUrl url () const;
KUrl::List directories () const;
virtual void emitChanges ();
virtual void updateDirectory (const KUrl& _dir);
bool isFinished () const;
KFileItem rootItem () const;
virtual KFileItem findByUrl (const KUrl& _url) const;
virtual KFileItem findByName (const QString& name) const;
virtual void setNameFilter (const QString& filter);
QString nameFilter () const;
virtual void setMimeFilter (const QStringList& mimeList);
void setMimeExcludeFilter (const QStringList& mimeList);
virtual void clearMimeFilter ();
QStringList mimeFilters () const;
bool matchesFilter (const QString& name) const;
bool matchesMimeFilter (const QString& mime) const;
void setMainWindow (QWidget* window);
QWidget* mainWindow ();
enum WhichItems
{
AllItems,
FilteredItems
};
KFileItemList items (KDirLister::WhichItems which = KDirLister::FilteredItems) const;
KFileItemList itemsForDir (const KUrl& dir, KDirLister::WhichItems which = KDirLister::FilteredItems) const;
static KFileItem cachedItemForUrl (const KUrl& url);
signals:
void started (const KUrl& _url);
void completed ();
void completed (const KUrl& _url);
void canceled ();
void canceled (const KUrl& _url);
void redirection (const KUrl& _url);
void redirection (const KUrl& oldUrl, const KUrl& newUrl);
void clear ();
void clear (const KUrl& _url);
void newItems (const KFileItemList& items);
void itemsAdded (const KUrl& directoryUrl, const KFileItemList& items);
void itemsFilteredByMime (const KFileItemList& items);
void deleteItem (const KFileItem& _fileItem);
void itemsDeleted (const KFileItemList& items);
void infoMessage (const QString& msg);
void percent (int percent);
void totalSize (KIO::filesize_t size);
void processedSize (KIO::filesize_t size);
void speed (int bytes_per_second);
protected:
enum Changes
{
NONE,
NAME_FILTER,
MIME_FILTER,
DOT_FILES,
DIR_ONLY_MODE
};
virtual bool matchesFilter (const KFileItem&) const;
virtual bool matchesMimeFilter (const KFileItem&) const;
virtual bool doNameFilter (const QString& name, const QList<QRegExp>& filters) const;
virtual bool doMimeFilter (const QString& mime, const QStringList& filters) const;
virtual void handleError (KIO::Job*);
public:
~KDirLister ();
signals:
void refreshItems (const QList<QPair<KFileItem,KFileItem>>& items);
};
// KDirLister
|