]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/viewproperties.h
First step to introduce dynamic roles
[dolphin.git] / src / views / viewproperties.h
index bb476dc44a16b2a77a0b4a8be8a7694af28b9a65..b46249eb2b520113425a40dfe558a8f791bbad03 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2006-2010 by Peter Penz <peter.penz@gmx.at>             *
+ *   Copyright (C) 2006-2010 by Peter Penz <peter.penz19@gmail.com>        *
  *   Copyright (C) 2006 by Aaron J. Seigo <aseigo@kde.org>                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -22,7 +22,7 @@
 #define VIEWPROPERTIES_H
 
 #include <views/dolphinview.h>
-#include <kurl.h>
+#include <KUrl>
 #include <libdolphin_export.h>
 
 class ViewPropertySettings;
@@ -37,7 +37,7 @@ class ViewPropertySettings;
  * \code
  * ViewProperties props(KUrl("/home/peter/Documents"));
  * const DolphinView::Mode mode = props.viewMode();
- * const bool showHiddenFiles = props.isShowHiddenFilesEnabled();
+ * const bool hiddenFilesShown = props.hiddenFilesShown();
  * \endcode
  *
  * When modifying a view property, the '.directory' file is automatically updated
@@ -56,17 +56,17 @@ public:
     void setViewMode(DolphinView::Mode mode);
     DolphinView::Mode viewMode() const;
 
-    void setShowPreview(bool show);
-    bool showPreview() const;
+    void setPreviewsShown(bool show);
+    bool previewsShown() const;
 
-    void setShowHiddenFiles(bool show);
-    bool showHiddenFiles() const;
+    void setHiddenFilesShown(bool show);
+    bool hiddenFilesShown() const;
 
-    void setCategorizedSorting(bool categorized);
-    bool categorizedSorting() const;
+    void setGroupedSorting(bool grouped);
+    bool groupedSorting() const;
 
-    void setSorting(DolphinView::Sorting sorting);
-    DolphinView::Sorting sorting() const;
+    void setSortRole(const QByteArray& role);
+    QByteArray sortRole() const;
 
     void setSortOrder(Qt::SortOrder sortOrder);
     Qt::SortOrder sortOrder() const;
@@ -79,14 +79,14 @@ public:
      * Note that the additional-info property is the only property where
      * the value is dependent from another property (in this case the view-mode).
      */
-    void setAdditionalInfo(const KFileItemDelegate::InformationList& info);
+    void setVisibleRoles(const QList<QByteArray>& info);
 
     /**
      * Returns the additional information for the current set view-mode.
      * Note that the additional-info property is the only property where
      * the value is dependent from another property (in this case the view-mode).
      */
-    KFileItemDelegate::InformationList additionalInfo() const;
+    QList<QByteArray> visibleRoles() const;
 
     /**
      * Sets the directory properties view mode, show preview,
@@ -103,7 +103,7 @@ public:
     void setAutoSaveEnabled(bool autoSave);
     bool isAutoSaveEnabled() const;
 
-    void updateTimeStamp();
+    void update();
 
     /**
      * Saves the view properties for the directory specified
@@ -132,24 +132,15 @@ private:
     QString destinationDir(const QString& subDir) const;
 
     /**
-     * Returns the encoded additional information that can be stored
-     * in the .directory file. See ViewProperties::decodedAdditionalInfo()
-     * for the coding format.
-     * @param info   Additional information for the current view mode.
+     * Returns the view-mode prefix when storing additional properties for
+     * a view-mode.
      */
-    int encodedAdditionalInfo(int info) const;
+    QString viewModePrefix() const;
 
     /**
-     * Returns the decoded additional information from the .directory
-     * file by respecting the current set view mode. The additional
-     * information from the .directory file is an integer value, where:
-     * - Byte 0 stores the additional info for the details view
-     * - Byte 1 stores the additional info for the icons view
-     * - Byte 2 stores the additional info for the column view
-     * The additional information property is the only property that is
-     * dependent from another property (in this case the view-mode).
+     * Returns true, if \a filePath is part of the home-path (see QDir::homePath()).
      */
-    int decodedAdditionalInfo() const;
+    static bool isPartOfHome(const QString& filePath);
 
     Q_DISABLE_COPY(ViewProperties)