]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinurlnavigator.h
Merge remote-tracking branch 'fork/work/zakharafoniam/useful-groups'
[dolphin.git] / src / dolphinurlnavigator.h
index 9bcc32b4d1463d1cfbcc37a31dd3068b92cdb312..d6da51b47a647601032c13ee1e29b96c8d1f248c 100644 (file)
@@ -1,6 +1,6 @@
 /*
     This file is part of the KDE project
-    SPDX-FileCopyrightText: 2020 Felix Ernst <fe.a.ernst@gmail.com>
+    SPDX-FileCopyrightText: 2020 Felix Ernst <felixernst@kde.org>
 
     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
 */
@@ -36,7 +36,7 @@ public:
      */
     DolphinUrlNavigator(const QUrl &url, QWidget *parent = nullptr);
 
-    virtual ~DolphinUrlNavigator();
+    ~DolphinUrlNavigator() override;
 
     // TODO: Fix KUrlNavigator::sizeHint() instead.
     QSize sizeHint() const override;
@@ -66,12 +66,44 @@ public:
      */
     void setVisualState(const VisualState &visualState);
 
-public slots:
+    /**
+     * Clears the text in the text field
+     */
+    void clearText() const;
+
+    /**
+     * Displays placeholder text in the URL navigator
+     */
+    void setPlaceholderText(const QString &text);
+
+    /**
+     * Sets the visibility of the read-only badge at the end of the breadcrumb.
+     */
+    void setReadOnlyBadgeVisible(bool visible);
+
+    /**
+     * Returns the visibility of the read-only badge at the end of the breadcrumb.
+     */
+    bool readOnlyBadgeVisible() const;
+
+public Q_SLOTS:
     /**
      * Switches to "breadcrumb" mode if the editable mode is not set to be
      * preferred in the Dolphin settings.
      */
     void slotReturnPressed();
+
+Q_SIGNALS:
+    /**
+     * Escape was pressed, and the focus should return to the view.
+     */
+    void requestToLoseFocus();
+
+protected:
+    /**
+     * Return focus back to the view when pressing Escape and this would have no other effect (e.g. deselecting or changing edit mode).
+     */
+    void keyPressEvent(QKeyEvent *keyEvent) override;
 };
 
 #endif // DOLPHINURLNAVIGATOR_H