diff --git a/src/lib/3rdparty/fancytabwidget.h b/src/lib/3rdparty/fancytabwidget.h index af6e973f..18794b5b 100644 --- a/src/lib/3rdparty/fancytabwidget.h +++ b/src/lib/3rdparty/fancytabwidget.h @@ -1,238 +1,238 @@ /************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** Commercial Usage ** ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at http://qt.nokia.com/contact. ** **************************************************************************/ #ifndef FANCYTABWIDGET_H #define FANCYTABWIDGET_H #include "qzcommon.h" #include #include #include #include #include #include class QActionGroup; class QMenu; class QPainter; class QSignalMapper; class QStackedLayout; class QStatusBar; class QVBoxLayout; namespace Core { namespace Internal { class FALKON_EXPORT FancyTabProxyStyle : public QProxyStyle { Q_OBJECT public: void drawControl(ControlElement element, const QStyleOption* option, - QPainter* painter, const QWidget* widget) const; - void polish(QWidget* widget); - void polish(QApplication* app); - void polish(QPalette &palette); + QPainter* painter, const QWidget* widget) const override; + void polish(QWidget* widget) override; + void polish(QApplication* app) override; + void polish(QPalette &palette) override; protected: - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(QObject* o, QEvent* e) override; }; class FALKON_EXPORT FancyTab : public QWidget { Q_OBJECT Q_PROPERTY(float fader READ fader WRITE setFader) public: FancyTab(QWidget* tabbar); float fader() { return m_fader; } void setFader(float value); - QSize sizeHint() const; + QSize sizeHint() const override; void fadeIn(); void fadeOut(); QIcon icon; QString text; protected: - void enterEvent(QEvent*); - void leaveEvent(QEvent*); + void enterEvent(QEvent*) override; + void leaveEvent(QEvent*) override; private: QPropertyAnimation animator; QWidget* tabbar; float m_fader; }; class FALKON_EXPORT FancyTabBar : public QWidget { Q_OBJECT public: explicit FancyTabBar(QWidget* parent = nullptr); ~FancyTabBar() override; void paintEvent(QPaintEvent* event) override; void paintTab(QPainter* painter, int tabIndex) const; void mousePressEvent(QMouseEvent*) override; bool validIndex(int index) const { return index >= 0 && index < m_tabs.count(); } QSize sizeHint() const override; QSize minimumSizeHint() const override; void addTab(const QIcon &icon, const QString &label); void addSpacer(int size = 40); void removeTab(int index) { FancyTab* tab = m_tabs.takeAt(index); delete tab; } void setCurrentIndex(int index); int currentIndex() const { return m_currentIndex; } void setTabToolTip(int index, const QString &toolTip); QString tabToolTip(int index) const; QIcon tabIcon(int index) const {return m_tabs.at(index)->icon; } QString tabText(int index) const { return m_tabs.at(index)->text; } int count() const {return m_tabs.count(); } QRect tabRect(int index) const; Q_SIGNALS: void currentChanged(int); public Q_SLOTS: void emitCurrentIndex(); private: static const int m_rounding; static const int m_textPadding; int m_currentIndex; QList m_tabs; QTimer m_triggerTimer; QSize tabSizeHint(bool minimum = false) const; }; class FALKON_EXPORT FancyTabWidget : public QWidget { Q_OBJECT Q_PROPERTY(QPixmap bgPixmap READ bgPixmap WRITE SetBackgroundPixmap) public: explicit FancyTabWidget(QWidget* parent = nullptr); // Values are persisted - only add to the end enum Mode { Mode_None = 0, Mode_LargeSidebar = 1, Mode_SmallSidebar = 2, Mode_Tabs = 3, Mode_IconOnlyTabs = 4, Mode_PlainSidebar = 5, }; struct Item { Item(const QIcon &icon, const QString &label) : type_(Type_Tab), tab_label_(label), tab_icon_(icon), spacer_size_(0) {} Item(int size) : type_(Type_Spacer), spacer_size_(size) {} enum Type { Type_Tab, Type_Spacer, }; Type type_; QString tab_label_; QIcon tab_icon_; int spacer_size_; }; void AddTab(QWidget* tab, const QIcon &icon, const QString &label); void AddSpacer(int size = 40); void SetBackgroundPixmap(const QPixmap &pixmap); void AddBottomWidget(QWidget* widget); int current_index() const; Mode mode() const { return mode_; } QPixmap bgPixmap() { return background_pixmap_; } public Q_SLOTS: void SetCurrentIndex(int index); void SetMode(Mode mode); void SetMode(int mode) { SetMode(Mode(mode)); } Q_SIGNALS: void CurrentChanged(int index); void ModeChanged(FancyTabWidget::Mode mode); protected: - void paintEvent(QPaintEvent* event); - void contextMenuEvent(QContextMenuEvent* e); + void paintEvent(QPaintEvent* event) override; + void contextMenuEvent(QContextMenuEvent* e) override; private Q_SLOTS: void ShowWidget(int index); private: void MakeTabBar(QTabBar::Shape shape, bool text, bool icons, bool fancy); void AddMenuItem(QSignalMapper* mapper, QActionGroup* group, const QString &text, Mode mode); Mode mode_; QList items_; QWidget* tab_bar_; QStackedLayout* stack_; QPixmap background_pixmap_; QWidget* side_widget_; QVBoxLayout* side_layout_; QVBoxLayout* top_layout_; bool use_background_; QMenu* menu_; FancyTabProxyStyle* proxy_style_; }; } // namespace Internal } // namespace Core using Core::Internal::FancyTab; using Core::Internal::FancyTabBar; using Core::Internal::FancyTabWidget; #endif // FANCYTABWIDGET_H diff --git a/src/lib/3rdparty/squeezelabelv1.h b/src/lib/3rdparty/squeezelabelv1.h index 4c1bd445..4835bc53 100644 --- a/src/lib/3rdparty/squeezelabelv1.h +++ b/src/lib/3rdparty/squeezelabelv1.h @@ -1,54 +1,54 @@ /** * Copyright (c) 2009, Benjamin C. Meyer * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Benjamin Meyer nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef SQUEEZELABELV1_H #define SQUEEZELABELV1_H #include "qzcommon.h" #include /* A label that will squeeze the set text to fit within the size of the widget. The text will be elided in the middle. */ class FALKON_EXPORT SqueezeLabelV1 : public QLabel { Q_OBJECT public: SqueezeLabelV1(QWidget* parent = 0); protected: - void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event) override; private: QString m_SqueezedTextCache; }; #endif // SQUEEZELABELV1_H diff --git a/src/lib/3rdparty/squeezelabelv2.h b/src/lib/3rdparty/squeezelabelv2.h index 08004884..b8d9151d 100644 --- a/src/lib/3rdparty/squeezelabelv2.h +++ b/src/lib/3rdparty/squeezelabelv2.h @@ -1,52 +1,52 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef SQUEEZELABELV2_H #define SQUEEZELABELV2_H #include "qzcommon.h" #include class FALKON_EXPORT SqueezeLabelV2 : public QLabel { Q_OBJECT public: explicit SqueezeLabelV2(QWidget* parent = nullptr); SqueezeLabelV2(const QString &string); QString originalText(); void setText(const QString &txt); private Q_SLOTS: void copy(); protected: - void contextMenuEvent(QContextMenuEvent* event); - void keyPressEvent(QKeyEvent* event); - void resizeEvent(QResizeEvent* event); + void contextMenuEvent(QContextMenuEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; + void resizeEvent(QResizeEvent* event) override; - void mousePressEvent(QMouseEvent* event); - void mouseMoveEvent(QMouseEvent* event); + void mousePressEvent(QMouseEvent* event) override; + void mouseMoveEvent(QMouseEvent* event) override; private: QString m_originalText; QPoint m_dragStart; }; #endif // SQUEEZELABELV2_H diff --git a/src/lib/app/autosaver.h b/src/lib/app/autosaver.h index 0e31b7a3..2aacb763 100644 --- a/src/lib/app/autosaver.h +++ b/src/lib/app/autosaver.h @@ -1,49 +1,49 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2016 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef AUTOSAVER_H #define AUTOSAVER_H #include #include #include "qzcommon.h" class FALKON_EXPORT AutoSaver : public QObject { Q_OBJECT public: explicit AutoSaver(QObject* parent = 0); // Emits save() if timer is running. Call this from destructor. void saveIfNecessary(); public Q_SLOTS: // Tells AutoSaver that change occurred. Signal save() will be emitted after a delay void changeOccurred(); Q_SIGNALS: void save(); private: - void timerEvent(QTimerEvent* event); + void timerEvent(QTimerEvent* event) override; QBasicTimer m_timer; }; #endif // AUTOSAVER_H diff --git a/src/lib/app/browserwindow.h b/src/lib/app/browserwindow.h index 647eef89..74d75593 100644 --- a/src/lib/app/browserwindow.h +++ b/src/lib/app/browserwindow.h @@ -1,249 +1,249 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef BROWSERWINDOW_H #define BROWSERWINDOW_H #include #include #include #include "webtab.h" #include "qzcommon.h" class QLabel; class QVBoxLayout; class QSplitter; class QWebEngineFrame; class QTimer; class Menu; class MainMenu; class TabWidget; class TabbedWebView; class LineEdit; class HistoryMenu; class BookmarksMenu; class BookmarksToolbar; class AutoFill; class MainApplication; class WebView; class WebPage; class SideBar; class SideBarManager; class ProgressBar; class StatusBar; class NavigationBar; class NavigationContainer; class ClickableLabel; class LocationBar; class TabModel; class TabMruModel; class FALKON_EXPORT BrowserWindow : public QMainWindow { Q_OBJECT public: struct SavedWindow { QByteArray windowState; QByteArray windowGeometry; QHash windowUiState; int virtualDesktop = -1; int currentTab = -1; QVector tabs; SavedWindow(); SavedWindow(BrowserWindow *window); bool isValid() const; void clear(); friend FALKON_EXPORT QDataStream &operator<<(QDataStream &stream, const SavedWindow &window); friend FALKON_EXPORT QDataStream &operator>>(QDataStream &stream, SavedWindow &window); }; explicit BrowserWindow(Qz::BrowserWindowType type, const QUrl &url = QUrl()); ~BrowserWindow(); void setStartTab(WebTab* tab); void setStartPage(WebPage* page); void restoreWindow(const SavedWindow &window); bool fullScreenNavigationVisible() const; void showNavigationWithFullScreen(); void hideNavigationWithFullScreen(); void currentTabChanged(); void updateLoadingActions(); void addBookmark(const QUrl &url, const QString &title); void addDeleteOnCloseWidget(QWidget* widget); void createToolbarsMenu(QMenu* menu); void createSidebarsMenu(QMenu* menu); void createEncodingMenu(QMenu* menu); void removeActions(const QList &actions); SideBar* addSideBar(); void saveSideBarSettings(); int tabCount() const; TabbedWebView* weView() const; TabbedWebView* weView(int index) const; Qz::BrowserWindowType windowType() const; LocationBar* locationBar() const; TabWidget* tabWidget() const; BookmarksToolbar* bookmarksToolbar() const; StatusBar* statusBar() const; NavigationBar* navigationBar() const; SideBarManager* sideBarManager() const; QLabel* ipLabel() const; QMenu* superMenu() const; QUrl homepageUrl() const; QAction* action(const QString &name) const; TabModel *tabModel() const; TabMruModel *tabMruModel() const; Q_SIGNALS: void startingCompleted(); void aboutToClose(); public Q_SLOTS: void addTab(); void goHome(); void goHomeInNewTab(); void goBack(); void goForward(); void reload(); void reloadBypassCache(); void setWindowTitle(const QString &t); void showWebInspector(); void toggleWebInspector(); void showHistoryManager(); void toggleShowMenubar(); void toggleShowStatusBar(); void toggleShowBookmarksToolbar(); void toggleShowNavigationToolbar(); void toggleTabsOnTop(bool enable); void toggleFullScreen(); void requestHtmlFullScreen(TabbedWebView *view, bool enable); void loadActionUrl(QObject* obj = 0); void loadActionUrlInNewTab(QObject* obj = 0); void bookmarkPage(); void bookmarkAllTabs(); void loadAddress(const QUrl &url); void showSource(WebView *view = Q_NULLPTR); private Q_SLOTS: void openLocation(); void openFile(); void closeWindow(); void closeTab(); void loadSettings(); void postLaunch(); void webSearch(); void searchOnPage(); void changeEncoding(); void printPage(); void saveSettings(); void hideNavigationSlot(); private: - bool event(QEvent* event); - void resizeEvent(QResizeEvent* event); - void keyPressEvent(QKeyEvent* event); - void keyReleaseEvent(QKeyEvent* event); - void closeEvent(QCloseEvent* event); + bool event(QEvent* event) override; + void resizeEvent(QResizeEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; + void keyReleaseEvent(QKeyEvent* event) override; + void closeEvent(QCloseEvent* event) override; void setupUi(); void setupMenu(); void updateStartupFocus(); QAction *createEncodingAction(const QString &codecName, const QString &activeCodecName, QMenu *menu); void createEncodingSubMenu(const QString &name, QStringList &codecNames, QMenu *menu); QHash saveUiState(); void restoreUiState(const QHash &state); QUrl m_startUrl; QUrl m_homepage; Qz::BrowserWindowType m_windowType; WebTab* m_startTab; WebPage* m_startPage; QVBoxLayout* m_mainLayout; QSplitter* m_mainSplitter; TabWidget* m_tabWidget; QPointer m_sideBar; SideBarManager* m_sideBarManager; StatusBar* m_statusBar; NavigationContainer* m_navigationContainer; NavigationBar* m_navigationToolbar; BookmarksToolbar* m_bookmarksToolbar; ProgressBar* m_progressBar; QLabel* m_ipLabel; QMenu* m_superMenu; MainMenu* m_mainMenu; TabModel *m_tabModel = nullptr; TabMruModel *m_tabMruModel = nullptr; int m_sideBarWidth; int m_webViewWidth; // Shortcuts bool m_useTabNumberShortcuts; bool m_useSpeedDialNumberShortcuts; bool m_useSingleKeyShortcuts; // Remember visibility of menubar and statusbar after entering Fullscreen bool m_menuBarVisible; bool m_statusBarVisible; QPointer m_htmlFullScreenView; QTimer* m_hideNavigationTimer; QList > m_deleteOnCloseWidgets; #ifdef QZ_WS_X11 private: int getCurrentVirtualDesktop() const; void moveToVirtualDesktop(int desktopId); #endif }; #endif // BROWSERWINDOW_H diff --git a/src/lib/autofill/autofillicon.h b/src/lib/autofill/autofillicon.h index 83e213b0..50bef9f1 100644 --- a/src/lib/autofill/autofillicon.h +++ b/src/lib/autofill/autofillicon.h @@ -1,49 +1,49 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2013-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef AUTOFILLICON_H #define AUTOFILLICON_H #include "qzcommon.h" #include "clickablelabel.h" class WebView; class FALKON_EXPORT AutoFillIcon : public ClickableLabel { Q_OBJECT public: explicit AutoFillIcon(QWidget* parent = nullptr); void setWebView(WebView* view); void setUsernames(const QStringList &usernames); private Q_SLOTS: void iconClicked(); private: - void contextMenuEvent(QContextMenuEvent* ev); - void mousePressEvent(QMouseEvent* ev); + void contextMenuEvent(QContextMenuEvent* ev) override; + void mousePressEvent(QMouseEvent* ev) override; WebView* m_view; QStringList m_usernames; }; #endif // AUTOFILLICON_H diff --git a/src/lib/bookmarks/bookmarksicon.h b/src/lib/bookmarks/bookmarksicon.h index ee6715eb..3b234ab5 100644 --- a/src/lib/bookmarks/bookmarksicon.h +++ b/src/lib/bookmarks/bookmarksicon.h @@ -1,56 +1,56 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef BOOKMARKSICON_H #define BOOKMARKSICON_H #include #include "clickablelabel.h" #include "qzcommon.h" class WebView; class BookmarkItem; class FALKON_EXPORT BookmarksIcon : public ClickableLabel { Q_OBJECT public: explicit BookmarksIcon(QWidget* parent = 0); void setWebView(WebView* view); void checkBookmark(const QUrl &url, bool forceCheck = false); private Q_SLOTS: void bookmarksChanged(); void speedDialChanged(); void iconClicked(); private: - void contextMenuEvent(QContextMenuEvent* ev); - void mousePressEvent(QMouseEvent* ev); + void contextMenuEvent(QContextMenuEvent* ev) override; + void mousePressEvent(QMouseEvent* ev) override; void setBookmarkSaved(); void setBookmarkDisabled(); WebView* m_view; BookmarkItem* m_bookmark; QUrl m_lastUrl; }; #endif // BOOKMARKSICON_H diff --git a/src/lib/bookmarks/bookmarksitemdelegate.h b/src/lib/bookmarks/bookmarksitemdelegate.h index 19e3aa41..b8234c93 100644 --- a/src/lib/bookmarks/bookmarksitemdelegate.h +++ b/src/lib/bookmarks/bookmarksitemdelegate.h @@ -1,41 +1,41 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef BOOKMARKSITEMDELEGATE_H #define BOOKMARKSITEMDELEGATE_H #include #include "qzcommon.h" class QTreeView; class FALKON_EXPORT BookmarksItemDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit BookmarksItemDelegate(QTreeView* parent = 0); - void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; + void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: QTreeView* m_tree; mutable QRect m_lastRect; }; #endif // BOOKMARKSITEMDELEGATE_H diff --git a/src/lib/bookmarks/bookmarksmanager.h b/src/lib/bookmarks/bookmarksmanager.h index 69a78724..b2c0e10d 100644 --- a/src/lib/bookmarks/bookmarksmanager.h +++ b/src/lib/bookmarks/bookmarksmanager.h @@ -1,91 +1,91 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef BOOKMARKSMANAGER_H #define BOOKMARKSMANAGER_H #include #include #include "qzcommon.h" namespace Ui { class BookmarksManager; } class QUrl; class BrowserWindow; class Bookmarks; class BookmarkItem; class FALKON_EXPORT BookmarksManager : public QWidget { Q_OBJECT public: explicit BookmarksManager(BrowserWindow* window, QWidget* parent = 0); ~BookmarksManager(); void setMainWindow(BrowserWindow* window); public Q_SLOTS: void search(const QString &string); private Q_SLOTS: void bookmarkActivated(BookmarkItem* item); void bookmarkCtrlActivated(BookmarkItem* item); void bookmarkShiftActivated(BookmarkItem* item); void bookmarksSelected(const QList &items); void createContextMenu(const QPoint &pos); void openBookmark(BookmarkItem* item = 0); void openBookmarkInNewTab(BookmarkItem* item = 0); void openBookmarkInNewWindow(BookmarkItem* item = 0); void openBookmarkInNewPrivateWindow(BookmarkItem* item = 0); void addBookmark(); void addFolder(); void addSeparator(); void deleteBookmarks(); void bookmarkEdited(); void descriptionEdited(); void enableUpdates(); private: void updateEditBox(BookmarkItem* item); bool bookmarkEditable(BookmarkItem* item) const; void addBookmark(BookmarkItem* item); BookmarkItem* parentForNewBookmark() const; BrowserWindow* getWindow(); - void showEvent(QShowEvent* event); - void keyPressEvent(QKeyEvent* event); + void showEvent(QShowEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; Ui::BookmarksManager* ui; QPointer m_window; Bookmarks* m_bookmarks; BookmarkItem* m_selectedBookmark; bool m_blockDescriptionChangedSignal; bool m_adjustHeaderSizesOnShow; }; #endif // BOOKMARKSMANAGER_H diff --git a/src/lib/bookmarks/bookmarksmodel.h b/src/lib/bookmarks/bookmarksmodel.h index e0505e62..ac42b1c4 100644 --- a/src/lib/bookmarks/bookmarksmodel.h +++ b/src/lib/bookmarks/bookmarksmodel.h @@ -1,122 +1,122 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef BOOKMARKSMODEL_H #define BOOKMARKSMODEL_H #include #include #include #include "qzcommon.h" class QTimer; class Bookmarks; class BookmarkItem; class FALKON_EXPORT BookmarksModel : public QAbstractItemModel { Q_OBJECT public: enum Roles { TypeRole = Qt::UserRole + 1, UrlRole = Qt::UserRole + 2, UrlStringRole = Qt::UserRole + 3, TitleRole = Qt::UserRole + 4, IconRole = Qt::UserRole + 5, DescriptionRole = Qt::UserRole + 6, KeywordRole = Qt::UserRole + 7, VisitCountRole = Qt::UserRole + 8, ExpandedRole = Qt::UserRole + 9, SidebarExpandedRole = Qt::UserRole + 10, MaxRole = SidebarExpandedRole }; explicit BookmarksModel(BookmarkItem* root, Bookmarks* bookmarks, QObject* parent = 0); void addBookmark(BookmarkItem* parent, int row, BookmarkItem* item); void removeBookmark(BookmarkItem* item); - Qt::ItemFlags flags(const QModelIndex &index) const; - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; - bool hasChildren(const QModelIndex &parent) const; - - Qt::DropActions supportedDropActions() const; - QStringList mimeTypes() const; - QMimeData* mimeData(const QModelIndexList &indexes) const; - bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex &parent); - - QModelIndex parent(const QModelIndex &child) const; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; + QVariant data(const QModelIndex &index, int role) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + int rowCount(const QModelIndex &parent) const override; + int columnCount(const QModelIndex &parent) const override; + bool hasChildren(const QModelIndex &parent) const override; + + Qt::DropActions supportedDropActions() const override; + QStringList mimeTypes() const override; + QMimeData* mimeData(const QModelIndexList &indexes) const override; + bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; + + QModelIndex parent(const QModelIndex &child) const override; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex index(BookmarkItem* item, int column = 0) const; BookmarkItem* item(const QModelIndex &index) const; private Q_SLOTS: void bookmarkChanged(BookmarkItem* item); private: BookmarkItem* m_root; Bookmarks* m_bookmarks; }; class FALKON_EXPORT BookmarksFilterModel : public QSortFilterProxyModel { Q_OBJECT public: explicit BookmarksFilterModel(QAbstractItemModel* parent); public Q_SLOTS: void setFilterFixedString(const QString &pattern); protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; private Q_SLOTS: void startFiltering(); private: QString m_pattern; QTimer* m_filterTimer; }; class FALKON_EXPORT BookmarksButtonMimeData : public QMimeData { Q_OBJECT public: explicit BookmarksButtonMimeData(); BookmarkItem *item() const; void setBookmarkItem(BookmarkItem *item); bool hasFormat(const QString &format) const override; QStringList formats() const override; static QString mimeType(); private: BookmarkItem* m_item; }; #endif // BOOKMARKSMODEL_H diff --git a/src/lib/bookmarks/bookmarkstoolbar.h b/src/lib/bookmarks/bookmarkstoolbar.h index 40fc12ca..c5acf7b2 100644 --- a/src/lib/bookmarks/bookmarkstoolbar.h +++ b/src/lib/bookmarks/bookmarkstoolbar.h @@ -1,79 +1,79 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2017 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef BOOKMARKSTOOLBAR_H #define BOOKMARKSTOOLBAR_H #include #include "qzcommon.h" class QHBoxLayout; class QTimer; class BrowserWindow; class Bookmarks; class BookmarkItem; class BookmarksToolbarButton; class FALKON_EXPORT BookmarksToolbar : public QWidget { Q_OBJECT public: explicit BookmarksToolbar(BrowserWindow* window, QWidget* parent = 0); private Q_SLOTS: void contextMenuRequested(const QPoint &pos); void refresh(); void bookmarksChanged(); void showOnlyIconsChanged(bool state); void showOnlyTextChanged(bool state); void openBookmarkInNewTab(); void openBookmarkInNewWindow(); void openBookmarkInNewPrivateWindow(); void editBookmark(); void deleteBookmark(); private: void clear(); void addItem(BookmarkItem* item); BookmarksToolbarButton* buttonAt(const QPoint &pos); QSize minimumSizeHint() const override; - void dropEvent(QDropEvent* e); - void dragEnterEvent(QDragEnterEvent* e); - void dragMoveEvent(QDragMoveEvent* e); - void dragLeaveEvent(QDragLeaveEvent* e); - void paintEvent(QPaintEvent* p); + void dropEvent(QDropEvent* e) override; + void dragEnterEvent(QDragEnterEvent* e) override; + void dragMoveEvent(QDragMoveEvent* e) override; + void dragLeaveEvent(QDragLeaveEvent* e) override; + void paintEvent(QPaintEvent* p) override; BrowserWindow* m_window; Bookmarks* m_bookmarks; BookmarkItem* m_clickedBookmark; QHBoxLayout* m_layout; QTimer* m_updateTimer; QAction* m_actShowOnlyIcons = nullptr; QAction* m_actShowOnlyText = nullptr; int m_dropRow; QPoint m_dropPos; void clearDropIndicator(); }; #endif // BOOKMARKSTOOLBAR_H diff --git a/src/lib/bookmarks/bookmarkstreeview.h b/src/lib/bookmarks/bookmarkstreeview.h index f7f63e8f..fe52f9fb 100644 --- a/src/lib/bookmarks/bookmarkstreeview.h +++ b/src/lib/bookmarks/bookmarkstreeview.h @@ -1,91 +1,91 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef BOOKMARKSTREEVIEW_H #define BOOKMARKSTREEVIEW_H #include #include "qzcommon.h" class Bookmarks; class BookmarkItem; class BookmarksModel; class BookmarksFilterModel; class FALKON_EXPORT BookmarksTreeView : public QTreeView { Q_OBJECT public: enum ViewType { BookmarksManagerViewType, BookmarksSidebarViewType }; explicit BookmarksTreeView(QWidget* parent = 0); ViewType viewType() const; void setViewType(ViewType type); // Returns null if more than one (or zero) bookmarks are selected BookmarkItem* selectedBookmark() const; // Returns all selected bookmarks QList selectedBookmarks() const; void selectBookmark(BookmarkItem* item); // Expand up to root item void ensureBookmarkVisible(BookmarkItem* item); public Q_SLOTS: void search(const QString &string); Q_SIGNALS: // Open bookmark in current tab void bookmarkActivated(BookmarkItem* item); // Open bookmark in new tab void bookmarkCtrlActivated(BookmarkItem* item); // Open bookmark in new window void bookmarkShiftActivated(BookmarkItem* item); // Context menu signal with point mapped to global void contextMenuRequested(const QPoint &point); // If all bookmarks have been deselected, items is empty void bookmarksSelected(const QList &items); private Q_SLOTS: void indexExpanded(const QModelIndex &parent); void indexCollapsed(const QModelIndex &parent); private: void restoreExpandedState(const QModelIndex &parent); - void rowsInserted(const QModelIndex &parent, int start, int end); - void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); - - void contextMenuEvent(QContextMenuEvent* event); - void mouseMoveEvent(QMouseEvent* event); - void mousePressEvent(QMouseEvent* event); - void mouseReleaseEvent(QMouseEvent* event); - void mouseDoubleClickEvent(QMouseEvent* event); - void keyPressEvent(QKeyEvent* event); + void rowsInserted(const QModelIndex &parent, int start, int end) override; + void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override; + + void contextMenuEvent(QContextMenuEvent* event) override; + void mouseMoveEvent(QMouseEvent* event) override; + void mousePressEvent(QMouseEvent* event) override; + void mouseReleaseEvent(QMouseEvent* event) override; + void mouseDoubleClickEvent(QMouseEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; Bookmarks* m_bookmarks; BookmarksModel* m_model; BookmarksFilterModel* m_filter; ViewType m_type; }; #endif // BOOKMARKSTREEVIEW_H diff --git a/src/lib/cookies/cookiemanager.h b/src/lib/cookies/cookiemanager.h index 948ed18f..9e2b2ff8 100644 --- a/src/lib/cookies/cookiemanager.h +++ b/src/lib/cookies/cookiemanager.h @@ -1,74 +1,74 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef COOKIEMANAGER_H #define COOKIEMANAGER_H #include #include "qzcommon.h" namespace Ui { class CookieManager; } class QTreeWidgetItem; class QNetworkCookie; class BrowserWindow; class FALKON_EXPORT CookieManager : public QDialog { Q_OBJECT public: explicit CookieManager(QWidget *parent = nullptr); ~CookieManager(); private Q_SLOTS: void currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* parent); void remove(); void removeAll(); void addWhitelist(); void removeWhitelist(); void addBlacklist(); void removeBlacklist(); void deletePressed(); void filterString(const QString &string); void addCookie(const QNetworkCookie &cookie); void removeCookie(const QNetworkCookie &cookie); private: - void closeEvent(QCloseEvent* e); - void keyPressEvent(QKeyEvent* e); + void closeEvent(QCloseEvent* e) override; + void keyPressEvent(QKeyEvent* e) override; void addBlacklist(const QString &server); QString cookieDomain(const QNetworkCookie &cookie) const; QTreeWidgetItem *cookieItem(const QNetworkCookie &cookie) const; Ui::CookieManager* ui; QHash m_domainHash; QHash m_itemHash; }; #endif // COOKIEMANAGER_H diff --git a/src/lib/downloads/downloaditem.h b/src/lib/downloads/downloaditem.h index e59761de..7e38d309 100644 --- a/src/lib/downloads/downloaditem.h +++ b/src/lib/downloads/downloaditem.h @@ -1,97 +1,97 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2017 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef DOWNLOADITEM_H #define DOWNLOADITEM_H #include #include #include #include #include #include #include "qzcommon.h" namespace Ui { class DownloadItem; } class QListWidgetItem; class QWebEngineDownloadItem; class DownloadManager; class FALKON_EXPORT DownloadItem : public QWidget { Q_OBJECT public: explicit DownloadItem(QListWidgetItem* item, QWebEngineDownloadItem* downloadItem, const QString &path, const QString &fileName, bool openFile, DownloadManager* manager); bool isDownloading() { return m_downloading; } bool isCancelled(); QTime remainingTime() { return m_remTime; } double currentSpeed() { return m_currSpeed; } int progress(); ~DownloadItem(); void setDownTimer(const QTime &timer) { m_downTimer = timer; } void startDownloading(); static QString remaingTimeToString(QTime time); static QString currentSpeedToString(double speed); Q_SIGNALS: void deleteItem(DownloadItem*); void downloadFinished(bool success); private Q_SLOTS: void parentResized(const QSize &size); void finished(); void downloadProgress(qint64 received, qint64 total); void stop(); void openFile(); void openFolder(); void customContextMenuRequested(const QPoint &pos); void clear(); void copyDownloadLink(); private: void updateDownloadInfo(double currSpeed, qint64 received, qint64 total); - void mouseDoubleClickEvent(QMouseEvent* e); + void mouseDoubleClickEvent(QMouseEvent* e) override; Ui::DownloadItem* ui; QListWidgetItem* m_item; QWebEngineDownloadItem* m_download; QString m_path; QString m_fileName; QTime m_downTimer; QTime m_remTime; QUrl m_downUrl; bool m_openFile; bool m_downloading; bool m_downloadStopped; double m_currSpeed; qint64 m_received; qint64 m_total; }; #endif // DOWNLOADITEM_H diff --git a/src/lib/history/historymodel.h b/src/lib/history/historymodel.h index 49b0662f..ab8caf8d 100644 --- a/src/lib/history/historymodel.h +++ b/src/lib/history/historymodel.h @@ -1,111 +1,111 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef HISTORYMODEL_H #define HISTORYMODEL_H #include #include #include "qzcommon.h" #include "history.h" class QTimer; class History; class HistoryItem; class FALKON_EXPORT HistoryModel : public QAbstractItemModel { Q_OBJECT public: enum Roles { IdRole = Qt::UserRole + 1, TitleRole = Qt::UserRole + 2, UrlRole = Qt::UserRole + 3, UrlStringRole = Qt::UserRole + 4, IconRole = Qt::UserRole + 5, IsTopLevelRole = Qt::UserRole + 7, TimestampStartRole = Qt::UserRole + 8, TimestampEndRole = Qt::UserRole + 9, MaxRole = TimestampEndRole }; explicit HistoryModel(History* history); - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex &index, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex &index, int role) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) override; - QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex &child) const; - Qt::ItemFlags flags(const QModelIndex &index) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex &child) const override; + Qt::ItemFlags flags(const QModelIndex &index) const override; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; - bool canFetchMore(const QModelIndex &parent) const; - void fetchMore(const QModelIndex &parent); + bool canFetchMore(const QModelIndex &parent) const override; + void fetchMore(const QModelIndex &parent) override; - bool hasChildren(const QModelIndex &parent) const; + bool hasChildren(const QModelIndex &parent) const override; HistoryItem* itemFromIndex(const QModelIndex &index) const; void removeTopLevelIndexes(const QList &indexes); private Q_SLOTS: void resetHistory(); void historyEntryAdded(const HistoryEntry &entry); void historyEntryDeleted(const HistoryEntry &entry); void historyEntryEdited(const HistoryEntry &before, const HistoryEntry &after); private: HistoryItem* findHistoryItem(const HistoryEntry &entry); void checkEmptyParentItem(HistoryItem* item); void init(); HistoryItem* m_rootItem; HistoryItem* m_todayItem; History* m_history; }; class FALKON_EXPORT HistoryFilterModel : public QSortFilterProxyModel { Q_OBJECT public: explicit HistoryFilterModel(QAbstractItemModel* parent); public Q_SLOTS: void setFilterFixedString(const QString &pattern); Q_SIGNALS: void expandAllItems(); void collapseAllItems(); protected: - bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; private Q_SLOTS: void startFiltering(); private: QString m_pattern; QTimer* m_filterTimer; }; #endif // HISTORYMODEL_H diff --git a/src/lib/history/historytreeview.h b/src/lib/history/historytreeview.h index 18e78e0f..77cb3759 100644 --- a/src/lib/history/historytreeview.h +++ b/src/lib/history/historytreeview.h @@ -1,77 +1,77 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef HISTORYTREEVIEW_H #define HISTORYTREEVIEW_H #include class History; class HistoryFilterModel; class HeaderView; class HistoryTreeView : public QTreeView { Q_OBJECT public: enum ViewType { HistoryManagerViewType, HistorySidebarViewType }; explicit HistoryTreeView(QWidget* parent = 0); ViewType viewType() const; void setViewType(ViewType type); // Returns empty url if more than one (or zero) urls are selected QUrl selectedUrl() const; HeaderView* header() const; Q_SIGNALS: // Open url in current tab void urlActivated(const QUrl &url); // Open url in new tab void urlCtrlActivated(const QUrl &url); // Open url in new window void urlShiftActivated(const QUrl &url); // Context menu signal with point mapped to global void contextMenuRequested(const QPoint &point); public Q_SLOTS: void search(const QString &string); void removeSelectedItems(); protected: - void contextMenuEvent(QContextMenuEvent* event); - void mouseMoveEvent(QMouseEvent* event); - void mousePressEvent(QMouseEvent* event); - void mouseReleaseEvent(QMouseEvent* event); - void mouseDoubleClickEvent(QMouseEvent* event); - void keyPressEvent(QKeyEvent* event); + void contextMenuEvent(QContextMenuEvent* event) override; + void mouseMoveEvent(QMouseEvent* event) override; + void mousePressEvent(QMouseEvent* event) override; + void mouseReleaseEvent(QMouseEvent* event) override; + void mouseDoubleClickEvent(QMouseEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; - void drawRow(QPainter* painter, const QStyleOptionViewItem &options, const QModelIndex &index) const; + void drawRow(QPainter* painter, const QStyleOptionViewItem &options, const QModelIndex &index) const override; private: History* m_history; HistoryFilterModel* m_filter; HeaderView* m_header; ViewType m_type; }; #endif // HISTORYTREEVIEW_H diff --git a/src/lib/navigation/downicon.h b/src/lib/navigation/downicon.h index 435dd989..9f1de17b 100644 --- a/src/lib/navigation/downicon.h +++ b/src/lib/navigation/downicon.h @@ -1,35 +1,35 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef DOWNICON_H #define DOWNICON_H #include "qzcommon.h" #include "clickablelabel.h" class FALKON_EXPORT DownIcon : public ClickableLabel { public: explicit DownIcon(QWidget* parent = 0); private: - void contextMenuEvent(QContextMenuEvent* ev); - void mousePressEvent(QMouseEvent* ev); + void contextMenuEvent(QContextMenuEvent* ev) override; + void mousePressEvent(QMouseEvent* ev) override; }; #endif // DOWNICON_H diff --git a/src/lib/navigation/goicon.h b/src/lib/navigation/goicon.h index f4e7f261..4e350024 100644 --- a/src/lib/navigation/goicon.h +++ b/src/lib/navigation/goicon.h @@ -1,35 +1,35 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef GOICON_H #define GOICON_H #include "qzcommon.h" #include "clickablelabel.h" class FALKON_EXPORT GoIcon : public ClickableLabel { public: explicit GoIcon(QWidget* parent = 0); private: - void contextMenuEvent(QContextMenuEvent* ev); - void mousePressEvent(QMouseEvent* ev); + void contextMenuEvent(QContextMenuEvent* ev) override; + void mousePressEvent(QMouseEvent* ev) override; }; #endif // GOICON_H diff --git a/src/lib/navigation/locationbar.h b/src/lib/navigation/locationbar.h index e130600a..37b07725 100644 --- a/src/lib/navigation/locationbar.h +++ b/src/lib/navigation/locationbar.h @@ -1,135 +1,135 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef LOCATIONBAR_H #define LOCATIONBAR_H #include "qzcommon.h" #include "lineedit.h" #include "searchenginesmanager.h" #include "loadrequest.h" class QStringListModel; class BrowserWindow; class LocationCompleter; class ClickableLabel; class TabbedWebView; class BookmarksIcon; class SiteIcon; class GoIcon; class AutoFillIcon; class BookmarkItem; class FALKON_EXPORT LocationBar : public LineEdit { Q_OBJECT public: explicit LocationBar(QWidget *parent = nullptr); struct LoadAction { enum Type { Invalid = 0, Search, Bookmark, Url }; Type type = Invalid; SearchEngine searchEngine; BookmarkItem *bookmark = nullptr; LoadRequest loadRequest; }; // BrowserWindow can be null! BrowserWindow *browserWindow() const; void setBrowserWindow(BrowserWindow *window); TabbedWebView* webView() const; void setWebView(TabbedWebView* view); static QString convertUrlToText(const QUrl &url); static SearchEngine searchEngine(); static LoadAction loadAction(const QString &text); public Q_SLOTS: void setText(const QString &text); void showUrl(const QUrl &url); void loadRequest(const LoadRequest &request); private Q_SLOTS: void textEdited(const QString &text); void requestLoadUrl(); void pasteAndGo(); void updateSiteIcon(); void updatePlaceHolderText(); void setPrivacyState(bool state); void setGoIconVisible(bool state); void showCompletion(const QString &completion, bool completeDomain); void showDomainCompletion(const QString &completion); void clearCompletion(); void loadStarted(); void loadProgress(int progress); void loadFinished(); void hideProgress(); void loadSettings(); private: enum ProgressStyle { ProgressFilled, ProgressBottom, ProgressTop }; - void contextMenuEvent(QContextMenuEvent* event); - void showEvent(QShowEvent* event); - void focusInEvent(QFocusEvent* event); - void focusOutEvent(QFocusEvent* event); - void keyPressEvent(QKeyEvent* event); - void dropEvent(QDropEvent* event); - void paintEvent(QPaintEvent* event); + void contextMenuEvent(QContextMenuEvent* event) override; + void showEvent(QShowEvent* event) override; + void focusInEvent(QFocusEvent* event) override; + void focusOutEvent(QFocusEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; + void dropEvent(QDropEvent* event) override; + void paintEvent(QPaintEvent* event) override; void refreshTextFormat(); LocationCompleter* m_completer; QStringListModel* m_domainCompleterModel; BookmarksIcon* m_bookmarkIcon; GoIcon* m_goIcon; SiteIcon* m_siteIcon; AutoFillIcon* m_autofillIcon; BrowserWindow* m_window; TabbedWebView* m_webView; bool m_holdingAlt; int m_oldTextLength; int m_currentTextLength; int m_loadProgress; bool m_progressVisible; ProgressStyle m_progressStyle; QColor m_progressColor; QTimer *m_progressTimer; }; #endif // LOCATIONBAR_H diff --git a/src/lib/navigation/navigationcontainer.h b/src/lib/navigation/navigationcontainer.h index f7256214..41e7e6c8 100644 --- a/src/lib/navigation/navigationcontainer.h +++ b/src/lib/navigation/navigationcontainer.h @@ -1,46 +1,46 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2013-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef NAVIGATIONCONTAINER_H #define NAVIGATIONCONTAINER_H #include #include "qzcommon.h" class QVBoxLayout; class TabBar; class FALKON_EXPORT NavigationContainer : public QWidget { public: explicit NavigationContainer(QWidget* parent = 0); void addWidget(QWidget* widget); void setTabBar(TabBar* tabBar); void toggleTabsOnTop(bool enable); private: - void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event) override; QVBoxLayout* m_layout; TabBar* m_tabBar; }; #endif // NAVIGATIONCONTAINER_H diff --git a/src/lib/navigation/siteicon.h b/src/lib/navigation/siteicon.h index 9b7b68d1..f4b49ef9 100644 --- a/src/lib/navigation/siteicon.h +++ b/src/lib/navigation/siteicon.h @@ -1,62 +1,62 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef SITEICON_H #define SITEICON_H #include "qzcommon.h" #include "toolbutton.h" class QTimer; class LocationBar; class WebView; class BrowserWindow; class FALKON_EXPORT SiteIcon : public ToolButton { Q_OBJECT public: explicit SiteIcon(LocationBar *parent); void setBrowserWindow(BrowserWindow *window); void setWebView(WebView* view); void setIcon(const QIcon &icon); private Q_SLOTS: void updateIcon(); void popupClosed(); private: - void contextMenuEvent(QContextMenuEvent* e); - void mousePressEvent(QMouseEvent* e); - void mouseReleaseEvent(QMouseEvent* e); - void mouseMoveEvent(QMouseEvent* e); + void contextMenuEvent(QContextMenuEvent* e) override; + void mousePressEvent(QMouseEvent* e) override; + void mouseReleaseEvent(QMouseEvent* e) override; + void mouseMoveEvent(QMouseEvent* e) override; bool showPopup(); BrowserWindow* m_window; LocationBar* m_locationBar; WebView* m_view; QTimer* m_updateTimer; QPoint m_dragStartPosition; QIcon m_icon; }; #endif // SITEICON_H diff --git a/src/lib/navigation/websearchbar.h b/src/lib/navigation/websearchbar.h index 342a4c71..7f3c4bab 100644 --- a/src/lib/navigation/websearchbar.h +++ b/src/lib/navigation/websearchbar.h @@ -1,94 +1,94 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef WEBSEARCHBAR_H #define WEBSEARCHBAR_H #include #include "qzcommon.h" #include "lineedit.h" #include "buttonwithmenu.h" #include "searchenginesmanager.h" #include "clickablelabel.h" class QStringListModel; class BrowserWindow; class LineEdit; class ClickableLabel; class SearchEnginesManager; class SearchEnginesDialog; class OpenSearchEngine; class FALKON_EXPORT WebSearchBar_Button : public ClickableLabel { public: explicit WebSearchBar_Button(QWidget* parent = 0); private: - void contextMenuEvent(QContextMenuEvent* event); + void contextMenuEvent(QContextMenuEvent* event) override; }; class FALKON_EXPORT WebSearchBar : public LineEdit { Q_OBJECT public: explicit WebSearchBar(BrowserWindow* window); private Q_SLOTS: void searchChanged(const ButtonWithMenu::Item &item); void setupEngines(); void search(); void searchInNewTab(); void aboutToShowMenu(); void openSearchEnginesDialog(); void enableSearchSuggestions(bool enable); void addSuggestions(const QStringList &list); void addEngineFromAction(); void pasteAndGo(); void instantSearchChanged(bool); private: - void focusOutEvent(QFocusEvent* e); - void dropEvent(QDropEvent* event); - void keyPressEvent(QKeyEvent* event); + void focusOutEvent(QFocusEvent* e) override; + void dropEvent(QDropEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; - void contextMenuEvent(QContextMenuEvent* event); + void contextMenuEvent(QContextMenuEvent* event) override; QCompleter* m_completer; QStringListModel* m_completerModel; OpenSearchEngine* m_openSearchEngine; SearchEngine m_activeEngine; BrowserWindow* m_window; WebSearchBar_Button* m_buttonSearch; ButtonWithMenu* m_boxSearchType; SearchEnginesManager* m_searchManager; QPointer m_searchDialog; bool m_reloadingEngines; }; #endif // WEBSEARCHBAR_H diff --git a/src/lib/network/networkmanager.h b/src/lib/network/networkmanager.h index da021abe..af7475be 100644 --- a/src/lib/network/networkmanager.h +++ b/src/lib/network/networkmanager.h @@ -1,61 +1,61 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef NETWORKMANAGER_H #define NETWORKMANAGER_H #include #include #include "qzcommon.h" class UrlInterceptor; class NetworkUrlInterceptor; class ExtensionSchemeManager; class ExtensionSchemeHandler; class FALKON_EXPORT NetworkManager : public QNetworkAccessManager { Q_OBJECT public: explicit NetworkManager(QObject *parent = Q_NULLPTR); bool certificateError(const QWebEngineCertificateError &error, QWidget *parent = Q_NULLPTR); void authentication(const QUrl &url, QAuthenticator *auth, QWidget *parent = Q_NULLPTR); void proxyAuthentication(const QString &proxyHost, QAuthenticator *auth, QWidget *parent = Q_NULLPTR); void installUrlInterceptor(UrlInterceptor *interceptor); void removeUrlInterceptor(UrlInterceptor *interceptor); void registerExtensionSchemeHandler(const QString &name, ExtensionSchemeHandler *handler); void unregisterExtensionSchemeHandler(ExtensionSchemeHandler *handler); void loadSettings(); void shutdown(); protected: - QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) Q_DECL_OVERRIDE; + QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) override; private: NetworkUrlInterceptor *m_urlInterceptor; ExtensionSchemeManager *m_extensionScheme; QHash m_ignoredSslErrors; QHash m_rejectedSslErrors; }; #endif // NETWORKMANAGER_H diff --git a/src/lib/notifications/desktopnotification.h b/src/lib/notifications/desktopnotification.h index fe040bd0..0f707a2a 100644 --- a/src/lib/notifications/desktopnotification.h +++ b/src/lib/notifications/desktopnotification.h @@ -1,59 +1,59 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef DESKTOPNOTIFICATION_H #define DESKTOPNOTIFICATION_H #include "qzcommon.h" #include #include namespace Ui { class DesktopNotification; } class FALKON_EXPORT DesktopNotification : public QWidget { Q_OBJECT public: explicit DesktopNotification(bool setPosition = false); void setPixmap(const QPixmap &icon) { m_icon = icon; } void setHeading(const QString &heading) { m_heading = heading; } void setText(const QString &text) { m_text = text; } void setTimeout(int timeout) { m_timeout = timeout; } void show(); ~DesktopNotification(); private: - void mousePressEvent(QMouseEvent* e); - void mouseMoveEvent(QMouseEvent* e); + void mousePressEvent(QMouseEvent* e) override; + void mouseMoveEvent(QMouseEvent* e) override; Ui::DesktopNotification* ui; bool m_settingPosition; QPoint m_dragPosition; QPixmap m_icon; QString m_heading; QString m_text; int m_timeout; QTimer* m_timer; }; #endif // DESKTOPNOTIFICATION_H diff --git a/src/lib/other/browsinglibrary.h b/src/lib/other/browsinglibrary.h index e0ca8423..2789191d 100644 --- a/src/lib/other/browsinglibrary.h +++ b/src/lib/other/browsinglibrary.h @@ -1,64 +1,64 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef LIBRARY_H #define LIBRARY_H #include #include "qzcommon.h" namespace Ui { class BrowsingLibrary; } class HistoryManager; class BookmarksManager; class BrowserWindow; class FALKON_EXPORT BrowsingLibrary : public QWidget { Q_OBJECT public: explicit BrowsingLibrary(BrowserWindow* window, QWidget* parent = 0); ~BrowsingLibrary(); void showHistory(BrowserWindow* window); void showBookmarks(BrowserWindow* window); void optimizeDatabase(); HistoryManager* historyManager() { return m_historyManager; } BookmarksManager* bookmarksManager() { return m_bookmarksManager; } private Q_SLOTS: void search(); void importBookmarks(); void exportBookmarks(); private: - void closeEvent(QCloseEvent* e); - void keyPressEvent(QKeyEvent* e); + void closeEvent(QCloseEvent* e) override; + void keyPressEvent(QKeyEvent* e) override; Ui::BrowsingLibrary* ui; HistoryManager* m_historyManager; BookmarksManager* m_bookmarksManager; }; #endif // LIBRARY_H diff --git a/src/lib/other/clearprivatedata.h b/src/lib/other/clearprivatedata.h index 8388d87f..537ff966 100644 --- a/src/lib/other/clearprivatedata.h +++ b/src/lib/other/clearprivatedata.h @@ -1,56 +1,56 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef CLEARPRIVATEDATA_H #define CLEARPRIVATEDATA_H #include #include "qzcommon.h" namespace Ui { class ClearPrivateData; } class FALKON_EXPORT ClearPrivateData : public QDialog { Q_OBJECT public: explicit ClearPrivateData(QWidget* parent = 0); static void clearLocalStorage(); static void clearWebDatabases(); static void clearCache(); private Q_SLOTS: void historyClicked(bool state); void dialogAccepted(); void optimizeDb(); void showCookieManager(); private: - void closeEvent(QCloseEvent* e); + void closeEvent(QCloseEvent* e) override; void restoreState(const QByteArray &state); QByteArray saveState(); Ui::ClearPrivateData* ui; }; #endif // CLEARPRIVATEDATA_H diff --git a/src/lib/other/iconchooser.h b/src/lib/other/iconchooser.h index a11f42dd..ce785ed0 100644 --- a/src/lib/other/iconchooser.h +++ b/src/lib/other/iconchooser.h @@ -1,60 +1,60 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2014 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #ifndef ICONCHOOSER_H #define ICONCHOOSER_H #include #include #include "qzcommon.h" class QIcon; namespace Ui { class IconChooser; } class FALKON_EXPORT IconChooser : public QDialog { Q_OBJECT public: explicit IconChooser(QWidget* parent = 0); ~IconChooser(); QIcon getIcon(); private Q_SLOTS: void chooseFile(); void searchIcon(const QString &string); private: Ui::IconChooser* ui; }; class FALKON_EXPORT IconChooserDelegate : public QStyledItemDelegate { public: explicit IconChooserDelegate(QWidget* parent = 0); - void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + void paint(QPainter* painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; }; #endif // ICONCHOOSER_H diff --git a/src/lib/other/statusbar.h b/src/lib/other/statusbar.h index ee24472a..97cd526a 100644 --- a/src/lib/other/statusbar.h +++ b/src/lib/other/statusbar.h @@ -1,76 +1,76 @@ /* ============================================================ * Falkon - Qt web browser * Copyright (C) 2010-2018 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ #pragma once #include #include #include "qzcommon.h" #include "squeezelabelv1.h" class QTimer; class BrowserWindow; class AbstractButtonInterface; class FALKON_EXPORT TipLabel : public SqueezeLabelV1 { Q_OBJECT public: explicit TipLabel(QWidget* parent); void show(QWidget* widget); void hideDelayed(); - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(QObject* o, QEvent* e) override; private: - void paintEvent(QPaintEvent* ev); + void paintEvent(QPaintEvent* ev) override; QTimer* m_timer; }; class FALKON_EXPORT StatusBar : public QStatusBar { Q_OBJECT public: explicit StatusBar(BrowserWindow *window); void showMessage(const QString &message, int timeout = 0); void clearMessage(); void addButton(AbstractButtonInterface *button); void removeButton(AbstractButtonInterface *button); protected: - void mousePressEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event) override; private: BrowserWindow *m_window; TipLabel *m_statusBarText; struct WidgetData { QString id; QWidget *widget = nullptr; AbstractButtonInterface *button = nullptr; }; QHash m_widgets; };