]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.h
The &-shortcut from another action is not set until the action has been shown at...
[dolphin.git] / src / dolphinviewcontainer.h
index ce5badfa286bc9224e649bb923bc6646d2bbeb13..aa43e8e66052818b63a3bbcf4ba38d47546b5e38 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef DOLPHINVIEWCONTAINER_H
 #define DOLPHINVIEWCONTAINER_H
 
-#include "dolphinview.h"
-
 #include <kfileitem.h>
 #include <kfileitemdelegate.h>
 #include <kglobalsettings.h>
 
 #include <kurlnavigator.h>
 
-#include <QtGui/QKeyEvent>
-#include <QtCore/QLinkedList>
-#include <QtGui/QListView>
-#include <QtGui/QBoxLayout>
-#include <QtGui/QWidget>
+#include <QElapsedTimer>
+#include <QWidget>
+
+#include <views/dolphinview.h>
 
 class FilterBar;
 class KUrl;
 class DolphinModel;
 class KUrlNavigator;
 class DolphinDirLister;
+class DolphinSearchBox;
 class DolphinSortFilterProxyModel;
 class DolphinStatusBar;
 
@@ -94,6 +92,13 @@ public:
     /** Returns true, if the filter bar is visible. */
     bool isFilterBarVisible() const;
 
+    /**
+     * Enables the search mode, if \p enabled is true. In the search mode the URL navigator
+     * will be hidden and replaced by a line editor that allows to enter a search term.
+     */
+    void setSearchModeEnabled(bool enabled);
+    bool isSearchModeEnabled() const;
+
 public slots:
     /**
      * Sets the current active URL, where all actions are applied. The
@@ -185,8 +190,6 @@ private slots:
      */
     void setNameFilter(const QString& nameFilter);
 
-    void restoreViewState();
-
     /**
      * Marks the view container as active
      * (see DolphinViewContainer::setActive()).
@@ -229,18 +232,30 @@ private slots:
 
     void slotHistoryChanged();
 
+    /**
+     * Gets the search URL from the searchbox and starts searching.
+     * @param text Text the user has entered into the searchbox.
+     */
+    void startSearching(const QString& text);
+    void closeSearchBox();
+
+private:
+    bool isSearchUrl(const KUrl& url) const;
+
 private:
     bool m_isFolderWritable;
 
     QVBoxLayout* m_topLayout;
     KUrlNavigator* m_urlNavigator;
+    DolphinSearchBox* m_searchBox;
 
     DolphinView* m_view;
 
     FilterBar* m_filterBar;
 
     DolphinStatusBar* m_statusBar;
-    QTimer* m_statusBarTimer;
+    QTimer* m_statusBarTimer;            // Triggers a delayed update
+    QElapsedTimer m_statusBarTimestamp;  // Time in ms since last update
 
     DolphinModel* m_dolphinModel;
     DolphinDirLister* m_dirLister;