]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.h
Unify the search interface for non-indexed and indexed folders
[dolphin.git] / src / dolphinviewcontainer.h
index 50d7c94613af51ac2d9773638a26eb1bc8301a6f..c222e7a559f4d0df78bdb8b2e1c792dd93b8bc68 100644 (file)
@@ -41,6 +41,7 @@ class KUrl;
 class DolphinModel;
 class KUrlNavigator;
 class DolphinDirLister;
+class DolphinSearchBox;
 class DolphinSortFilterProxyModel;
 class DolphinStatusBar;
 
@@ -94,6 +95,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
@@ -227,11 +235,22 @@ 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;