X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ee92ff0d4245dd3de65a381e3a02317f851c942a..502a5c86feb0015c42f052d242c8115de320a38e:/src/kitemviews/kitemmodelbase.h diff --git a/src/kitemviews/kitemmodelbase.h b/src/kitemviews/kitemmodelbase.h index 283cfa552..257872f9c 100644 --- a/src/kitemviews/kitemmodelbase.h +++ b/src/kitemviews/kitemmodelbase.h @@ -23,13 +23,13 @@ #ifndef KITEMMODELBASE_H #define KITEMMODELBASE_H -#include - -#include -#include +#include "dolphin_export.h" +#include "kitemviews/kitemrange.h" +#include "kitemviews/kitemset.h" #include #include +#include #include class QMimeData; @@ -49,14 +49,14 @@ class QMimeData; * Also optionally it is possible to provide a tree of items by implementing the methods * setExpanded(), isExpanded(), isExpandable() and expandedParentsCount(). */ -class LIBDOLPHINPRIVATE_EXPORT KItemModelBase : public QObject +class DOLPHIN_EXPORT KItemModelBase : public QObject { Q_OBJECT public: - KItemModelBase(QObject* parent = 0); - explicit KItemModelBase(const QByteArray& sortRole, QObject* parent = 0); - virtual ~KItemModelBase(); + explicit KItemModelBase(QObject* parent = nullptr); + explicit KItemModelBase(const QByteArray& sortRole, QObject* parent = nullptr); + ~KItemModelBase() override; /** @return The number of items. */ virtual int count() const = 0; @@ -172,6 +172,30 @@ public: // decision whether it accepts the drop? virtual bool supportsDropping(int index) const; + /** + * @return An internal mimetype to signal that an itemDropEvent() should be rejected by + * the receiving model. + * + * This mimeType can be used in createMimeData() to notify that the + * drop-onto-items events should be ignored, while the drop-between-items + * ones should be still accepted. + */ + QString blacklistItemDropEventMimeType() const; + + /** + * @return URL of the item at the specified index + */ + virtual QUrl url(int index) const; + + /** + * @return True, if item at specified index is a directory + */ + virtual bool isDir(int index) const; + + /** + * @return Parent directory of the items that are shown + */ + virtual QUrl directory() const; signals: /** * Is emitted if one or more items have been inserted. Each item-range consists