]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.h
Merged very early alpha-version of Dolphin 2.0
[dolphin.git] / src / dolphinviewcontainer.h
index a34ac19764bed17b2768326db352399a853c9460..7aea304b8d6f38e39b6d9d20e08cc9e839e6ca2a 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2007 by Peter Penz <peter.penz@gmx.at>                  *
+ *   Copyright (C) 2007 by Peter Penz <peter.penz19@gmail.com>             *
  *                                                                         *
  *   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  *
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-
 #ifndef DOLPHINVIEWCONTAINER_H
 #define DOLPHINVIEWCONTAINER_H
 
-#include <kfileitem.h>
-#include <kfileitemdelegate.h>
-#include <kglobalsettings.h>
-#include <kio/job.h>
+#include <KFileItem>
+#include <KFileItemDelegate>
+#include <KGlobalSettings>
+#include <KIO/Job>
 
-#include <kurlnavigator.h>
+#include <KUrlNavigator>
 
 #include <QElapsedTimer>
 #include <QWidget>
 
 class FilterBar;
 class KUrl;
-class DolphinModel;
 class KUrlNavigator;
-class DolphinDirLister;
 class DolphinSearchBox;
-class DolphinSortFilterProxyModel;
 class DolphinStatusBar;
 
 /**
  * @short Represents a view for the directory content
  *        including the navigation bar, filter bar and status bar.
  *
- * View modes for icons, details and columns are supported. Currently
+ * View modes for icons, compact and details are supported. Currently
  * Dolphin allows to have up to two views inside the main window.
  *
  * @see DolphinView
@@ -84,6 +80,9 @@ public:
     const DolphinView* view() const;
     DolphinView* view();
 
+    const DolphinSearchBox* searchBox() const;
+    DolphinSearchBox* searchBox();
+
     /**
      * Refreshes the view container to get synchronized with the (updated) Dolphin settings.
      */
@@ -110,9 +109,11 @@ public slots:
     void setUrl(const KUrl& url);
 
     /**
-     * Popups the filter bar above the status bar if \a show is true.
+     * Popups the filter bar above the status bar if \a visible is true.
+     * It \a visible is true, it is assured that the filter bar gains
+     * the keyboard focus.
      */
-    void showFilterBar(bool show);
+    void setFilterBarVisible(bool visible);
 
 signals:
     /**
@@ -141,6 +142,9 @@ private slots:
      * of selected files and the sum of the filesize is shown. The update
      * is done asynchronously, as getting the sum of the
      * filesizes can be an expensive operation.
+     * Unless a previous OperationCompletedMessage was set very shortly before
+     * calling this method, it will be overwritten (see DolphinStatusBar::setMessage).
+     * Previous ErrorMessages however are always preserved.
      */
     void delayedStatusBarUpdate();
 
@@ -150,15 +154,19 @@ private slots:
      */
     void updateStatusBar();
 
-    void initializeProgress();
-
     void updateProgress(int percent);
 
+    /**
+     * Updates the statusbar to show an undetermined progress with the correct
+     * context information whether a searching or a directory loading is done.
+     */
+    void slotStartedPathLoading();
+
     /**
      * Assures that the viewport position is restored and updates the
      * statusbar to reflect the current content.
      */
-    void slotDirListerCompleted();
+    void slotFinishedPathLoading();
 
     /**
      * Handles clicking on an item. If the item is a directory, the
@@ -204,10 +212,16 @@ private slots:
     void activate();
 
     /**
-     * Saves the state of the current view: contents position,
-     * root URL, ...
+     * Is invoked if the signal urlAboutToBeChanged() from the DolphinView
+     * is emitted. Tries to save the view-state.
      */
-    void saveViewState();
+    void slotViewUrlAboutToBeChanged(const KUrl& url);
+
+    /**
+     * Is invoked if the signal urlAboutToBeChanged() from the URL navigator
+     * is emitted. Tries to save the view-state.
+     */
+    void slotUrlNavigatorLocationAboutToBeChanged(const KUrl& url);
 
     /**
      * Restores the current view to show \a url and assures
@@ -246,12 +260,25 @@ private slots:
     void startSearching(const QString& text);
     void closeSearchBox();
 
+    /**
+     * Stops the loading of a directory. Is connected with the "stopPressed" signal
+     * from the statusbar.
+     */
+    void stopLoading();
+
 private:
+    /**
+     * @return True if the URL protocol is a search URL (e. g. nepomuksearch:// or filenamesearch://).
+     */
     bool isSearchUrl(const KUrl& url) const;
 
-private:
-    bool m_isFolderWritable;
+    /**
+     * Saves the state of the current view: contents position,
+     * root URL, ...
+     */
+    void saveViewState();
 
+private:
     QVBoxLayout* m_topLayout;
     KUrlNavigator* m_urlNavigator;
     DolphinSearchBox* m_searchBox;
@@ -263,40 +290,6 @@ private:
     DolphinStatusBar* m_statusBar;
     QTimer* m_statusBarTimer;            // Triggers a delayed update
     QElapsedTimer m_statusBarTimestamp;  // Time in ms since last update
-
-    DolphinModel* m_dolphinModel;
-    DolphinDirLister* m_dirLister;
-    DolphinSortFilterProxyModel* m_proxyModel;
 };
 
-inline const DolphinStatusBar* DolphinViewContainer::statusBar() const
-{
-    return m_statusBar;
-}
-
-inline DolphinStatusBar* DolphinViewContainer::statusBar()
-{
-    return m_statusBar;
-}
-
-inline const KUrlNavigator* DolphinViewContainer::urlNavigator() const
-{
-    return m_urlNavigator;
-}
-
-inline KUrlNavigator* DolphinViewContainer::urlNavigator()
-{
-    return m_urlNavigator;
-}
-
-inline const DolphinView* DolphinViewContainer::view() const
-{
-    return m_view;
-}
-
-inline DolphinView* DolphinViewContainer::view()
-{
-    return m_view;
-}
-
 #endif // DOLPHINVIEWCONTAINER_H