]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinpart.h
Fixes Bug 305783 - dragging a file over a directory #c4
[dolphin.git] / src / dolphinpart.h
index b0b01d8d8bca7f3cbc05f8e60cc1999aa43bc0f3..0895686b837c0cf6830d2f802f1be926664c85b3 100644 (file)
 #ifndef DOLPHINPART_H
 #define DOLPHINPART_H
 
+#include <kdeversion.h>
+
 #include <kparts/part.h>
 #include <kparts/browserextension.h>
 #include <kparts/fileinfoextension.h>
 
+#if KDE_IS_VERSION(4, 9, 2)
+#include <kparts/listingextension.h>
+#endif
+
 #include <QItemSelectionModel>
 
 class KNewFileMenu;
@@ -117,8 +123,6 @@ Q_SIGNALS:
     void aboutToOpenURL();
 
 private Q_SLOTS:
-    void slotCompleted(const KUrl& url);
-    void slotCanceled(const KUrl& url);
     void slotMessage(const QString& msg);
     void slotErrorMessage(const QString& msg);
     /**
@@ -129,20 +133,22 @@ private Q_SLOTS:
     /**
      * Handles clicking on an item
      */
-    void slotItemTriggered(const KFileItem& item);
+    void slotItemActivated(const KFileItem& item);
     /**
      * Creates a new window showing the content of \a url.
      */
     void createNewWindow(const KUrl& url);
     /**
      * Opens the context menu on the current mouse position.
+     * @pos           Position in screen coordinates.
      * @item          File item context. If item is null, the context menu
      *                should be applied to \a url.
      * @url           URL which contains \a item.
      * @customActions Actions that should be added to the context menu,
      *                if the file item is null.
      */
-    void slotOpenContextMenu(const KFileItem& item,
+    void slotOpenContextMenu(const QPoint& pos,
+                             const KFileItem& item,
                              const KUrl& url,
                              const QList<QAction*>& customActions);
 
@@ -152,7 +158,7 @@ private Q_SLOTS:
      * Testcase 1: fish://localhost
      * Testcase 2: showing a directory that is being renamed by another window (#180156)
      */
-    void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl);
+    void slotDirectoryRedirection(const KUrl& oldUrl, const KUrl& newUrl);
 
     /**
      * Updates the state of the 'Edit' menu actions and emits
@@ -193,6 +199,11 @@ private Q_SLOTS:
      */
     void slotOpenTerminal();
 
+    /**
+     * Open KFind with the current path.
+     */
+    void slotFindFile();
+
     /**
      * Updates the 'Create New...' sub menu, just before it's shown.
      */
@@ -225,19 +236,16 @@ private:
                         QActionGroup* actionGroup);
 
     void openSelectionDialog(const QString& title, const QString& text,
-                             QItemSelectionModel::SelectionFlags command);
-
-    QItemSelection childrenMatchingPattern(const QModelIndex& parent, const QRegExp& patternRegExp);
+                             bool selectItems);
 
 private:
     DolphinView* m_view;
     DolphinViewActionHandler* m_actionHandler;
     DolphinRemoteEncoding* m_remoteEncoding;
-    KDirLister* m_dirLister;
-    DolphinModel* m_dolphinModel;
-    DolphinSortFilterProxyModel* m_proxyModel;
     DolphinPartBrowserExtension* m_extension;
     KNewFileMenu* m_newFileMenu;
+    KAction* m_findFileAction;
+    KAction* m_openTerminalAction;
     QString m_nameFilter;
     Q_DISABLE_COPY(DolphinPart)
 };
@@ -279,4 +287,34 @@ protected:
     DolphinPart* part() const;
 };
 
+#if KDE_IS_VERSION(4, 9, 2)
+class DolphinPartListingFilterExtension : public KParts::ListingFilterExtension
+{
+    Q_OBJECT
+
+public:
+    DolphinPartListingFilterExtension (DolphinPart* part);
+    virtual FilterModes supportedFilterModes() const;
+    virtual bool supportsMultipleFilters (FilterMode mode) const;
+    virtual QVariant filter (FilterMode mode) const;
+    virtual void setFilter (FilterMode mode, const QVariant& filter);
+
+private:
+    DolphinPart* m_part;
+};
+
+class DolphinPartListingNotificationExtension : public KParts::ListingNotificationExtension
+{
+    Q_OBJECT
+
+public:
+    DolphinPartListingNotificationExtension(DolphinPart* part);
+    virtual NotificationEventTypes supportedNotificationEventTypes() const;
+
+public Q_SLOTS:
+   void slotNewItems(const KFileItemList&);
+   void slotItemsDeleted(const KFileItemList&);
+};
+#endif
+
 #endif /* DOLPHINPART_H */