]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.h
Clarify some adjectives.
[dolphin.git] / src / dolphinview.h
index 24c4f60a14e18366f8a227b2aedbdcee45437e6d..b9fe49f00fcc76ccda885834f86c43dbc1405984 100644 (file)
 #ifndef DOLPHINVIEW_H
 #define DOLPHINVIEW_H
 
+#include <config-nepomuk.h>
+
+#include "libdolphin_export.h"
+
 #include <kparts/part.h>
 #include <kfileitem.h>
 #include <kfileitemdelegate.h>
@@ -60,7 +64,7 @@ class ViewProperties;
  * @see DolphinDetailsView
  * @see DolphinColumnView
  */
-class DolphinView : public QWidget
+class LIBDOLPHINPRIVATE_EXPORT DolphinView : public QWidget
 {
     Q_OBJECT
 
@@ -102,7 +106,9 @@ public:
         SortByOwner,
         SortByGroup,
         SortByType,
-        MaxSortEnum = SortByType
+        SortByRating,
+        SortByTags,
+        MaxSortEnum = SortByTags
     };
 
     /**
@@ -115,16 +121,12 @@ public:
      * @param proxyModel      Used proxy model which specifies the sorting. The
      *                        model is not owned by the view and won't get
      *                        deleted.
-     * @param mode            Used display mode (IconsView, DetailsView or ColumnsView).
-     * @param showHiddenFiles If true, hidden files will be shown in the view.
      */
     DolphinView(QWidget* parent,
                 const KUrl& url,
                 KDirLister* dirLister,
                 KDirModel* dirModel,
-                DolphinSortFilterProxyModel* proxyModel,
-                Mode mode = IconsView,
-                bool showHiddenFiles = false);
+                DolphinSortFilterProxyModel* proxyModel);
 
     virtual ~DolphinView();
 
@@ -199,12 +201,6 @@ public:
      */
     bool supportsCategorizedSorting() const;
 
-    /**
-     * Triggers the renaming of the currently selected items, where
-     * the user must input a new name for the items.
-     */
-    void renameSelectedItems();
-
     /**
      * Selects all items.
      * @see DolphinView::selectedItems()
@@ -243,25 +239,14 @@ public:
     KFileItem* fileItem(const QModelIndex index) const;
 
     /**
-     * Renames the filename of the source URL by the new file name.
-     * If the new file name already exists, a dialog is opened which
-     * asks the user to enter a new name.
-     */
-    void rename(const KUrl& source, const QString& newName);
-
-    /**
-     * Returns the x-position of the view content.
-     * The content of the view might be larger than the visible area
+     * Sets the upper left position of the view content
+     * to (x,y). The content of the view might be larger than the visible area
      * and hence a scrolling must be done.
      */
-    int contentsX() const;
+    void setContentsPosition(int x, int y);
 
-    /**
-     * Returns the y-position of the view content.
-     * The content of the view might be larger than the visible area
-     * and hence a scrolling must be done.
-     */
-    int contentsY() const;
+    /** Returns the upper left position of the view content. */
+    QPoint contentsPosition() const;
 
     /** Increases the size of the current set view mode. */
     void zoomIn();
@@ -354,14 +339,14 @@ signals:
     /** Is emitted if the sort order (ascending or descending) has been changed. */
     void sortOrderChanged(Qt::SortOrder order);
 
-    /** Is emitted if the addtional information for an item has been changed. */
+    /** Is emitted if the additional information for an item has been changed. */
     void additionalInfoChanged(KFileItemDelegate::AdditionalInformation info);
 
     /**
      * Is emitted if information of an item is requested to be shown e. g. in the sidebar.
-     * It the URL is empty, no item information request is pending.
+     * If item is null, no item information request is pending.
      */
-    void requestItemInfo(const KUrl& url);
+    void requestItemInfo(const KFileItem& item);
 
     /** Is emitted if the contents has been moved to \a x, \a y. */
     void contentsMoved(int x, int y);
@@ -371,11 +356,6 @@ signals:
      */
     void selectionChanged(const KFileItemList& selection);
 
-    /**
-     * Is emitted whenever the filter bar has been turned show or hidden.
-     */
-    void showFilterBarChanged(bool shown);
-
     /**
      * Is emitted if a context menu is requested for the item \a item,
      * which is part of \a url. If the item is 0, the context menu
@@ -391,6 +371,18 @@ signals:
      */
     void urlsDropped(const KUrl::List& urls, const KUrl& destination);
 
+    /**
+     * Is emitted if an information message with the content \a msg
+     * should be shown.
+     */
+    void infoMessage(const QString& msg);
+
+    /**
+     * Is emitted if an error message with the content \a msg
+     * should be shown.
+     */
+    void errorMessage(const QString& msg);
+
 protected:
     /** @see QWidget::mouseReleaseEvent */
     virtual void mouseReleaseEvent(QMouseEvent* event);
@@ -422,12 +414,6 @@ private slots:
      */
     void showPreview(const KFileItem& item, const QPixmap& pixmap);
 
-    /**
-     * Restores the x- and y-position of the contents if the
-     * current view is part of the history.
-     */
-    void restoreContentsPos();
-
     void emitSelectionChangedSignal();
 
     /**
@@ -489,6 +475,12 @@ private slots:
 private:
     void startDirLister(const KUrl& url, bool reload = false);
 
+    /**
+     * Applies the view properties which are defined by the current URL
+     * m_url to the DolphinView properties.
+     */
+    void applyViewProperties(const KUrl& url);
+
     /**
      * Creates a new view representing the given view mode (DolphinView::mode()).
      * The current view will get deleted.
@@ -544,7 +536,7 @@ private:
     };
 
     bool m_active;
-    bool m_blockContentsMovedSignal;
+    bool m_loadingDirectory;
     bool m_initializeColumnView;
     Mode m_mode;