/* ============================================================ * The rekonq project * ============================================================ * SPDX-License-Identifier: GPL-2.0-or-later * Copyright (C) 2008-2012 by Andrea Diamantini * Copyright (C) 2009 by Domrachev Alexandr * Copyright (C) 2009 by Paweł Prażak * Copyright (C) 2009-2011 by Lionel Chauvin * SPDX-License-Identifier: GPL-3.0-only * Copyright (C) 2022 aqua * ============================================================ * Description: URL Bar * ============================================================ */ #pragma once #include "../rekonq.hpp" #include #include #include class IconButton : public QToolButton { Q_OBJECT public: explicit IconButton(QWidget *parent = nullptr); signals: void clicked(QPoint); protected: void mouseReleaseEvent(QMouseEvent *event); }; // Definitions class QProgressBar; typedef QList IconButtonPointerList; class UrlBar : public QLineEdit { Q_OBJECT public: enum Icon { KGet = 0x00000001, RSS = 0x00000010, BK = 0x00001000, SearchEngine = 0x00010000, AdBlock = 0x01000000 }; explicit UrlBar(QWidget *parent = nullptr); ~UrlBar() override = default; public slots: void setCurrentView(RekonqView *view) { m_currentView = view; loadProgress(view->progress()); setUrl(view->url()); } void setUrl(const QUrl &url); /** * Let us add bookmarks as the major browsers do * */ // void manageBookmarks(); void clearUrlbar(); void loadRequestedUrl(const QUrl &url, rekonq::OpenType = rekonq::CurrentTab); void loadStarted(); void loadProgress(int); void loadFinished(); // void clearRightIcons(); // void updateRightIcons(); // void detectTypedString(const QString &); // void suggest(); // void manageStarred(QPoint); // void manageAdBlock(QPoint); // void addToFavorites(); // void removeFromFavorites(); // void refreshFavicon(); // void pasteAndGo(); // void pasteAndSearch(); // void delSlot(); // bool isValidURL(QString url); // void showRSSInfo(QPoint); // void showSSLInfo(QPoint); protected: void paintEvent(QPaintEvent *event); void resizeEvent(QResizeEvent *); /* void keyReleaseEvent(QKeyEvent *event); void dropEvent(QDropEvent *event); void mouseDoubleClickEvent(QMouseEvent *); void contextMenuEvent(QContextMenuEvent *event); */ private: /** * Updates right icon position, given its number in the right icons list * and considering rekonq window position/dimension */ // void updateRightIconPosition(IconButton *, int); // IconButton *addRightIcon(UrlBar::icon); // QWeakPointer _box; RekonqView *m_currentView = nullptr; int m_currentView_progress = 0; IconButton *_icon; IconButtonPointerList _rightIconsList; const QColor backgroundColor; const QColor highlightColor; };