]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/viewproperties.h
Adapt Dolphin Nepomuk support to namespace changes.
[dolphin.git] / src / viewproperties.h
index 771144e1256bd713b293eec9c3e09d13b42fa0e1..64a2fad256ba829be8c100e84ea22c1d5930000c 100644 (file)
@@ -1,6 +1,6 @@
 /***************************************************************************
- *   Copyright (C) 2006 by Peter Penz                                      *
- *   peter.penz@gmx.at                                                     *
+ *   Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>)                *
+ *   Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>)               *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
 
 #include <dolphinview.h>
 #include <kurl.h>
-#include <qdatetime.h>
-
-#include "directoryviewpropertysettings.h"
-
-class QFile;
+#include <libdolphin_export.h>
 
+class ViewPropertySettings;
 /**
  * @brief Maintains the view properties like 'view mode' or
  *        'show hidden files' for a directory.
  *
- * The view properties are automatically stored inside the directory inside
- * the hidden file '.directory'. To read out the view properties
- * just construct an instance by passing the URL of the directory:
+ * The view properties are automatically stored as part of the file
+ * .directory inside the corresponding path. To read out the view properties
+ * just construct an instance by passing the path of the directory:
  *
  * \code
  * ViewProperties props(KUrl("/home/peter/Documents"));
@@ -45,8 +42,12 @@ class QFile;
  *
  * When modifying a view property, the '.directory' file is automatically updated
  * inside the destructor.
+ *
+ * If no .directory file is available or the global view mode is turned on
+ * (see GeneralSettings::globalViewMode()), the values from the global .directory file
+ * are used for initialization.
  */
-class ViewProperties
+class LIBDOLPHINPRIVATE_EXPORT ViewProperties
 {
 public:
     explicit ViewProperties(const KUrl& url);
@@ -61,12 +62,18 @@ public:
     void setShowHiddenFiles(bool show);
     bool showHiddenFiles() const;
 
+    void setCategorizedSorting(bool categorized);
+    bool categorizedSorting() const;
+
     void setSorting(DolphinView::Sorting sorting);
     DolphinView::Sorting sorting() const;
 
     void setSortOrder(Qt::SortOrder sortOrder);
     Qt::SortOrder sortOrder() const;
 
+    void setAdditionalInfo(KFileItemDelegate::AdditionalInformation info);
+    KFileItemDelegate::AdditionalInformation additionalInfo() const;
+
     /**
      * Sets the directory properties view mode, show preview,
      * show hidden files, sorting and sort order like
@@ -93,6 +100,15 @@ public:
      */
     void save();
 
+    /**
+     * Returns the URL of the directory, where the mirrored view properties
+     * are stored into. Mirrored view properties are used if:
+     * - there is no write access for storing the view properties into
+     *   the original directory
+     * - for non local directories
+     */
+    static KUrl mirroredDirectory();
+
 private:
     /**
      * Returns the destination directory path where the view
@@ -101,8 +117,7 @@ private:
      */
     QString destinationDir(const QString& subDir) const;
 
-    ViewProperties(const ViewProperties& props);
-    ViewProperties& operator= (const ViewProperties& props);
+    Q_DISABLE_COPY(ViewProperties)
 
 private:
     bool m_changedProps;