]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/urlnavigator.h
Dolphin is now a KUniqueApplication. A lot of thanks go to Oscar Blumberg, who submit...
[dolphin.git] / src / urlnavigator.h
index b2e1da90e3e8f8c60044674e17bcdb8f630d58f9..9482619d62a91fcbc83d007ddd58198681e5762b 100644 (file)
 #ifndef URLNAVIGATOR_H
 #define URLNAVIGATOR_H
 
-#include <khbox.h>
 #include <kurl.h>
+#include <QWidget>
 #include <QLinkedList>
 
+class QHBoxLayout;
 class QLabel;
 class QLineEdit;
-class QCheckBox;
+class QMouseEvent;
+class QPushButton;
 
 class KUrl;
 class KFileItem;
@@ -58,7 +60,7 @@ class ProtocolCombo;
 
 typedef QLinkedList<KUrl> UrlStack;
 
-class UrlNavigator : public KHBox
+class UrlNavigator : public QWidget
 {
     Q_OBJECT
 
@@ -221,10 +223,18 @@ signals:
                      const KUrl& destination);
 
 protected:
-    /** If the Escape key is pressed, the navigation bar should switch
-        to the browse mode. */
+    /**
+     * If the Escape key is pressed, the navigation bar should switch
+     * to the browse mode.
+     */
     virtual void keyReleaseEvent(QKeyEvent* event);
 
+    /**
+     * Paste the clipboard content as URL, if the middle mouse
+     * button has been clicked.
+     */
+    virtual void mouseReleaseEvent(QMouseEvent* event);
+
 private slots:
     void slotReturnPressed(const QString& text);
     void slotUrlActivated(const KUrl& url);
@@ -233,11 +243,11 @@ private slots:
     void slotRedirection(const KUrl&, const KUrl&);
 
     /**
-     * Switches the navigation bar between the editable and noneditable
-     * state (see setUrlEditable()) and is connected to the clicked signal
+     * Switches the navigation bar between the breadcrumb view and the
+     * traditional view (see setUrlEditable()) and is connected to the clicked signal
      * of the navigation bar button.
      */
-    void slotClicked();
+    void switchView();
 
 private:
     /**
@@ -270,17 +280,28 @@ private:
      */
     void deleteButtons();
 
+    /**
+     * Appends the widget at the end of the URL navigator. It is assured
+     * that the filler widget remains as last widget to fill the remaining
+     * width.
+     */
+    void appendWidget(QWidget* widget);
+
 private:
     bool m_active;
     int m_historyIndex;
+
+    QHBoxLayout* m_layout;
+
     QLinkedList<HistoryElem> m_history;
-    QCheckBox* m_toggleButton;
+    QPushButton* m_toggleButton;
     BookmarkSelector* m_bookmarkSelector;
     KUrlComboBox* m_pathBox;
     ProtocolCombo* m_protocols;
     QLabel* m_protocolSeparator;
     QLineEdit* m_host;
     QLinkedList<UrlNavigatorButton*> m_navButtons;
+    QWidget* m_filler;
     //UrlStack m_urls;
 };